Esempio n. 1
0
 public ActionOnPosition(GameObject init, Vector3 pos, ActionType at)
 {
     initiator      = init;
     targetPosition = pos;
     type           = at;
     IsFinished     = new IsFinishedDelegate(() =>
     {
         Vector3 dest = pos;
         if (initiator != null)
         {
             return(initiator.GetComponent <MovementController>().ReachedDestination(dest));
         }
         else
         {
             return(true);
         }
     });
 }
Esempio n. 2
0
        public ActionOnObject(GameObject init, GameObject targ, ActionType at, int roundLimit = 0)
        {
            initiator      = init;
            targetObject   = targ;
            type           = at;
            maxRounds      = roundLimit;
            roundsFinished = 0;
            switch (at)
            {
            case ActionType.HARVEST:
            {
                IsFinished = new IsFinishedDelegate(() => { return(HasRoundLimit && roundLimit <= roundsFinished); });
            } break;

            case ActionType.ATTACK:
            {
                IsFinished = new IsFinishedDelegate(() => { return((HasRoundLimit && roundLimit <= roundsFinished) || targetObject == null); });
            }
            break;
            }
        }