From a13f10139d33264fc9ebc5a15c75faf16fc7757e Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 7 Jul 2021 18:47:37 +0800 Subject: +Action Tool --- Assets/Scripts/Unit/Component/UnitComponent.cs | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Assets/Scripts/Unit/Component/UnitComponent.cs (limited to 'Assets/Scripts/Unit/Component/UnitComponent.cs') diff --git a/Assets/Scripts/Unit/Component/UnitComponent.cs b/Assets/Scripts/Unit/Component/UnitComponent.cs new file mode 100644 index 00000000..28f49eda --- /dev/null +++ b/Assets/Scripts/Unit/Component/UnitComponent.cs @@ -0,0 +1,28 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class UnitComponent : MonoBehaviour +{ + protected UnitController m_Owner; + + public bool IsAlive + { + get + { + return m_Owner != null; + } + } + + public virtual void Initialize() + { + m_Owner = GetComponent(); + } + + public virtual void Release() + { + m_Owner = null; + StopAllCoroutines(); + } + +} -- cgit v1.1-26-g67d0