天津23维预案
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.
 
 
 
 
 
 

23 lines
776 B

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;
}
}
}
}