LivingEntityComponent.cs 441 B

123456789101112131415161718192021222324252627
  1. using UnityEngine;
  2. namespace HQFPSWeapons
  3. {
  4. /// <summary>
  5. ///
  6. /// </summary>
  7. public class LivingEntityComponent : MonoBehaviour
  8. {
  9. public LivingEntity Entity
  10. {
  11. get
  12. {
  13. if(!m_Entity)
  14. m_Entity = GetComponent<LivingEntity>();
  15. if(!m_Entity)
  16. m_Entity = GetComponentInParent<LivingEntity>();
  17. return m_Entity;
  18. }
  19. }
  20. private LivingEntity m_Entity;
  21. public virtual void OnEntityStart() { }
  22. }
  23. }