You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
944 B
44 lines
944 B
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<step>().active = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
int sum(int a,int b,out int c)
|
|
{
|
|
c = a * b;
|
|
return a + b;
|
|
}
|
|
}
|