public override void OnPlayerPick() { base.OnPlayerPick(); GameManager.CrystalOfLevel = this; GuiManager.ActiveCrystal(true); OnDie(); }
public override void OnTriggerEnter(GameObject collider) { base.OnTriggerEnter(collider); Player player = PlayScene.Player; if (player.IsGrounded) { if (GameManager.CrystalOfLevel != null) { source = new AudioSource(); source.Play(clip); GameManager.CrystalOfLevel.IsActive = true; GameManager.CrystalOfLevel.Position = Rect.Position + new Vector2(Rect.HalfWidth, -Rect.HalfHeight * 2); GuiManager.ActiveCrystal(false); player.ChangeState(Player.State.Idle); player.GetSprite().FlipX = false; startCountDown = true; player.StopInput = true; player.Velocity = Vector2.Zero; } } }