示例#1
0
 public void Execute()
 {
     if (timeToStall != 0f)
     {
         if (timeSpentStalling < timeToStall)
         {
             timeSpentStalling += Time.deltaTime;
         }
         else
         {
             var stallingResults = new StallingResults(timeSpentStalling);
             if (stallingResultsCallback != null)
             {
                 stallingResultsCallback(stallingResults);
             }
             else
             {
                 Debug.LogWarning("Stalling State was not properly exited");
                 stateMachine.SwitchToPreviousState();
             }
         }
     }
 }
 private void StallingCycleCompleted(StallingResults stallingResults)
 {
     //Debug.Log("Stalling cycle completed after " + stallingResults.timeStalled + "seconds.");
     stateMachine.ChangeState(new IdleState(10f, IdlingLoopRestart));
 }