void Start() { this.agent = GetComponent <ViAgent> (); if (this.agent == null) { Debug.LogError(gameObject.name + " has no PriorityPlanningAgent component assigned!"); } // find the time control component if (dayNight == null) { // find timer dayNight = GameObject.Find("DayNight").GetComponent <DayNightCycle>(); // initialise player //var p = GameObject.FindGameObjectWithTag("Player"); //if (p != null) //{ // player = GameObject.FindGameObjectWithTag("Player").transform; //} } this.physiology = new PhysiologyModel(dayNight.DayInMinutes * 60, this.agent.agent); }
// Use this for initialization void Start() { dayNight = GameObject.FindObjectOfType <DayNightCycle>(); viAgent = GetComponent <ViAgent>(); agentPhysiology = GetComponent <Physiology>(); }