You've already forked taptap2024_GJ_chidouren
增加场景道具
This commit is contained in:
27
Assets/Scripts/Game/Component/SceneProp/BlueProp.cs
Normal file
27
Assets/Scripts/Game/Component/SceneProp/BlueProp.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Game.Component.SceneProp
|
||||
{
|
||||
public class BlueProp : BaseProp
|
||||
{
|
||||
[SerializeField ,Header ("加速时长")] private float _duration = 3.0f;
|
||||
[SerializeField ,Header ("额外加速幅度")] private float _speedOffset = 0.5f;
|
||||
|
||||
protected override void OnTrigger (PlayerEntity entity)
|
||||
{
|
||||
entity.AddSpeedBuff (this._duration , this._speedOffset);
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
protected void OnDrawGizmos ()
|
||||
{
|
||||
//绘制一个蓝色圆形
|
||||
Gizmos.color = Color.blue;
|
||||
Gizmos.DrawWireSphere (transform.position , 0.5f);
|
||||
//文字提示“加速”
|
||||
UnityEditor.Handles.Label (transform.position , "加速");
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user