Hi. Here is a code which basically detects if an object is clicked by using the box colliders and then moves to the next level accordingly. I need help in converting this script to c#. Please help me out.
if (Input.GetMouseButtonDown (0)) {
var ray = Camera.main.ScreenPointToRay (Input.mousePosition); //typical mouse click input
var hit:RaycastHit;
if (Physics.Raycast (ray, hit, 20)) {
if(hit.collider.name == "Level1Collider") //this is all of our code for triggering loading levels when a collider is clicked on
Application.LoadLevel("level1");
if(hit.collider.name == "Level2Collider")
Application.LoadLevel("level2");
if(hit.collider.name == "Level3Collider")
Application.LoadLevel("level3");
}
}