Пример #1
0
    private void OnCollisionEnter(Collision collision)
    {
        SnakeLife S = collision.gameObject.GetComponent <SnakeLife>();

        if (S != null)
        {
            S.SnakeDestroy();
        }
    }
Пример #2
0
    void OnCollisionEnter(Collision collision)
    {
        SnakeLife S = collision.gameObject.GetComponent <SnakeLife>();

        if (S != null)
        {
            S.SnakeDestroy();
        }

        Oleg O = collision.gameObject.GetComponent <Oleg>();

        if (O != null)
        {
            O.OlegDestroy();
        }
    }