U3D自带寻路系统代码C#.docxVIP

  • 4
  • 0
  • 约小于1千字
  • 约 2页
  • 2019-07-14 发布于湖北
  • 举报
U3D自带寻路系统代码C# (2013-05-02 00:18:21) 转载▼ 标签: it 分类: Unity3d using System.Collections; public class Player : MonoBehaviour { //public Transform target; public NavMeshAgent agent; Vector3 point; Ray aray; RaycastHit ahit; public GameObject targetPoint;//这个是为了动态地确定目标点以实体显示 void Start() { targetPoint.active=false; } // Update is called once per frame void Update () { if(Input.GetMouseButtonDown (0)) { aray=Camera.main.ScreenPointToRay(Input.mousePosition); if(Physics.Raycast(aray,out ahit)) { point=ahit.point; //Instantiate(targetPoint,point,transform.rotation); targetPoint.active=true;

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档