예제 #1
0
 public void Update()
 {
     System.Func <bool> running = () => controller.currentStateName == "Idle" && controller.Velocity.x != 0;
     if (running())
     {
         if (!footTimer.IsTiming)
         {
             /*footTimer.BeginTiming(()=>{
              *  if(running()) {
              *      source.PlayOneShot(foot);
              *  }
              * });
              */
             source.PlayOneShot(foot, 1.3f);
             footTimer.BeginTiming();
         }
     }
 }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     timer.BeginTiming();
 }