Пример #1
0
    // Start is called before the first frame update
    private void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.name == "Ball")
        {
            MyManger.Instance().block_break();

            Destroy(gameObject);
        }
    }
Пример #2
0
    // Start is called before the first frame update
    private void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.name == "Floor")
        {
            MyManger.Instance().Game_End();

            Destroy(gameObject);
        }
    }
Пример #3
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
Пример #4
0
    // 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>();
    }