IEnumerator EndTurn(int dalay = 1) { yield return(new WaitForSeconds(dalay)); if (_battleRound == BATTLEROUND.ENEMY) { _battleRound = BATTLEROUND.PLAYER; OpenFocusTargetOfHero(false); targetOfHero = _monsterSlot[0]; _core.getATKCon().UpdateAttackSlot(); yield return(new WaitForSeconds(1)); _core.getMenuCon().gridViewTrans.Find("EndTurnButton").gameObject.SetActive(true); OpenFocusTargetOfHero(true); LoadEvent(); ShowTurnBattleNotify(); _isEscape = false; Crystal = _turnAround; _crystalMon = _turnAround; } else { _battleRound = BATTLEROUND.ENEMY; yield return(new WaitForSeconds(1)); OpenFocusTargetOfHero(false); _core.getMenuCon()._attackMenu.SetActive(false); if (_monsterSlot.ToList().Count > 0) { ShowTurnBattleNotify(); Debug.Log("runAI 1"); RunMonsterAI(); } } }
void OnEnable() { Camera.main.orthographicSize = 1f; for (int i = 0; i < _monAvatar.Length; i++) { _monAvatar[i].SetActive(false); } _monsterSlot = new int[_currentMonBatt.Length]; for (int i = 0; i < _currentMonBatt.Length; i++) { _monsterSlot[i] = i; _currentMonBatt[i].CreateAvatar(i); } _currentHeroBatt = _core._player._heroIsPlaying; _currentHeroBatt.CreateAvatar(0); targetOfHero = _monsterSlot[0]; _battleState = BATTLESTATE.Start; _isEscape = false; _battleRound = BATTLEROUND.PLAYER; _turnAround = 0; _eventAround = 0; _core.getATKCon()._blockCount = 0; Crystal = 1; _crystalMon = 1; _core.getATKCon().UpdateAttackSlot(); LoadEvent(); ShowTurnBattleNotify(); getTargetOfHero().UpdateHPBar(); _currentHeroBatt.UpdateHPBar(); OpenFocusTargetOfHero(true); OpenPanelOnStartBattle(true); }