void Awake() { // Singleton if (instance != null && instance != this) { Destroy(gameObject); } else { instance = this; } //DontDestroyOnLoad(gameObject); }
// Start is called before the first frame update void Start() { techUI = GetComponentInParent <TechnologyUI>(); itemButton.onClick.AddListener(ShowDescription); DescriptionUI desUI = Description.GetComponent <DescriptionUI>(); createButton = desUI.CreateButton; ErrorMessage = desUI.ErrorMessage; DesCloseButton = desUI.CloseButton; createButton.onClick.AddListener(CreateObject); DesCloseButton.onClick.AddListener(CloseAll); m_Inventory = FindObjectOfType <Inventory>(); }