public void SetAgentStatus(bool activeAgent, Status newStatus = Status.Invalid)
 {
     agentRunning = activeAgent;
     status = newStatus;
 }
    private void errorCheck(BT_TreeNode root, Status returnStatus, ref int errors, AI_Agent agent)
    {
        //RebuildTree(root);
        agent.CheckTreeVersion();
        Status beh = root.Tick(agent);

        // Check if it is the correct return type and if its not TC.invalid
        if (beh != returnStatus)
            errors++;
        if (beh == Status.Invalid)
            errors++;
    }