void Update() { if (transform.parent != null) { transform.parent = null; } Renderer.sprite = IsExit ? ExitAnimation.GetNext() : EntryAnimation.GetNext(); transform.Rotate(0, 0, 100.0f * Time.deltaTime); }
void SetAnimation() { if (spawn) { RendererRun.sprite = AnimationSpawn.GetNext(); RendererDust.sprite = null; spawn = !AnimationSpawn.IsFinished(); } else { RendererRun.sprite = AnimationRun.GetNext(); RendererDust.sprite = AnimationDust.GetNext(); } }
void SetAnimation() { if (GameState.isDead) { RendererRun.sprite = AnimationDead.GetNext(); RendererDust.sprite = null; } else if (spawn) { RendererRun.sprite = AnimationIdle.GetNext(); RendererDust.sprite = null; } else { RendererRun.sprite = AnimationRun.GetNext(); RendererDust.sprite = AnimationDust.GetNext(); } }