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(); }
public void Get_Damage() { Lives -= 1; _livesBar.Refresh(); if (Lives <= 0) { Death(); } }
private void Start() { lives = CharacterStats.lives; livesBar.Refresh(); }
public void liveadd() { lives++; livesBar.Refresh(); Debug.Log(lives); }