Esempio n. 1
0
    public static Func <Vector3, StrategyPoint> Rand(StrategyPoint lhs, StrategyPoint rhs)
    {
        var pick = new bool[] { false, true, false, true, };
        var list = new List <bool>(pick);

        Func <bool> GetDir = () => {
            var draw = UnityEngine.Random.Range(0, 100) % list.Count;
            var rt   = list[draw];
            list.RemoveAt(draw);
            if (list.Count == 0)
            {
                list.AddRange(pick);
            }
            return(rt);
        };

        return(p => GetDir() ? Order(lhs, rhs)(p) : Order(rhs, lhs)(p));
    }
Esempio n. 2
0
 public static Func <Vector3, StrategyPoint> Order(StrategyPoint first, StrategyPoint second)
 {
     return(x => first.isFortressExist ? first : second);
 }
Esempio n. 3
0
 protected virtual void FindNextMovePoint()
 {
     strategyPoint = Pathfind.GetNextWaypoint(force, GetStandPlaceName(), transform.position);
     // Debug.Log(strategyPoint.name);
 }