private void ExitIdle(ObservableStateMachineTrigger.OnStateInfo obj)
 {
     Debug.Log("ExitIdle");
     foreach (var item in this.observableStateMachineTriggers)
     {
         var attackHit = item.OnStateUpdateAsObservable()
                         .Where(info => info.StateInfo.IsName("Attack"))
                         .SkipWhile(info => info.StateInfo.normalizedTime <= 0.5f)
                         .Take(1);
         attackHit.Subscribe(OnAttack);
     }
 }
Ejemplo n.º 2
0
        private void OnAnimatorEvent(ObservableStateMachineTrigger.OnStateInfo info)
        {
            var shortNameHash = info.StateInfo.shortNameHash;

            if (shortNameHash == _eatingId)
            {
                PlayRandomSound(_nomSounds);
            }
            else if (shortNameHash == _angerId)
            {
                PlayRandomSound(_angerSounds);
            }
            else if (shortNameHash == _catchId)
            {
                PlayRandomSound(_catchSounds);
            }
            else if (shortNameHash == _walkId)
            {
                PlayRandomSound(_satisfiedSounds);
            }
        }
 private void OnEnterIdle(ObservableStateMachineTrigger.OnStateInfo obj)
 {
     Debug.Log("EnterIdle");
 }
 private void OnAttack(ObservableStateMachineTrigger.OnStateInfo obj)
 {
     Debug.Log("Attack");
 }