void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Bullet") { Destroy(gameObject); //ลบตัวเอง Gamecontroller.Addscore(scorevalue); } }
void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Bullet") { Destroy(other.gameObject); lifes -= 1; if (lifes <= 0) { Destroy(gameObject); } Gamecontroller.Addscore(scorevalue); } }
public static void heart(int add, int score) { playerlifes++; //Gamecontroller gcl = new Gamecontroller(); Gamecontroller.Addscore(score); }