// Start is called before the first frame update private void OnCollisionEnter(Collision collision) { if (collision.gameObject.name == "Ball") { MyManger.Instance().block_break(); Destroy(gameObject); } }
// Start is called before the first frame update private void OnCollisionEnter(Collision collision) { if (collision.gameObject.name == "Floor") { MyManger.Instance().Game_End(); Destroy(gameObject); } }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(this.gameObject); } }
// END BLOCK from docs void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); enemies = new List <Enemy>(); boardScript = GetComponent <BoardManager>(); }