Ejemplo n.º 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]);
            }
        }