Exemple #1
0
 protected override void FixedUpdate()
 {
     if (ghost.standBy && !freezeMovement)
     {
         StandByMovement();
         UpdateAnimation();
     }
     else if (ghost.currentMode == Ghost.Mode.EATEN && !freezeMovement &&
              (NearGhostHouseExit() || inGhostHouse) && !AtSpecificCorner())
     {
         EnterGhostHouseMovement();
         UpdateAnimation();
     }
     else if (ghost.currentMode == Ghost.Mode.EATEN && AtSpecificCorner() && !freezeMovement)
     {
         ghost.currentMode = ghost.ChaseOrScatter();
         ExitGhostHouseMovement();
         ghost.ghostAnimation.PlayChaseOrScatter();
         UpdateAnimation();
     }
     else if (ghost.currentMode != Ghost.Mode.EATEN && inGhostHouse && !freezeMovement)
     {
         ExitGhostHouseMovement();
         UpdateAnimation();
     }
     else
     {
         UpdateTarget();
         base.FixedUpdate();
     }
 }