public void SpawnChicken(GameObject chickenPrefab) { chickenGO = GameObject.Instantiate(chickenPrefab, new Vector3(0.2f, 0.1f, 0), Quaternion.identity); chickenGO.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f); chickenBrain = chickenGO.GetComponent <ChickenBrain>(); chickenAnimator = chickenGO.GetComponent <ChickenAnimator>(); chickenSound = chickenGO.GetComponent <ChickenSound>(); }
void Awake() { base.Awake(); _animator = GetComponent <Animator>(); _manager = FindObjectOfType <GameManager>(); _sound = GetComponent <ChickenSound>(); float angle = Random.Range(0, 2 * Mathf.PI); goTo = _manager.center.position; }
float happiness = 0; // -1 to 1 private void Awake() { chickenAnimator = GetComponent <ChickenAnimator>(); chickenSound = GetComponent <ChickenSound>(); List <Question> shuffledQuestions = new List <Question>(questions); Shuffle <Question>(shuffledQuestions); questions = shuffledQuestions.ToArray(); }