lab.AiTree.DebugRun C# (CSharp) Method

DebugRun() public method

Runs debug this tree behaviour.
public DebugRun ( AiBlackboard parameters, IList trees, int level ) : bool
parameters AiBlackboard AiBlackboard with global parameters.
trees IList Readonly list with all ai trees.
level int Level of how deep we are in this AiTree.
return bool
        public bool DebugRun(AiBlackboard parameters, IList<AiTree> trees, int level)
        {
            var result = Root.DebugRun(parameters, trees, (level + 1), 0);
            level = Mathf.Clamp(level, 0, level);
            Debug.Log(string.Format("{0}<b>Tree debug run. Result: <color={1}>{2}</color></b>", new string('\t', level), result ? "green" : "red", result));
            return result;
        }