using System.Collections; using System.Collections.Generic; using UnityEngine;
publicclassObejctMouseSelector : MonoBehaviour { voidUpdate() { if (Input.GetMouseButtonDown(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit)) { PrintTargetInfo(hit); } } }