diff options
author | chai <215380520@qq.com> | 2023-06-30 19:20:16 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2023-06-30 19:20:16 +0800 |
commit | 7de061b5595c3b849c3e010ed7c7deed9ce7a1ff (patch) | |
tree | be6305a7db6645b865ecc3073ff121222ae4241b /WorldlineKeepers/Assets/Scripts/Unit/Characters/PlayerController.cs | |
parent | 6dbca86d957f774059068b8dbe01170d71cb0e8f (diff) |
Diffstat (limited to 'WorldlineKeepers/Assets/Scripts/Unit/Characters/PlayerController.cs')
-rw-r--r-- | WorldlineKeepers/Assets/Scripts/Unit/Characters/PlayerController.cs | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/WorldlineKeepers/Assets/Scripts/Unit/Characters/PlayerController.cs b/WorldlineKeepers/Assets/Scripts/Unit/Characters/PlayerController.cs index de13acb..0156045 100644 --- a/WorldlineKeepers/Assets/Scripts/Unit/Characters/PlayerController.cs +++ b/WorldlineKeepers/Assets/Scripts/Unit/Characters/PlayerController.cs @@ -5,6 +5,7 @@ using UnityEngine; namespace WK { // 玩家角色数据结构 + // // PlayerController // CharacterInfo // CharacterStats @@ -40,20 +41,30 @@ namespace WK { } + public void SetGameObject(GameObject go) + { + m_GameObject = go; + } + + public void SetBehaviour(CharacterBehaviour behaviour) + { + m_CharacterBehaviour = behaviour; + } + /// <summary> /// 逻辑更新 /// </summary> public void OnUpdate() { // preupdate - behaviour.OnPreUpdate(); + behaviour?.OnPreUpdate(); // update - info.OnUpdate(); - behaviour.OnUpdate(); + info?.OnUpdate(); + behaviour?.OnUpdate(); // post update - behaviour.OnPostUpdate(); + behaviour?.OnPostUpdate(); } } |