Ejemplo n.º 1
0
        /// <summary>
        /// ユニット検索
        /// </summary>
        /// <param name="id"></param>
        public void SearchUnit(int controlId = -1)
        {
            for (int i = 0; i < unitList.Count; i++)
            {
                if (unitList[i].CurrentUnitType == UnitType.playerTower || unitList[i].CurrentUnitType == UnitType.enemyTower)
                {
                    continue;
                }

                if (controlId != -1 && unitList[i].ControlId != controlId)
                {
                    continue;
                }

                var target = SearchTarget(unitList[i]);

                var route = board.GetRouteCells(unitList[i], target);

                unitList[i].SetMoveRouteQueue(route, target);

                if (unitList[i].ControlId == controlId)
                {
                    return;
                }
            }
        }