コード例 #1
0
 public override void OnPlayerPick()
 {
     base.OnPlayerPick();
     GameManager.CrystalOfLevel = this;
     GuiManager.ActiveCrystal(true);
     OnDie();
 }
コード例 #2
0
        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;
                }
            }
        }