using System; using System.Collections; using System.Collections.Generic; using UnityEngine;using UnityEngine.AI; /// <summary> /// 特效追踪,挂靠在特效物体上面的 /// </summary> public class EffectTracks : MonoBehaviour { /// <summary> /// ***目标. /// </summary> private GameObject target; public void SetEnemy(GameObject target) { this.target = target; } void Update() { Debug.DrawLine(target.transform.position , this.transform.position , Color.yellow); transform.rotation = Quaternion.Slerp( transform.rotation , Quaternion.LookRotation(target.transform.position - transform.position) , 2 * Time.deltaTime ); transform.LookAt(target.transform); transform.position += transform.forward * 8 * Time.deltaTime; if (Vector3.Distance(transform.position,target.transform.position)<=1) { Debug.Log("特效到达地方!开始自爆"); } } }
粒子特效追踪敌人 | 拾荒者 http://www.shihuangzhe.org/?p=561
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。