public override void OnEnter () { behavior = behaviorTree.Value.GetComponent<ICode.ICodeBehaviour> (); if (behavior != null) { behavior.stateMachine.SetVariable(nameOfVariable.Value, variable.Value ); } }
void Awake() { if (gameObject.name != "Sense") Debug.LogError("This NPC Sensor must have the name 'Sense'"); mySoldierScript = transform.parent.GetComponent<Soldier> (); behavior = transform.parent.gameObject.GetComponent<ICode.ICodeBehaviour> (); }