//public override void OnStart() //{ //} public override TaskStatus OnUpdate() { // Check if the NPC sees an Object with the given Tag CheckSight(); if (lastState != info.currentState) { lastState = info.currentState; return(TaskStatus.Success); } lastState = info.currentState; // Keep Checking for Changes return(TaskStatus.Running); }
private NPCInfo.npcState lastState; // Last stored State public override void OnAwake() { // Cache Variables info = npcInfo.GetValue() as NPCInfo; lastState = info.currentState; }