private void OnCollisionEnter(Collision collision) { SnakeLife S = collision.gameObject.GetComponent <SnakeLife>(); if (S != null) { S.SnakeDestroy(); } }
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(); } }