public void Update() { if (weaponTrail == null) { return; } t = Mathf.Clamp(Time.deltaTime, 0, 0.066f); if (t > 0) { while (tempT < t) { tempT += animationIncrement; if (weaponTrail.time > 0) { weaponTrail.Itterate(Time.time - t + tempT); } else { weaponTrail.ClearTrail(); } } tempT -= t; if (weaponTrail.time > 0) { weaponTrail.UpdateTrail(Time.time, t); } } }
void LateUpdate() { t = Mathf.Clamp(Time.deltaTime, 0, 0.066f); if (t > 0) { while (tempT < t) { tempT += animationIncrement; if (myTrail.time > 0) { myTrail.Itterate(Time.time - t + tempT); } else { myTrail.ClearTrail(); } } tempT -= t; if (myTrail.time > 0) { myTrail.UpdateTrail(Time.time, t); } } }
void HandleUpdate() { // Debug.Log("Sword Effects"); weaponTrail.Iterate(Time.time); refractionTrail.Iterate(Time.time); weaponTrail.UpdateTrail(Time.time, 0f); refractionTrail.UpdateTrail(Time.time, 0f); }
// Update is called once per frame void Update() { if (FrontBlade.active) { frontTrail.Itterate(Time.time + IterateTime); frontTrail.UpdateTrail(Time.time, UpdateTrailLag); } if (BackBlade.active) { backTrail.Itterate(Time.time + IterateTime); backTrail.UpdateTrail(Time.time, UpdateTrailLag); } }
void LateUpdate() { //wt.ClearTrail(); if (null != wt) { float mAnimTime = Mathf.Clamp(Time.deltaTime * 1, 0, 0.066f); wt.Itterate(0f); if (wt.time > 0) { wt.UpdateTrail(Time.time, mAnimTime); } } }
void LateUpdate() { if (playerstate.ani_stat == playerStateLinster.enum_ani_state.Trotting || playerstate.ani_stat == playerStateLinster.enum_ani_state.Walking) { myTrail.UpdateTrail(0, 0); // myTrail.ClearTrail(); // if(myTrail.time<0) myTrail.ClearTrail(); return; } t = Mathf.Clamp(Time.deltaTime, 0, 0.066f); if (t > 0) { while (tempT < t) { tempT += animationIncrement; if (myTrail.time > 0) { myTrail.Itterate(Time.time - t + tempT); } else { myTrail.ClearTrail(); } } tempT -= t; if (myTrail.time > 0) { myTrail.UpdateTrail(Time.time, t); } } }
void LateUpdate() { if (characterAnim.doBaseSkill1) { currentWeaponTrail = baseSkill_Trail1; } else if (characterAnim.doBaseSkill2) { currentWeaponTrail = baseSkill_Trail2; } else if (characterAnim.doSkill1) { currentWeaponTrail = Skill_Trail1; } else if (characterAnim.doSkill2) { currentWeaponTrail = Skill_Trail2; } else if (characterAnim.doSkill3) { currentWeaponTrail = Skill_Trail3; } t = Mathf.Clamp(Time.deltaTime, 0, 0.066f); if (t > 0) { while (tempT < t) { tempT += animationIncrement; if (currentWeaponTrail.time > 0) { currentWeaponTrail.Itterate(Time.time - t + tempT); } else { currentWeaponTrail.ClearTrail(); } } tempT -= t; if (currentWeaponTrail.time > 0) { currentWeaponTrail.UpdateTrail(Time.time, t); } } }
void FixedUpdate() { currentBaseState = anim.GetCurrentAnimatorStateInfo(0); //只有在攻击状态中才展示刀光拖尾特效 if (currentBaseState.fullPathHash == atk1State || currentBaseState.fullPathHash == atk2State || currentBaseState.fullPathHash == atk3State) { trail.Itterate(Time.time); trail.UpdateTrail(Time.time, Time.fixedDeltaTime); } else { trail.Itterate(0); trail.UpdateTrail(Time.time, Time.fixedDeltaTime); } //可攻击控制 if (GetFire(0) && CanAttack()) { if (isFirstAttack) { anim.SetBool("Attack1", true); isFirstAttack = false; } } //一段攻击内容和切换条件 if (currentBaseState.fullPathHash == atk1State) { if (currentBaseState.normalizedTime >= 0.4f) { if (GetFire(0)) { anim.SetBool("Attack2", true); anim.SetBool("Attack1", false); } } if (currentBaseState.normalizedTime >= 0.9f) { ResetState(); } } //二段攻击内容和切换条件 if (currentBaseState.fullPathHash == atk2State) { if (currentBaseState.normalizedTime >= 0.5f) { if (GetFire(0)) { anim.SetBool("Attack3", true); anim.SetBool("Attack2", false); } } if (currentBaseState.normalizedTime >= 0.9f) { ResetState(); } } //三段攻击内容和切换条件 if (currentBaseState.fullPathHash == atk3State) { if (currentBaseState.normalizedTime >= 0.9f) { ResetState(); } } }
void LateUpdate() { swordSwipe.UpdateTrail(Time.time, 0.033f); }