示例#1
0
 sealed protected override bool Execute(BTTreeRuntimePack _btTree) {
     if (!_btTree.IsActionRunning(this)) {
         OnEnter(_btTree);
     }
     _btTree.DeclareRunning(this);
     return OnRunning(_btTree);
 }
示例#2
0
        public bool DoExecute(BTTreeRuntimePack _runtimePack)
        {
            bool res = Execute(_runtimePack);

            if (Mgr <GameEngine> .Singleton._gameEngineMode == GameEngine.GameEngineMode.MapEditor)
            {
                _runtimePack.UpdateNodeExecutionState(this, res);
            }
            return(res);
        }
示例#3
0
 protected override bool Execute(BTTreeRuntimePack _btTree)
 {
     if (m_children != null)
     {
         bool res = false;
         foreach (BTNode node in m_children)
         {
             res = node.DoExecute(_btTree) || res;
         }
         return(res);
     }
     return(false);
 }
示例#4
0
 /**
  * @brief execute till the first True return
  **/
 protected override bool Execute(BTTreeRuntimePack _btTree)
 {
     if (m_children != null)
     {
         foreach (BTNode node in m_children)
         {
             if (node.DoExecute(_btTree))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
示例#5
0
 protected sealed override bool Execute(BTTreeRuntimePack _btTree)
 {
     if (m_child != null)
     {
         if (JudgeCondition(_btTree))
         {
             return(m_child.DoExecute(_btTree));
         }
         return(false);
     }
     else
     {
         return(JudgeCondition(_btTree));
     }
 }
示例#6
0
 public virtual void OnEnter(BTTreeRuntimePack _btTree) { }
示例#7
0
 public virtual void OnExit(BTTreeRuntimePack _btTree) { }
示例#8
0
 public virtual bool OnRunning(BTTreeRuntimePack _btTree) { return true; }
示例#9
0
 protected virtual bool JudgeCondition(BTTreeRuntimePack _btTree)
 {
     return(true);
 }
示例#10
0
 protected virtual bool Execute(BTTreeRuntimePack _runtimePack)
 {
     return(true);
 }