using System.Collections; using System.Collections.Generic; using UnityEngine; public class MouseRay : MonoBehaviour { Ray ray; // ÉäÏß RaycastHit hit; // ÉäÏß¼ì²âÆ÷ public GameObject ssss; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.E)) { Cursor.visible = true; } ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Input.GetMouseButton(0)) { if (Physics.Raycast(ray, out hit)) { Debug.Log(hit.collider.gameObject.name); if (hit.collider.gameObject.name=="Button") { ssss.GetComponent().active = true; } } } } int sum(int a,int b,out int c) { c = a * b; return a + b; } }