Unity3D脚本:抛物线脚本.docxVIP

  • 16
  • 0
  • 约1.15千字
  • 约 3页
  • 2019-07-14 发布于湖北
  • 举报
Unity3D脚本:抛物线脚本 Posted on 2013年01月30日 by U3d / \o 查看 Unity3D脚本/插件 中的全部文章 Unity3D脚本/插件/被围观 232 次 把此脚本挂在cube上,然后把另一个cube拖到target上,把这两个物体之间设有一段距离,然后运行,就可看到效果。 using UnityEngine; using System.Collections; public class ProjectileTest : MonoBehaviour { public GameObject target; public float speed = 10; private float distanceToTarget; private bool move = true; void Start () { distanceToTarget = Vector3.Distance (this.transform.position, target.transform.position); StartCoroutine (Shoot ()); } IEnumerator Shoot () { while (move) { Vector3 targetPos = target.transform.position; this.transform.LookA

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档