private Vector3 goalPos; //The current goal position void Awake() { //SEARCHING INSTANTIATION CODE search = GetComponent <SearchingState>(); //we make search hold a reference of the SearchState script inASearch = false; //Set the searching state false by default //GEMS INSTANTIATION CODE gemTracker = gemTrackerObject.GetComponent <GemTracker>(); //This is to allows us to keep track of gems gemPositions = new List <Vector3>(); //create new list of Vector3 positions for the gems searchNewGem = true; //set the searchNewGem to true upon start closestGem = new Vector3(); //SIGHT INSTANTIATION CODE sight = GetComponent <SightController>(); //ATTACKING INSTANTIATION CODE attack = GetComponent <AttackingState>(); player = GameObject.FindGameObjectWithTag("Player"); //HEALTH INSTANTIATION CODE health = GetComponent <NPC1Health>(); //CHASE INSTANTIATION CODE chasing = false; //PLAYER DETECTION INSTANTIATION CODE playerDetectionTimer = 3f; playerPos = new Vector3(); //FLEEING INSTATIATION CODE escapePos = new Vector3(); goalPos = new Vector3(); fleeing = false; }
void Start() { gemTracker = gemTrackerObject.GetComponent <GemTracker>(); //This is to allows us to keep track of gems wordCount = 0; SetWordCountText(); SetWordText(); SetCurrentHealthText(); }
private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); } else { instance = this; DontDestroyOnLoad(this.gameObject); } }
void Awake() { gemTracker = gemTrackerObject.GetComponent <GemTracker>(); }
private GemTracker gemTracker; //Same as above void Awake() { health = GetComponent <NPC1Health>(); gemTracker = gemTrackerObject.GetComponent <GemTracker>(); //This is to allows us to keep track of gems }