diff options
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(); } } |