public void Upgrade() { if (_size == 0) { SetupHouse(1, largeHouseTemplates); _fireworksEffect.SetHitBoxSize(2); } else if (_size == 1) { SetupHouse(2, megaHouseTemplates); _fireworksEffect.SetHitBoxSize(5); } StartCoroutine(ActivateFireworksSoon()); LaunchFromAbove(); IEnumerator ActivateFireworksSoon() { yield return(new WaitForSeconds(.05f)); _fireworksEffect.Activate(); } }
void Awake() { _fireworksEffect = GetComponentInChildren <FireworksEffect>(); SetupHouse(tinyHouseTemplates); _fireworksEffect.SetHitBoxSize(5); StartCoroutine(ActivateFireworksSoon()); LaunchFromAbove(); IEnumerator ActivateFireworksSoon() { yield return(new WaitForSeconds(.05f)); _fireworksEffect.Activate(); } }