Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class ScriptForGuy : MonoBehaviour
- {
- private Ray ray;
- private RaycastHit rayCastHit;
- void Update ()
- {
- if(Input.GetMouseButtonDown(0))
- {
- ray = Camera.main.ScreenPointToRay(Input.mousePosition);
- if(Physics.Raycast(ray, out rayCastHit))
- {
- if (rayCastHit.transform.name == "PlayButton")
- {
- Application.LoadLevel("Main Game");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement