protected void SearchObstacle() { if (BattleManager.Instance.obstacleCtrls.Count == 0) { return; } obstacleIndex = (obstacleIndex + 1) % BattleManager.Instance.obstacleCtrls.Count; ObstacleController obstacleCtrl = BattleManager.Instance.obstacleCtrls[obstacleIndex]; if (obstacleCtrl == null) { return; } if (obstacleCtrl.IsDiscovery(myTran, mySide, searchRange)) { SetTarget(obstacleCtrl.transform); } }