private void EnemyActions() { _roundStatusText.gameObject.SetActive(false); if (_imageDarken != null) { _imageDarken.SetActive(false); } if (_enemies.Count > 0) { SortList(_enemies); if (_enemies[0]._turn >= 200) { NewRound(); } else { _curUnit = _enemies[0]; _curUnit.UnitSelected(); AIDirector.Instance.DecideAction(_curUnit); } } else { } }
// type 1: hero 2: enemy public void FindUnit(int x, int y, int type) { if (MissionManager.Instance._missionOver || MissionManager.Instance._missionWin) { return; } ChrController unit = null; if (type == 1 && _playerPhase) { unit = _heros.Find(s => ((int)s._position.x == x) && ((int)s._position.y == y) && (s._turn < 200) && (!s._isDead)); //MenuController.Instance.ShowSelectionList = true; } else if (type == 2 && _enemyPhase) { unit = _enemies.Find(s => ((int)s._position.x == x) && ((int)s._position.y == y) && (s._turn < 200) && (!s._isDead)); } if (unit != null) { //if (unit._isDead) //{ // return; //} DeselectCurUnit(); _curUnit = unit; _curUnit.UnitSelected(); if (_playerPhase) { PlayerInputManager.Instance._inputMode = PlayerInputManager.InputModes.PathSelection; } //else if (_enemyPhase) // AIDirector.Instance._pathSelectionMode = true; } }