Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEngine.UI;
- using System.Collections;
- public class SpecDescription : MonoBehaviour
- {
- public GameObject canv; //In the inspector, you're supposed to drag the canvas on this
- void Start()
- {
- }
- // Update is called once per frame
- private void OnMouseDown()
- {
- if (Input.GetMouseButtonDown(0))
- {
- Debug.Log("Left click on object, open canvas.");
- canv.SetActive(true);
- }
- }
- public void Update ()
- {
- if (Input.GetMouseButtonDown(1))
- {
- Debug.Log("Right click anywhere on the screen, close canvas.");
- canv.SetActive(false);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement