Skip to content

Instantly share code, notes, and snippets.

@hackertron
Created June 29, 2021 14:09
Show Gist options
  • Save hackertron/01c7cfd71484992145cea3072b9dc95b to your computer and use it in GitHub Desktop.
Save hackertron/01c7cfd71484992145cea3072b9dc95b to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class UIHandler : MonoBehaviour
{
public Button btn;
public GameObject furniture;
// Start is called before the first frame update
void Start()
{
btn = GetComponent<Button>();
btn.onClick.AddListener(SelectObject);
}
// Update is called once per frame
void Update()
{
}
void SelectObject()
{
Datahandler.Instance.furniture = furniture;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment