// Start is called before the first frame update void Start() { groundSpawner = GameObject.FindObjectOfType <GroundSpawner>(); player = GameObject.FindGameObjectWithTag("Player"); fog = transform.GetChild(16).GetComponent <ParticleSystem>(); playerStatus = GameObject.FindGameObjectWithTag("Player").GetComponent <ChickenStatus>(); playerStatus.counterEggSpawn++; SpawnTrees(); SpawnFruits(); //SpawnObstacle(); }
//public CinemachineVirtualCamera vcam; // CinemachineComposer com; // Start is called before the first frame update void Start() { startTime = Time.time; originalSpeed = moveSpeed; rb = GetComponent <Rigidbody>(); col = GetComponent <SphereCollider>(); animator = transform.GetChild(0).gameObject.GetComponent <Animator>(); //GetComponent<Animator>(); chSt = GetComponent <ChickenStatus>(); playerStatus = GameObject.FindGameObjectWithTag("Player").GetComponent <ChickenStatus>(); StartCoroutine(ExecuteAfterTime(4f)); //com = vcam.GetCinemachineComponent<CinemachineComposer>(); // com.m_HorizontalDamping = 7f; }
// Start is called before the first frame update void Start() { groundSpawner = GameObject.FindObjectOfType <GroundSpawner>(); player = GameObject.FindGameObjectWithTag("Player"); fog = transform.GetChild(16).GetComponent <ParticleSystem>(); playerStatus = GameObject.FindGameObjectWithTag("Player").GetComponent <ChickenStatus>(); playerStatus.counterEggSpawn++; //SpawnObstacle(); SpawnTrees(); SpawnFruits(); //int frequencyLake = Random.Range(0, 20); // if (frequencyLake < 1) // groundSpawner.SpawnLake(); }
// Start is called before the first frame update void Start() { chSt = GameObject.FindGameObjectWithTag("Player").GetComponent <ChickenStatus>(); trgtPattern = chSt.targetPatternStrength; apple.color = initialColor; banana.color = initialColor; carrot.color = initialColor; cherry.color = initialColor; grape.color = initialColor; pumpkin.color = initialColor; watermelon.color = initialColor; temp = new Image[chSt.patternSize]; statusUI = GameObject.FindGameObjectWithTag("StatusUI"); pos = statusUI.transform.GetChild(1).position; }
// Start is called before the first frame update void Start() { chs = GameObject.FindGameObjectWithTag("Player").GetComponent <ChickenStatus>(); goldenEgg = chs.goldenEgg; }
// Start is called before the first frame update void Start() { chs = GameObject.FindGameObjectWithTag("Player").GetComponent <ChickenStatus>(); heart = chs.heart; }
public Chicken(int inNumber, ChickenStatus status) { this.Number = inNumber; this.Status = status; }
// only 1 egg in the track // Start is called before the first frame update void Start() { // Debug.Log("Start first line"); //Always spawn decor groundSpawner = GameObject.FindObjectOfType <GroundSpawner>(); player = GameObject.FindGameObjectWithTag("Player"); playerStatus = GameObject.FindGameObjectWithTag("Player").GetComponent <ChickenStatus>(); fog = transform.GetChild(11).GetComponent <ParticleSystem>(); barn = groundSpawner.isBarn; eggCounter = GameObject.FindGameObjectWithTag("GoldenEggCounter"); eggs = eggCounter.GetComponent <GoldenEgg>().goldenEgg; SpawnTrees(); playerStatus.counterEggSpawn++; // eggTypeId = Random.Range(0, 3); int frequencyTypeEgg = Random.Range(0, 3); SpawnGoldenEggs(); if (!barn) //If not spawn barn { if (!groundSpawner.isStart) { //At the start of the game don't spawn obstacles //Choose if spawn a moving obstacle-less chance int moving = Random.Range(0, 8 - eggs); //More chance to generate moving obstacles when got more eggs if (hardMode) { // Avoid creating moving and stationary obstacle if (moving < 2) { SpawnObstacle(true); } else { SpawnObstacle(false); SpawnObstacle(false); if (eggs >= 2 && eggs < 4) //If collected between 2 and 4 eggs, spawn 3rd obstacle { SpawnObstacle(false); } else if (eggs >= 4) { //If collected 4 eggs, spawn 3rd and 4th obstacle SpawnObstacle(false); SpawnObstacle(false); } } } else { if (moving < 2) { SpawnObstacle(true); } else { SpawnObstacle(false); SpawnObstacle(false); if (eggs >= 2 && eggs < 4) { //If collected between 2 and 4 eggs, spawn 3rd obstacle SpawnObstacle(false); } else if (eggs >= 4) { //If collected 4 eggs, spawn 3rd and 4th obstacle SpawnObstacle(false); SpawnObstacle(false); } } } } if (groundSpawner.isStart) { transform.GetChild(11).gameObject.SetActive(false); } // Spawn only one type of object on a single tile //Spawnpotion less frequent chance int frequencyPotion = Random.Range(0, 20); if (frequencyPotion < 1) { SpawnPotion(); } SpawnFruits(); } }
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< // M E T H O D S //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> void Start() { stat = GetComponent <ChickenStatus>(); heartParticles.Stop(); }