Esempio n. 1
0
        public override BTNodeStatus OnUpdate(FixPoint delta_time)
        {
            m_status = m_status_backup;
            BTActionBuffer action_buffer = m_context.GetActionBuffer();

            action_buffer.AddCurrentActions(this);
            if (m_is_running)
            {
                UpdateAction(delta_time);
            }
            else
            {
                EnterAction();
            }
            m_status_backup = m_status;
            return(m_status);
        }
Esempio n. 2
0
        public BTNodeStatus RunOnce(int entrty_id)
        {
            int new_index = EntryID2Index(entrty_id);

            if (new_index == -1)
            {
                return(BTNodeStatus.True);
            }
            BTActionBuffer action_buffer = m_context.GetActionBuffer();

            //ZZWTODO m_context的数据
            action_buffer.Backup();
            BTNodeStatus result = m_children[new_index].OnUpdate(FixPoint.Zero);

            action_buffer.SwapActions();
            action_buffer.ExitAllAction();
            action_buffer.Restore();
            m_children[new_index].ClearRunningTrace();
            return(result);
        }