Exemplo n.º 1
0
        // plays the sound effect of an on-exit event
        private IEnumerator CoroPlayStateExitSound(AnimatorNodeExitEvent eventInfo)
        {
            if (eventInfo.m_SoundStartDelaySeconds > 0)
            {
                yield return(new WaitForSeconds(eventInfo.m_SoundStartDelaySeconds));
            }

            m_AudioSources[0].PlayOneShot(eventInfo.m_SoundEffect, eventInfo.m_VolumeMultiplier);
        }
Exemplo n.º 2
0
        // creates the graphics prefab (but not the sound effect) of an on-exit event
        private IEnumerator CoroPlayStateExitFX(AnimatorNodeExitEvent eventInfo)
        {
            if (eventInfo.m_PrefabStartDelaySeconds > 0)
            {
                yield return(new WaitForSeconds(eventInfo.m_PrefabStartDelaySeconds));
            }

            Instantiate(eventInfo.m_Prefab, m_Animator.transform);
        }