Ejemplo n.º 1
0
    // If job returns false, update has completed and we can call OnEndJob
    public override bool OnUpdateJob()
    {
        if (!characterNav.WalkCurrentPath())
        {
            switch (jobState)
            {
            case 0:
                // Begin the delay, then try increment job state
                jobState = 1;
                jobController.StartCoroutine(jobController.DelayThenIncrementJobState(1.0f, this));
                break;

            case 1:
                break;

            case 2:
                // Reset our jobstate to 0 (prepare for walking or re-search pause)
                jobState = 0;

                // Attempt another random nav
                if (!characterNav.NavToRandom(targetShip))
                {
                    // Begin the delay, then try increment job state
                    jobState = 1;
                    jobController.StartCoroutine(jobController.DelayThenIncrementJobState(1.0f, this));
                }
                break;
            }
        }

        return(true);
    }
 // If job returns true, update has completed and we can call OnEndJob
 public override bool OnUpdateJob()
 {
     return(characterNav.WalkCurrentPath());
 }