Jak zniszczyć obiekt w jedności
Destroy(gameObject);
Envious Emu
Destroy(gameObject);
Destroy(this.gameObject);
void OnTriggerEnter()
{
if(PlayerPrefs.GetInt("GotPotion", 0) == 0)
{
// You didn't get the potion yet, so get it
Destroy(gameObject);
PlayerPrefs.SetInt("GotPotion", 1); // got the potion
}
}