diff options
author | chai <chaifix@163.com> | 2021-09-01 10:29:02 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-09-01 10:29:02 +0800 |
commit | 046002902a421db273d832deea1a0a4b3b989a0c (patch) | |
tree | 278008556cf85f1776af502f613834eb91cc0c71 /Assets/Scripts/Unit/Components/UnitComponent.cs | |
parent | 5ccdd2737229a33e924e21616d56364773018086 (diff) | |
parent | e7c9ddfae65a93336d414c2af90effd1d8bada82 (diff) |
Merge branch 'master' of warmcat.org:/home/git-repo/Erika
Diffstat (limited to 'Assets/Scripts/Unit/Components/UnitComponent.cs')
-rw-r--r-- | Assets/Scripts/Unit/Components/UnitComponent.cs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Assets/Scripts/Unit/Components/UnitComponent.cs b/Assets/Scripts/Unit/Components/UnitComponent.cs new file mode 100644 index 00000000..a5034581 --- /dev/null +++ b/Assets/Scripts/Unit/Components/UnitComponent.cs @@ -0,0 +1,42 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class UnitComponent : MonoBehaviour +{ + public UnitController owner { get { return m_Owner; } } + + protected UnitController m_Owner; + + public bool IsAlive + { + get + { + return m_Owner != null; + } + } + + public virtual void Awake() + { + } + + public virtual void OnDestroy() + { + } + + public virtual void Initialize() + { + m_Owner = GetComponent<UnitController>(); + } + + public virtual void Release() + { + m_Owner = null; + StopAllCoroutines(); + } + + public virtual void OnUpdate() { } + + private void Update() { } + +} |