using UnityEngine; using System.Collections; using UnityEngine.EventSystems; public class TransmitFunction : MonoBehaviour { private RaycastHit hit;//射线 public Vector3 CoordinatePoint; public LayerMask Tm_layerMask = -1; void Start () { } void Update () { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Input.GetMouseButton(1) && Physics.Raycast(ray, out hit, Mathf.Infinity, Tm_layerMask) && !EventSystem.current.IsPointerOverGameObject()) { CoordinatePoint= new Vector3(hit.point.x, hit.point.y + 0.3f, hit.point.z); if (LineamentEvent.gameobj!=null) { LineamentEvent.gameobj.transform.localPosition = CoordinatePoint; } } } }