コード例 #1
0
ファイル: BTActionNode.cs プロジェクト: LeonXJ/Catsland-XNA
 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
ファイル: BTActionNode.cs プロジェクト: LeonXJ/Catsland-XNA
 public virtual void OnEnter(BTTreeRuntimePack _btTree) { }
コード例 #7
0
ファイル: BTActionNode.cs プロジェクト: LeonXJ/Catsland-XNA
 public virtual void OnExit(BTTreeRuntimePack _btTree) { }
コード例 #8
0
ファイル: BTActionNode.cs プロジェクト: LeonXJ/Catsland-XNA
 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);
 }