|
|
|
|
|
|
DeathCube.SetActive(true); |
|
|
|
ExplosionParticles.transform.position = CubeBody.transform.position; |
|
|
|
ExplosionParticles.SetActive(true); |
|
|
|
if (impulseSource) |
|
|
|
{ |
|
|
|
impulseSource.GenerateImpulse(); |
|
|
|
} |
|
|
|
if (ResetSceneAfterDeath) |
|
|
|
{ |
|
|
|
StartCoroutine(RestartScene()); |
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// IEnumerator Explosion()
|
|
|
|
// {
|
|
|
|
// if (impulseSource)
|
|
|
|
// {
|
|
|
|
// impulseSource.GenerateImpulse();
|
|
|
|
// }
|
|
|
|
// WaitForFixedUpdate wait = new WaitForFixedUpdate();
|
|
|
|
// float timer = 0;
|
|
|
|
// while (timer < 3)
|
|
|
|
// {
|
|
|
|
// timer += Time.fixedDeltaTime;
|
|
|
|
// yield return wait;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
if (impulseSource) |
|
|
|
{ |
|
|
|
impulseSource.GenerateImpulse(); |
|
|
|
} |
|
|
|
// if (impulseSource)
|
|
|
|
// {
|
|
|
|
// impulseSource.GenerateImpulse();
|
|
|
|
// }
|
|
|
|
WaitForFixedUpdate wait = new WaitForFixedUpdate(); |
|
|
|
float timer = 0; |
|
|
|
while (timer < 3) |
|
|
|