/// <summary> /// Pull the relevant scripts from the Pet gameobject, called once at start of game /// </summary> /// <param name="pet"></param> public void Init(GameObject pet) { _petMovement = pet.GetComponent <PetMovement>(); _foodSpawner = GameObject.Find("FoodSpawner").GetComponent <FoodSpawner>(); _stockpileArea = GameObject.Find("StockpileArea").GetComponent <StockpileArea>(); _interactor = pet.GetComponent <PetInteractor>(); _sounds = pet.GetComponent <PetSounds>(); _stats = pet.GetComponent <PetStats>(); _observer = pet.GetComponent <PetObserver>(); this._pet = pet; }
// Start is called before the first frame update void Start() { _petMovement = GetComponent <PetMovement>(); _jellyMesh = GetComponent <JellyMesh>(); _renderer = GetComponent <MeshRenderer>(); _animator = GetComponent <Animator>(); _foodSpawner = GameObject.Find("FoodSpawner").GetComponent <FoodSpawner>(); _stockpileArea = GameObject.Find("StockpileArea").GetComponent <StockpileArea>(); _interactor = GetComponent <PetInteractor>(); _sounds = GetComponent <PetSounds>(); StartCoroutine(Tick()); }
void Awake() { _spawner = GameObject.Find("FoodSpawner").GetComponent <FoodSpawner>(); stockpileArea = GameObject.Find("StockpileArea").GetComponent <StockpileArea>(); windowLocation = GameObject.Find("WindowLocation").transform; }