private void Start() { Instance = this; More_Platform = false; Multiplier_ValueTEXT.gameObject.SetActive(false); SpawnScript = GameObject.FindObjectOfType <Spawner_new>(); }
void Start() { Instance = this; minPlatformNo = 1; maxPlatformNo = 3; multiplierscript = Multiplier.Instance.GetComponent <Multiplier>(); //StartCoroutine(WeightedRandomSpawnSelector()) ; }
//Lock and Unlock Animation Couroutines /* * IEnumerator WaitforLockAnimation() * { * yield return new WaitForSeconds(2.2f); * //A gap of two seconds * Debug.Log("This part is causing the problem"); * StartCoroutine("LockAndUnlock"); * * } */ private void Update() { Max_HealthLevel = multiplier_script.multiplier_value * 100 * 0.75f; HealthFillImg.fillAmount = Mathf.Lerp(HealthFillImg.fillAmount, Current_HealthLevel / Max_HealthLevel, LerpSpeed * Time.deltaTime); if (clear_food == true) { Spawner_new spawnscript = spawnner.GetComponent <Spawner_new>(); spawnscript.enabled = false; spawnner.SetActive(false); PauseandRestartPanel.enabled = false; DelAllRemFood(); clear_food = false; } if (HealthFillImg.fillAmount >= 1 && whichHealth < 3) { //Player has cleared first multiplier value and moved to next multiplier_script.multiplier_value++; Current_HealthLevel = 1; Boom.Play(); UnlockedFruit.GetComponent <SpriteRenderer>().color = new Color(255f, 255f, 255f); //Animation to get the Lock and Unlocked Fruit up LockandUnlockFruit.Play("UnlockedFruitSwipeUp"); Debug.Log("Health fillmaount is " + HealthFillImg.fillAmount); Debug.Log("Pressed Restart and I bring the food down ... Error "); //Wait for sometime and then play the animation which brings back the lock and the star //StartCoroutine("WaitforLockAnimation"); StartCoroutine("LockAndUnlock"); } }