赞
踩
使用方法:挂载在场景中任意物体上
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
-
- public class Test : MonoBehaviour
- {
- private void Update()
- {
-
- Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
- RaycastHit raycastHit;
- if (Physics.Raycast(ray, out raycastHit, 2000))
- {
- if (Input.GetKeyDown(KeyCode.Mouse0))
- {
- Debug.Log(raycastHit.transform.name);
- }
- }
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。