SpotLight.OnCollisionExit C# (CSharp) Method

OnCollisionExit() private method

private OnCollisionExit ( Collision collision ) : void
collision Collision
return void
    void OnCollisionExit(Collision collision)
    {
        occlisionObj = collision.gameObject;

        if((collision.gameObject.name != LightName))
        {
            if(collision.gameObject.name=="struss-1")
                beam_id = 1;
            else if(collision.gameObject.name=="struss-2")
                beam_id = 2;
            else if(collision.gameObject.name=="struss-3")
                beam_id = 3;
            else if(collision.gameObject.name=="struss-4")
                beam_id = 4;
            else if(collision.gameObject.name=="struss-5")
                beam_id = 5;
            else if(collision.gameObject.name=="struss-6")
                beam_id = 6;
            else if(collision.gameObject.name=="struss-7")
                beam_id = 7;
            else if(collision.gameObject.name=="struss-8")
                beam_id = 8;
            else if(collision.gameObject.name=="struss-9")
                beam_id = 9;
            else
            {
                beam_id = -1;
            }

            if(beam_id >0)
            {
                Color color = new Color(0.7f,0.7f,0.7f,1.0f);
                Material material = new Material(Shader.Find("Transparent/Diffuse"));
                material.color = color;
                collision.gameObject.renderer.material = material;
                contact = collision.contacts[0];
            }
        }
    }