void Start()
        {
            physiology = this.GetComponentInParent <Physiology>();

            hungerBar = transform.Find("HungerValue").gameObject;
            thirstBar = transform.Find("ThirstValue").gameObject;
            energyBar = transform.Find("EnergyValue").gameObject;

            hungerT = physiology.Hunger / 100f;
            thirstT = physiology.Thirst / 100f;
            energyT = physiology.Energy / 100f;

            hungerBar.transform.localScale = new Vector3(hungerT, 1f, 1f);
            thirstBar.transform.localScale = new Vector3(thirstT, 1f, 1f);
            energyBar.transform.localScale = new Vector3(energyT, 1f, 1f);

            player = GameObject.FindWithTag("MainCamera").transform;
            canvas = this.GetComponent <Canvas>();
        }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     dayNight        = GameObject.FindObjectOfType <DayNightCycle>();
     viAgent         = GetComponent <ViAgent>();
     agentPhysiology = GetComponent <Physiology>();
 }