public override void ResetNode()
 {
     if (m_listener_context != null)
     {
         Entity owner = m_context.GetData <Entity>(BTContextKey.OwnerEntity);
         for (int i = 0; i < m_signal_datas.Count; ++i)
         {
             owner.RemoveListener(m_signal_datas[i].m_signal_id, m_listener_context.ID);
         }
         SignalListenerContext.Recycle(m_listener_context);
         m_listener_context = null;
         m_context.GetLogicWorld().UnregisterBehaviorTree(this);
         m_register_id = 0;
     }
     ClearRunningTrace();
     base.ResetNode();
     if (m_context != null)
     {
         BTContext context = m_context;
         SetContext(null);
         RecyclableObject.Recycle(context);
     }
     m_current_running_entry_index = -1;
     if (m_task != null)
     {
         m_task.Cancel();
         LogicTask.Recycle(m_task);
         m_task = null;
     }
 }
Exemple #2
0
 protected override void OnDestruct()
 {
     SignalListenerContext.Recycle(m_listener_context);
     m_listener_context = null;
     if (m_task != null)
     {
         m_task.Cancel();
         LogicTask.Recycle(m_task);
         m_task = null;
     }
 }
Exemple #3
0
 protected override void OnDestruct()
 {
     m_targeting_component = null;
     SignalListenerContext.Recycle(m_listener_context);
     m_listener_context = null;
     if (m_task != null)
     {
         m_task.Cancel();
         LogicTask.Recycle(m_task);
         m_task = null;
     }
     ClearTargets();
     m_current_enemy = null;
 }
Exemple #4
0
 protected override void OnDestruct()
 {
     if (m_listener_context != null)
     {
         if (m_master_id > 0)
         {
             Entity master = GetLogicWorld().GetEntityManager().GetObject(m_master_id);
             if (master != null)
             {
                 master.RemoveListener(SignalType.Die, m_listener_context.ID);
             }
         }
         SignalListenerContext.Recycle(m_listener_context);
         m_listener_context = null;
     }
 }
        protected override void OnDestruct()
        {
            m_locomotor_cmp = null;
            ParentObject.RemoveListener(SignalType.StartMoving, m_listener_context.ID);
            SignalListenerContext.Recycle(m_listener_context);
            m_listener_context = null;

            SkillManager skill_manager = GetLogicWorld().GetSkillManager();
            var          enumerator    = m_index2id.GetEnumerator();

            while (enumerator.MoveNext())
            {
                int skill_id = enumerator.Current.Value;
                skill_manager.DestroyObject(skill_id);
            }
        }
        protected override void OnDestruct()
        {
            if (m_listener_context != null)
            {
                ParentObject.RemoveListener(SignalType.ChangeLevel, m_listener_context.ID);
                SignalListenerContext.Recycle(m_listener_context);
                m_listener_context = null;
            }

            var enumerator = m_attributes.GetEnumerator();

            while (enumerator.MoveNext())
            {
                RecyclableObject.Recycle(enumerator.Current.Value);
            }
            m_attributes.Clear();
        }