Example #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.name.Equals("itemCheck"))
     {
         Gamedirector.HealHP();
         Destroy(gameObject);
     }
 }
Example #2
0
 public static void Hurt()
 {
     if (isHurting)
     {
         return;
     }
     isHurting        = true;
     rigid2D.velocity = new Vector2(0, 0);
     rigid2D.velocity = new Vector2(3.0f * -key, jumpYForce);
     Gamedirector.DecreaseHP();
 }
Example #3
0
    void Update()
    {
        //接地判定
        GroundCheck();

        //アニメーションの切り替え
        SwhichAnimation();

        //スマホ用のコントローラー処理
        //TabletController();

        //PC用のコントローラー処理
        KeyboadController();

        //落ちたら戻る
        if (transform.position.y < -50)
        {
            Gamedirector.PlayerDead();
        }
    }