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); } }); }
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; } }