Exemplo n.º 1
0
 // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
 override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     cursmellTime += Time.deltaTime;
     curpoopTime  += Time.deltaTime;
     //Smell Timer
     if (cursmellTime >= wormFSM.smellInterval)
     {
         cursmellTime = 0;
         wormFSM.PooSmellDetection();
     }
     //Poop Timer
     if (curpoopTime >= wormFSM.poopInterval)
     {
         curpoopTime = 0;
         wormFSM.SpawnPoop();
     }
     //Check if roaming destination has been reached
     if (astar.reachedGoal)
     {
         //transition to Set Waypoint
         animator.SetBool("WayPointReached", true);
     }
 }