public override DecisionTreeNode GetBranch() { decisiontargetScript = GetComponent <DecisionTarget>(); prioTree = GetComponent <PriorityTree>(); string objectName = decisiontargetScript.objectTraduction(this.GetComponent <DecisionTreeCreator>().target.GetComponent <PersonalityBase>()); Debug.Log("el target es : " + this.GetComponent <DecisionTreeCreator>().target); Debug.Log("el objeto es : " + objectName); GameObject aux = new GameObject(); aux.name = objectName; int priority = prioTree.GetPriority(aux, characterPersonality); Debug.Log("La prioridd del objeto es: " + priority); if (priority >= 2) { return(nodeTrue); } else { return(nodeFalse); } }
// Use this for initialization void Start() { AngleRads = Mathf.Deg2Rad * Angle; Radius = 200; VisibleConePoints = new LinkedList <Vector2>(); visibleGameobjects = new List <GameObject>(); targetsAux = new List <GameObject>(); visibleGameobjects.Capacity = 50; Objects = new List <GameObject>(); whatToDoScript = this.GetComponent <DecisionTreeISeeSomeoneWhatShouldIDo>(); decisionTargetScript = this.GetComponent <DecisionTarget>(); movementController = GameObject.FindGameObjectWithTag("GameController").GetComponent <BehaviourAdder>(); whatToDoScript = this.GetComponent <DecisionTreeISeeSomeoneWhatShouldIDo>(); Objects = VisibleElements.visibleGameObjects; objecthand = this.GetComponent <ObjectHandler>(); personality = this.GetComponent <AIPersonality>(); rememberedObject = new GameObject(); rememberedObject.name = "rememberedObjectPosition"; }