Beispiel #1
0
    /// <summary>
    /// sfx 를 start 함
    /// </summary>
    public void StartSfx(string clipName = null, bool stopAll = false, float speed = 1.0f)
    {
        if (m_anim != null)
        {
            AnimUtil.SetPositionToBegin(m_anim);

            if (string.IsNullOrEmpty(clipName))
            {
                AnimUtil.PlayAnimForward(m_anim, speed);
            }
            else
            {
                AnimUtil.PlayAnimForward(m_anim, clipName, speed, true, stopAll);
            }
        }
        else
        {
            for (int i = 0; i < m_particles.Count; ++i)
            {
                ParticleSystem x = m_particles[i];
                x.Play();
            }

            if (soundCue != null)
            {
                soundCue.method  = SoundCue.eMethod.PlayAll;
                soundCue.playMin = 0;
                soundCue.playMax = Math.Max(soundCue.audioClip.Count, 0);
                soundCue.PlaySound();
            }
        }
    }
Beispiel #2
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="animationName"></param>
    void ChangeAnimationState(string animationName)
    {
        if (m_anim == null)
        {
            return;
        }

        AnimationState state = AnimUtil.GetAnimClipAnimState(m_anim, animationName);

        if (state != null)
        {
            m_anim.clip = state.clip;
            AnimUtil.SetPositionToBegin(m_anim, animationName);
        }
    }