Esempio n. 1
0
 void Awake()
 {
     // Singleton
     if (instance != null && instance != this)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
     }
     //DontDestroyOnLoad(gameObject);
 }
Esempio n. 2
0
    // 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>();
    }