From 28b89971f0d3fd246443450c87f33996716facb3 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 15 Sep 2021 19:58:59 +0800 Subject: *misc --- Assets/Scripts/Unit/Controller/UnitController.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Assets/Scripts/Unit/Controller/UnitController.cs') diff --git a/Assets/Scripts/Unit/Controller/UnitController.cs b/Assets/Scripts/Unit/Controller/UnitController.cs index 3c09e5e6..ff3d9df2 100644 --- a/Assets/Scripts/Unit/Controller/UnitController.cs +++ b/Assets/Scripts/Unit/Controller/UnitController.cs @@ -28,7 +28,6 @@ public class UnitController : MonoBehaviour/*, Interactable*/ public PCState pcState { get { return unitState as PCState; } } public MonsterState monsterState { get { return unitState as MonsterState; } } - public UnitAnimation unitAnimation; public PCAnimation pcAnimation { get { return unitAnimation as PCAnimation; } } public MonsterAnimation monsterAnimation { get { return unitAnimation as MonsterAnimation; } } @@ -41,6 +40,8 @@ public class UnitController : MonoBehaviour/*, Interactable*/ public UnitDetail unitDetail; + public UnitBody unitBody; + public GameObject unitObj; // 角色模型 #region 事件监听 @@ -121,7 +122,11 @@ public class UnitController : MonoBehaviour/*, Interactable*/ unitCollider = gameObject.GetOrAddComponent(); unitCollider.Initialize(); - unitDetail = gameObject.GetComponentInChildren(); + unitBody = gameObject.GetOrAddComponent(); + unitBody.Initialize(); + + unitDetail = gameObject.GetComponentInChildren(); + } public virtual void Update() -- cgit v1.1-26-g67d0