Beispiel #1
0
        public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
        {
            var go    = animator.gameObject;
            int count = Parameters.ParameterList.Count;

            for (int i = 0; i < count; i++)
            {
                var elem = Parameters.ParameterList[i];
                elem.StartVolume = InAudio._getEventWorker().GetMinVolume(go, elem.Node);
                //Debug.Log("Enter " + name + " " + elem.StartVolume);
            }
            canSetVolume = true;
            Debug.Log("Enter " + Name);

            InAudio.PostEvent(go, OnEnterState.ToPost);

            int toPlayCount = OnEnterState.ToPlay.Count;
            var toPlay      = OnEnterState.ToPlay;

            for (int i = 0; i < toPlayCount; i++)
            {
                //Debug.Log("Play" + toPlay[i].Name);
                InAudio.Play(go, toPlay[i]);
            }

            int toStopCount = OnEnterState.ToStop.Count;
            var toStop      = OnEnterState.ToStop;

            for (int i = 0; i < toStopCount; i++)
            {
                InAudio.Stop(go, toStop[i]);
            }
        }
Beispiel #2
0
        public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
        {
            Debug.Log("Exit " + Name);
            canSetVolume = false;
            var go = animator.gameObject;

            InAudio.PostEvent(go, OnExitState.ToPost);

            int toPlayCount = OnExitState.ToPlay.Count;
            var toPlay      = OnExitState.ToPlay;

            for (int i = 0; i < toPlayCount; i++)
            {
                InAudio.Play(go, toPlay[i]);
            }

            int toStopCount = OnExitState.ToStop.Count;
            var toStop      = OnExitState.ToStop;

            for (int i = 0; i < toStopCount; i++)
            {
                InAudio.Stop(go, toStop[i]);
            }

            //Set Values to Max
        }
Beispiel #3
0
 public void OnPointerExit(PointerEventData eventData)
 {
     if (enabled)
     {
         if (stopNodeOnExit)
         {
             InAudio.Stop(gameObject, playNodeWhileMouseOver);
         }
     }
 }
Beispiel #4
0
        public override void OnStateMachineExit(Animator animator, int stateMachinePathHash)
        {
            var go = animator.gameObject;

            InAudio.PostEvent(go, OnExitMachine.ToPost);

            int toPlayCount = OnExitMachine.ToPlay.Count;
            var toPlay      = OnExitMachine.ToPlay;

            for (int i = 0; i < toPlayCount; i++)
            {
                InAudio.Play(go, toPlay[i]);
            }

            int toStopCount = OnExitMachine.ToPlay.Count;
            var toStop      = OnExitMachine.ToStop;

            for (int i = 0; i < toStopCount; i++)
            {
                InAudio.Stop(go, toStop[i]);
            }
        }
Beispiel #5
0
        public override void OnStateMachineEnter(Animator animator, int stateMachinePathHash)
        {
            canSetVolume = false;
            Debug.Log("Enter Machine");
            var go = animator.gameObject;

            InAudio.PostEvent(go, OnEnterMachine.ToPost);

            int toPlayCount = OnEnterMachine.ToPlay.Count;
            var toPlay      = OnEnterMachine.ToPlay;

            for (int i = 0; i < toPlayCount; i++)
            {
                InAudio.Play(go, toPlay[i]);
            }

            int toStopCount = OnEnterMachine.ToPlay.Count;
            var toStop      = OnEnterMachine.ToStop;

            for (int i = 0; i < toStopCount; i++)
            {
                InAudio.Stop(go, toStop[i]);
            }
        }