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>(); }
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(); }
void Start() { chickenAnimator = GetComponentInChildren <ChickenAnimator>(); //spawn a new recruitment prefab Assert.IsNotNull(RecruitmentPromptPrefab); spawnedPrompt = Instantiate(RecruitmentPromptPrefab, this.transform.position, Quaternion.identity, this.transform).GetComponent <RecruitmentPrompt>(); List <ControllerButton> buttons = new List <ControllerButton>() { ControllerButton.B, ControllerButton.X, ControllerButton.Y }; beginrecruitmentButton = buttons[Random.Range(0, buttons.Count)]; spawnedPrompt.Setup(beginrecruitmentButton); Activated = false; // RecruitmentPrompt.Setup(beginrecruitmentButton); }