예제 #1
0
        public bool UpdateState(UIAnimator a_uiAnimatorRef, AnimSetupType a_animType, float a_deltaTime)
        {
            m_timer += a_deltaTime;

            if (m_timer > m_startDelay)
            {
                m_finishedFlag = true;

                if (!m_finishedStage && m_animationInstances != null)
                {
                    for (int iIdx = 0; iIdx < m_animationInstances.Count; iIdx++)
                    {
                        if (!m_animationInstances [iIdx].UpdateState(a_uiAnimatorRef, a_animType, a_deltaTime))
                        {
                            m_finishedFlag = false;
                        }
                    }
                }

                if (m_finishedFlag)
                {
                    m_finishedStage = true;
                }

                if (m_finishedStage && m_timer > m_cachedTotalDuration)
                {
                    return(true);
                }
            }

            return(false);
        }
        public void UpdateState(UIAnimator a_uiAnimatorRef, int a_targetIndex, AnimSetupType a_animType, float a_deltaTime)
        {
            m_timers[a_targetIndex] += a_deltaTime;

            if (m_delay.GetValue(a_targetIndex) > 0 && m_timers[a_targetIndex] <= m_delay.GetValue(a_targetIndex))
            {
                // Animation is still waiting the allocated 'delay'
                return;
            }

            float postDelayStepTimer = (m_timers [a_targetIndex] - m_delay.GetValue(a_targetIndex));

            if (m_audioClipDatas != null && m_audioClipDatas.Length > 0)
            {
                // Check for whether an audio clip needs to be played
                for (int idx = 0; idx < m_audioClipDatas.Length; idx++)
                {
                    if (m_audioClipDatas [idx].Clip != null && !m_audioClipDatas [idx].HasAudioClipActivated(a_targetIndex))
                    {
                        if ((m_audioClipDatas [idx].TriggerPoint == AudioClipData.CLIP_TRIGGER_POINT.START_OF_ANIM_STEP && postDelayStepTimer > m_audioClipDatas [idx].Delay.GetValue(a_targetIndex)) ||
                            (m_audioClipDatas [idx].TriggerPoint == AudioClipData.CLIP_TRIGGER_POINT.END_OF_ANIM_STEP && postDelayStepTimer > m_duration.GetValue(a_targetIndex) - m_audioClipDatas [idx].Delay.GetValue(a_targetIndex)))
                        {
                            a_uiAnimatorRef.TriggerAudioClip(m_audioClipDatas [idx], a_targetIndex);

                            m_audioClipDatas [idx].MarkAudioClipActivated(a_targetIndex);
                        }
                    }
                }
            }

            SetAnimationProgress(a_targetIndex, a_animType, postDelayStepTimer / Mathf.Max(m_duration.GetValue(a_targetIndex), MIN_DURATION));
        }
예제 #3
0
        public bool UpdateState(UIAnimator a_uiAnimatorRef, AnimSetupType a_animType, float a_deltaTime)
        {
            m_timer += a_deltaTime;

            if (m_timer > m_startDelay)
            {
                if (IsUiAnimatorSubModule)
                {
                    return(m_uiAnimatorSubModule.UpdateState(a_animType, a_deltaTime, a_isPrimaryAnimator: false));
                }

                m_finishedFlag = true;

                for (int tIdx = 0; tIdx < m_targetObjects.Length; tIdx++)
                {
                    if (m_targetStepIndexes [tIdx] < m_animationSteps.Count)
                    {
                        if (m_targetStepIndexes [tIdx] > 0 && m_animationSteps [m_targetStepIndexes [tIdx]].WaitForPreviousComplete && !m_animationSteps [m_targetStepIndexes [tIdx]].HasStarted(tIdx))
                        {
                            if (!m_animationSteps [m_targetStepIndexes [tIdx] - 1].IsCompletelyFinished())
                            {
                                // Need to wait until previous anim step is completely finished
                                m_finishedFlag = false;
                                continue;
                            }
                        }

                        m_animationSteps [m_targetStepIndexes [tIdx]].UpdateState(a_uiAnimatorRef, tIdx, a_animType, a_deltaTime);

                        if (m_animationSteps [m_targetStepIndexes [tIdx]].IsFinished(tIdx))
                        {
                            // Finished this anim step, progress to next
                            m_targetStepIndexes [tIdx]++;
                        }

                        m_finishedFlag = false;
                    }
                }

                return(m_finishedFlag);
            }

            return(false);
        }
예제 #4
0
 public void AddNewAnimationInstance(UIAnimator a_uiAnimator)
 {
     m_animationInstances.Add(new AnimationInstance(a_uiAnimator));
 }
예제 #5
0
 public AnimationInstance(UIAnimator a_uiAnimatorSubModule)
 {
     m_uiAnimatorSubModule = a_uiAnimatorSubModule;
 }