// Use this for initialization void Start() { if (!(turnManager = this.GetComponent <Turn_Manager>())) { turnManager = this.gameObject.AddComponent <Turn_Manager>(); } if (!(_EnemyMana = this.GetComponent <Enemy_Mana>())) { _EnemyMana = this.gameObject.AddComponent <Enemy_Mana>(); } }
// Use this for initialization void Start() { if (!(_cardsOnField = this.GetComponent <OnFieldCards>())) { _cardsOnField = this.gameObject.AddComponent <OnFieldCards>(); } if (!(_enemyHand = this.GetComponent <Enemy_Hand>())) { _enemyHand = this.gameObject.AddComponent <Enemy_Hand>(); } if (!(_enemyMana = this.GetComponent <Enemy_Mana>())) { _enemyMana = this.gameObject.AddComponent <Enemy_Mana>(); } if (!(_turnManager = this.GetComponent <Turn_Manager>())) { _turnManager = this.gameObject.AddComponent <Turn_Manager>(); } //_EnemyCards = GameObject.FindGameObjectsWithTag("EnemyCard"); //minion = _cardsOnField.onPlayerField.Find(minion => minion.tag == "Taunt"); }
private void Start() { if (phrasesButtons == null || phrasesButtons.Length == 0) { Debug.Log("Should add Buttons to Input Manager"); Phrase_Selector[] tempPhraseSelector = FindObjectsOfType <Phrase_Selector>(); phrasesButtons = new Button[tempPhraseSelector.Length]; for (int i = 0; i < tempPhraseSelector.Length; i++) { phrasesButtons[i] = tempPhraseSelector[i].gameObject.GetComponent <Button>(); } } if (turnManager == null) { turnManager = FindObjectOfType <Turn_Manager>(); //temp } if (plantController == null) { plantController = FindObjectOfType <Plant_Controller>(); //temp } if (showUI == null) { showUI = FindObjectOfType <Show_UI_Gameplay>(); //No se si temp } for (int i = 0; i < phrasesButtons.Length; i++) { int temp = i; phrasesButtons[i].onClick.AddListener(() => ButtonPressed(phrasesButtons[temp].GetComponent <Phrase_Selector>())); } }