Exemplo n.º 1
0
        public override void Core()
        {
            this._frameIndex++;
            if (this._frameIndex > 20)
            {
                this._frameHitSet.Clear();
                this._frameIndex = 0;
            }
            base.Core();
            if (this._timeSlowTimer > 0f)
            {
                this._timeSlowTimer -= Time.unscaledDeltaTime;
                if (this._timeSlowTimer <= 0f)
                {
                    Time.timeScale      = 1f;
                    Time.fixedDeltaTime = 0.02f * Time.timeScale;
                    Singleton <WwiseAudioManager> .Instance.Post("Avatar_TimeSlow_End", null, null, null);

                    if (this._timeSlowDoneCallback != null)
                    {
                        this._timeSlowDoneCallback();
                        this._timeSlowDoneCallback = null;
                    }
                }
            }
            if (this._swapTimerState == LevelMinSwapTimerState.Running)
            {
                this._levelMinSwapTimer -= this.levelEntity.TimeScale * Time.deltaTime;
                if (this._levelMinSwapTimer < 0f)
                {
                    this._swapTimerState    = LevelMinSwapTimerState.Idle;
                    this._levelMinSwapTimer = 0f;
                }
            }
            if (this._avatarSwapState == AvatarSwapState.Started)
            {
                this._avatarSwapState = AvatarSwapState.Idle;
            }
            if (this._levelComboTimer > 0f)
            {
                BaseMonoAvatar localAvatar = Singleton <AvatarManager> .Instance.GetLocalAvatar();

                if (localAvatar != null)
                {
                    string currentSkillID = localAvatar.CurrentSkillID;
                    if (!string.IsNullOrEmpty(currentSkillID) && localAvatar.config.Skills.ContainsKey(currentSkillID))
                    {
                        float comboTimerPauseNormalizedTimeStart = localAvatar.config.Skills[currentSkillID].ComboTimerPauseNormalizedTimeStart;
                        float comboTimerPauseNormalizedTimeStop  = localAvatar.config.Skills[currentSkillID].ComboTimerPauseNormalizedTimeStop;
                        float currentNormalizedTime = localAvatar.GetCurrentNormalizedTime();
                        if (comboTimerPauseNormalizedTimeStart < comboTimerPauseNormalizedTimeStop)
                        {
                            if ((currentNormalizedTime > comboTimerPauseNormalizedTimeStart) && (currentNormalizedTime < comboTimerPauseNormalizedTimeStop))
                            {
                                this._comboTimerState = ComboTimerState.Pause;
                            }
                            else if (currentNormalizedTime > comboTimerPauseNormalizedTimeStop)
                            {
                                this._comboTimerState = ComboTimerState.Running;
                            }
                        }
                    }
                }
                if (this._comboTimerState == ComboTimerState.Running)
                {
                    this._levelComboTimer -= this.levelEntity.TimeScale * Time.deltaTime;
                }
                if (this._levelComboTimer < 0f)
                {
                    if (this.comboTimeUPCallback != null)
                    {
                        this.comboTimeUPCallback();
                    }
                    else
                    {
                        DelegateUtils.UpdateField(ref this.levelCombo, 0, this.onLevelComboChanged);
                    }
                }
            }
        }