Exemple #1
0
 protected override void RegisterAllComponents()
 {
     base.RegisterAllComponents();
     //初始化CPawnMovementComp
     m_movement = GetComponent <CPawnMovementComp>();
     m_follower = GetComponent <CPawnPathFollowingComp>();
 }
Exemple #2
0
        void Awake()
        {
            m_spacial = gameObject.GetComponent <CUnitSpacialComp>();
            if (m_spacial == null)
            {
                m_spacial = gameObject.AddComponent <CUnitSpacialComp>();
            }

            m_mover = gameObject.GetComponent <CPawnMovementComp>();
            if (m_mover == null)
            {
                m_mover = gameObject.AddComponent <CPawnMovementComp>();
            }

            m_pathFollower = gameObject.GetComponent <CPawnPathFollowingComp>();
            if (m_pathFollower == null)
            {
                m_pathFollower = gameObject.AddComponent <CPawnPathFollowingComp>();
            }
        }
Exemple #3
0
        protected override void OnDestroy()
        {
            base.OnDestroy();

            m_movement = null;
        }
 void Start()
 {
     m_spacial = GetComponent <CUnitSpacialComp>();
     m_mover   = GetComponent <CPawnMovementComp>();
 }