public override void Update(WorkableEntity caller)
    {
        if (currentWork == null)
        {
            DoWalk();
        }

        if (currentWork.IsDone(caller))
        {
            if (currentWork is MovePointWork)
            {
                DoWait();
            }
            else
            {
                DoWalk();
            }
        }

        currentWork.Update(caller);
    }
Exemple #2
0
 public override bool IsDone(WorkableEntity caller)
 {
     return((Vector2)caller.transform.position == targetPosition);
 }
Exemple #3
0
 public override void Update(WorkableEntity caller)
 {
     caller.SetTargetPosition(targetPosition);
 }
 public override void Update(WorkableEntity caller)
 {
     currentWaitTime += Time.deltaTime;
 }
 public override bool IsDone(WorkableEntity caller)
 {
     return(currentWaitTime >= waitTime);
 }
 public override bool IsDone(WorkableEntity caller)
 {
     return(caller.WorkManager.HasWork);
 }
Exemple #7
0
 public override bool IsDone(WorkableEntity caller)
 {
     return(false);
 }
Exemple #8
0
 public override void Update(WorkableEntity caller)
 {
     caller.SetTargetPosition(Target.transform.position);
 }
 public virtual void Update(WorkableEntity caller)
 {
 }
 public abstract bool IsDone(WorkableEntity caller);
Exemple #11
0
 public override void Update(WorkableEntity caller)
 {
     caller.SetTargetPosition((Vector2)caller.transform.position + direction);
 }