void OnCollisionEnter(Collision collision)
{
// print("Collided with " + collision.gameObject.name);
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.0f,0.8f,0.2f,0.7f);
Material material = new Material(Shader.Find("Transparent/Diffuse"));
material.color = color;
collision.gameObject.renderer.material = material;
MouseController.occlision = beam_id;
contact = collision.contacts[0];
}
//BeamTranslation(beam_id);
}
}