From a5c191cf74238084d9bd9f805b4b6755f70d956d Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 1 Sep 2021 08:30:42 +0800 Subject: =?UTF-8?q?*=E6=94=B9=E5=8F=98=E7=9B=AE=E5=BD=95=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Unit/Component/MonsterAnimation.cs | 110 ---------------------- 1 file changed, 110 deletions(-) delete mode 100644 Assets/Scripts/Unit/Component/MonsterAnimation.cs (limited to 'Assets/Scripts/Unit/Component/MonsterAnimation.cs') diff --git a/Assets/Scripts/Unit/Component/MonsterAnimation.cs b/Assets/Scripts/Unit/Component/MonsterAnimation.cs deleted file mode 100644 index 4db4b07f..00000000 --- a/Assets/Scripts/Unit/Component/MonsterAnimation.cs +++ /dev/null @@ -1,110 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class MonsterAnimation : UnitAnimation -{ - public enum ELayer - { - Basic = 0, - - Count, - } - - // 动作名,和animator里的state对应 - public enum EAnimState - { - // layer 0 - Idle = 0, - Move, - Jump, - Hit, - Attack, - Rise, - Stinger, - Turn, - Landing, - - AirAttack0, - AirAttack1, - AirAttack2, - AirAttack3, - - Attack0, - Attack1, - Attack2, - Attack3, - } - - public override void Initialize() - { - base.Initialize(); - - m_Animator = this.m_Owner.unitObj.GetComponent(); - - m_Animator.speed = 0; - - m_LayerInfo = new AnimatorLayerInfo[2]; - m_LayerInfo[0] = new AnimatorLayerInfo(this, m_Animator, (int)ELayer.Basic); - //m_LayerInfo[1] = new AnimatorLayerInfo(this, m_Animator, ELayer.Attack); - - if (m_Animator == null) - { - LogHelper.LogError("没有挂Animator组件"); - } - - } - - public override void OnUpdate() - { - base.OnUpdate(); - - UpdateLayer(); - UpdateAnimation(); - UpdateRootMotion(); - } - - void UpdateLayer() - { - m_LayerInfo[0].OnUpdate(); - return; - for (int i = 0; i < m_LayerInfo.Length; ++i) - { - m_LayerInfo[i].OnUpdate(); - } - } - - void UpdateAnimation() - { - m_Animator.speed = 1; - m_Animator.Update(Time.deltaTime); - m_Animator.speed = 0; - } - - void UpdateRootMotion() - { - m_Owner.unitRootMotion.UpdateRootMotion(); - } - - public void AnimIdle() - { - m_Animator.CrossFade("Idle", 0.2f, 0); - } - - public void AnimHitLight() - { - m_Animator.Play("HitLight", 0, 0); - //m_Animator.CrossFade("HitLight", 0.05f, 0, 0, 0); - } - public void AnimHitAir() - { - m_Animator.Play("HitAir", 0, 0); - //m_Animator.CrossFade("HitLight", 0.05f, 0, 0, 0); - } - - public void AnimRise() - { - m_Animator.CrossFade("Rise", 0); - } - -} -- cgit v1.1-26-g67d0