You've already forked taptap2024_GJ_chidouren
增加特效 ,优化道具外观
This commit is contained in:
@@ -31,9 +31,11 @@ namespace Game.Component
|
||||
// 获取前方方向的世界坐标
|
||||
Vector3 forward = (Vector3)vector;
|
||||
//根据遥感向量获取一个0,1的移动速度系数
|
||||
float speedOffset = forward.magnitude;
|
||||
Quaternion targetRotation = Quaternion.FromToRotation (Vector3.up , forward.normalized);
|
||||
transform.rotation = Quaternion.Lerp (transform.rotation , targetRotation , 0.25f);
|
||||
float speedOffset = forward.magnitude;
|
||||
Quaternion targetRotation = Quaternion.FromToRotation (Vector3.up , forward.normalized);
|
||||
var targetRotationEulerAngles = targetRotation.eulerAngles;
|
||||
targetRotationEulerAngles = new Vector3 (0 , 0 , targetRotationEulerAngles.z);
|
||||
transform.rotation = Quaternion.Euler (targetRotationEulerAngles);
|
||||
// Debug.DrawLine (transform.position , transform.position + forward , Color.magenta);
|
||||
this.transform.Translate ( Vector3.up * speedOffset * CurSpeed * Time.deltaTime);
|
||||
// this.rigidbody2D.MovePosition (t.position + ((Vector3)vector * speed * Time.deltaTime));
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Game.Component.SceneProp
|
||||
/// </summary>
|
||||
public class BaseProp : MonoBehaviour
|
||||
{
|
||||
[SerializeField, Header ("触发特效")] private string effectPoolPath;
|
||||
[SerializeField, Header ("触发特效")] protected string effectPoolPath;
|
||||
|
||||
// 间隔cd
|
||||
[SerializeField , Header ("间隔cd")] private float _invalidTime = 0f;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using Framework.GamePool.manager;
|
||||
using Sirenix.Utilities;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Game.Component.SceneProp
|
||||
@@ -20,6 +22,12 @@ namespace Game.Component.SceneProp
|
||||
{
|
||||
if (this.isReady)
|
||||
{
|
||||
if (!this.effectPoolPath.IsNullOrWhitespace ())
|
||||
{
|
||||
var transform1 = this.transform;
|
||||
GamePoolManager.Instance.InstantiatePoolObject<PropEffect_PoolObject> (this.effectPoolPath).transform.position
|
||||
= transform1.position;
|
||||
}
|
||||
var entity = other.gameObject.GetComponent<PlayerEntity> ();
|
||||
this.OnTrigger (entity);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using Framework.GamePool.manager;
|
||||
using Sirenix.Utilities;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Game.Component.SceneProp
|
||||
@@ -21,6 +23,11 @@ namespace Game.Component.SceneProp
|
||||
{
|
||||
if (isReady)
|
||||
{
|
||||
if (!this.effectPoolPath.IsNullOrWhitespace ())
|
||||
{
|
||||
GamePoolManager.Instance.InstantiatePoolObject<PropEffect_PoolObject> (this.effectPoolPath).transform.position
|
||||
= this._a_pos.parent.position;
|
||||
}
|
||||
var player = other.gameObject.GetComponent<PlayerEntity> ();
|
||||
this.ToPos (player , this._b_pos);
|
||||
if (HasOnce)
|
||||
|
||||
Reference in New Issue
Block a user