// Method sent to start spawning candy public void FinishSpawningCandy() { count = 0; instancesDone = 0; spawningCandy = false; AssemblyLineEnd.Reset(); ScanLevels(true); levelProgress.SaveData(levelID, 0, 0); // Scan all of the candy to be spawned in the level to reset instances foreach (SpawnCandyInstance instance in spawningCandies) { instance.CandyNotSpawning(); } // Destroy remaining candies for (int i = 0; i < GameObject.FindObjectsOfType <Candy>().Length; i++) { Destroy(GameObject.FindObjectsOfType <Candy>()[i].gameObject); } }
private IEnumerator ItemReachedEndCoroutine(AssemblyLineEnd end) { Velocity = Vector3.zero; float time = 0.3f; float curTime = 0.0f; Vector3 scale = transform.localScale; while(curTime <= time) { transform.localScale = end.objectDisappearCurve.Evaluate(curTime / time) * scale; curTime += Time.deltaTime; yield return new WaitForEndOfFrame(); } if (done) { GameManager.AddHujen(cashValue); } Destroy(gameObject); }
public void ItemReachedEnd(AssemblyLineEnd end) { StartCoroutine(ItemReachedEndCoroutine(end)); }