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(); } } }
// Use this for initialization void Start() { timer.BeginTiming(); }