void Start() { petBelly = GameObject.Find("PetGarden").GetComponent<PetBelly>(); }
// Use this for initialization void Start() { if (!GameObject.Find("PetGarden")) { Instantiate(petGardenPrefab).name = "PetGarden"; } petBelly = GameObject.Find("PetGarden").GetComponent<PetBelly>(); petInventory = GameObject.Find("PetGarden").GetComponent<Inventory>(); }
void Start() { myPetObject = this.gameObject; FOV = transform.FindChild("PetFOV").GetComponent<PetFieldOfView>(); petStats = GameObject.Find("PetGarden").GetComponent<PetStats>(); petBelly = GameObject.Find("PetGarden").GetComponent<PetBelly>(); petInventory = GameObject.Find("PetGarden").GetComponent<Inventory>(); myEnergy = petBelly.GetMaxEnergy(); }