您好,登錄后才能下訂單哦!
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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。