void OnTriggerEnter2D(Collider2D col) { if (col.tag == "DeerBody") { Deer.GetInstance().currentHealth -= damage; DeerHealthSlider.GetInstance().UpdateHealth(); Destroy(gameObject); } }
void Awake() { if (instance == null) { instance = this; } else { Destroy(this); } }