public void LockCurAnimsFrame(string lockinfoStr) { m_LockFramInfo = new LockFrameInfo(lockinfoStr); if (m_LockFramInfo.m_IsNeedCollide) { SkillColliderManager manager = gameObject.GetComponent <SkillColliderManager>(); if (manager == null || manager.GetColliders().Count <= 0) { return; } } AnimationClip cur_anim = GetCurPlayingAnims(); if (cur_anim == null) { return; } m_LockFramInfo.m_LockedAnim = cur_anim; m_LockFramInfo.m_AnimTime = m_Animation[cur_anim.name].time; m_LockFramInfo.m_IsPaused = false; if (m_LockFramInfo.m_RemainTime == 0) { SetLockAnimsSpeed(m_LockFramInfo.m_AfterLockAnimSpeed); m_LockFramInfo = null; } }
public LockFrameModifier(LockFrameInfo lockFrameInfo, Entity caster, Entity target, PromiseWorld entityWorld, Environment environment, CollectionOfInteractions modifierInteractionCollection) : base(lockFrameInfo, caster, target, environment, modifierInteractionCollection) { this.lockFrameInfo = lockFrameInfo; this.caster = caster; this.target = target; this.entityWorld = entityWorld; }
protected override List <Lifetime> CreateLifetimes(ModifierInfo modifierInfo) { LockFrameInfo lfi = (LockFrameInfo)modifierInfo; float durationForTarget = lfi.DelayForTarget + lfi.DurationForTarget; float durationForCaster = lfi.DelayForCaster + lfi.DurationForCaster; float durationForGlobal = lfi.DelayForGlobal + lfi.DurationForGlobal; float duration = Math.Max(Math.Max(durationForTarget, durationForCaster), durationForGlobal); lifetime = new DurationBasedLifetime(duration, true); return(new List <Lifetime>(new[] { lifetime })); }
private void UpdateLockFrame() { if (m_LockFramInfo == null) { return; } if (m_LockFramInfo.m_RemainTime == 0) { return; } if (!m_LockFramInfo.m_IsPaused) { SetLockAnimsSpeed(0); m_LockFramInfo.m_IsPaused = true; } m_LockFramInfo.m_RemainTime -= Time.deltaTime; if (m_LockFramInfo.m_RemainTime <= 0) { SetLockAnimsSpeed(m_LockFramInfo.m_AfterLockAnimSpeed); m_LockFramInfo.m_RemainTime = 0; m_LockFramInfo = null; } }