예제 #1
0
    public override void ReceiveDamage(Vector3 pos)
    {
        rigidbody.velocity = Vector3.zero;
        if (pos.x > transform.position.x)
        {
            rigidbody.AddForce(transform.right * (-10F), ForceMode2D.Impulse);
        }
        else
        {
            rigidbody.AddForce(transform.right * 10F, ForceMode2D.Impulse);
        }


        if (pos.y > transform.position.y)
        {
            rigidbody.AddForce(transform.up * -20.0F, ForceMode2D.Impulse);
        }

        else
        {
            rigidbody.AddForce(transform.up * 20.0F, ForceMode2D.Impulse);
        }



        cats--;
        Debug.Log(Cats);
        livesBar.Refresh();
    }
예제 #2
0
 public void Get_Damage()
 {
     Lives -= 1;
     _livesBar.Refresh();
     if (Lives <= 0)
     {
         Death();
     }
 }
예제 #3
0
 private void Start()
 {
     lives = CharacterStats.lives;
     livesBar.Refresh();
 }
예제 #4
0
 public void liveadd()
 {
     lives++;
     livesBar.Refresh();
     Debug.Log(lives);
 }