Ejemplo n.º 1
0
        //Функция проверки компонентов
        private void CheckComponents()
        {
            Debug.Log("AttackButton.CheckComponents()");
            if (button == null)
            {
                button = gameObject.GetComponent <Button>();
            }

            if (buttonImage == null)
            {
                buttonImage = gameObject.GetComponent <Image>();
            }

            if (attackMenu == null)
            {
                attackMenu = AttackMenu.instance;
            }

            if (!button || !buttonImage || !attackMenu)
            {
                Debug.LogError("Components are missing!");
            }
        }
Ejemplo n.º 2
0
 private void Awake()
 {
     instance = this;
 }