diff options
author | chai <chaifix@163.com> | 2021-09-01 08:30:42 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-09-01 08:30:42 +0800 |
commit | a5c191cf74238084d9bd9f805b4b6755f70d956d (patch) | |
tree | 06c0f5a85e6bda587205e5b2bea8e2d9fab4f373 /Assets/Scripts/Unit/Component/MonsterAnimation.cs | |
parent | 340bb7224b4f100413541df3b937d90be028a8b1 (diff) |
*改变目录结构
Diffstat (limited to 'Assets/Scripts/Unit/Component/MonsterAnimation.cs')
-rw-r--r-- | Assets/Scripts/Unit/Component/MonsterAnimation.cs | 110 |
1 files changed, 0 insertions, 110 deletions
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<Animator>();
-
- 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);
- }
-
-}
|