//Функция проверки компонентов 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!"); } }
private void Awake() { instance = this; }