37 lines
1.2 KiB
C#
37 lines
1.2 KiB
C#
using System;
|
|
using System.Threading.Tasks;
|
|
using UnityEngine;
|
|
|
|
namespace EventMowForTreasure
|
|
{
|
|
[DisallowMultipleComponent]
|
|
public class EventMowForTreasureObstacleCell_CollecitonReward : EventMowForTreasureObstacleCell
|
|
{
|
|
[Header("CollectionReward")]
|
|
[SerializeField] [Tooltip("timeline 延迟 ")]
|
|
protected float collectionFlyDelayTime = 0.2f;
|
|
[SerializeField] [Tooltip("Y坐标的偏移")]
|
|
protected float offsetY = 0.1f;
|
|
|
|
protected override async Task PlayBreakEffectNormal(Action specialToolCallBack = null,bool isAwaitCallBack=false)
|
|
{
|
|
await base.PlayBreakEffectNormal();
|
|
if(isAwaitCallBack)
|
|
await PlayRewardEffect(specialToolCallBack);
|
|
else
|
|
_ = PlayRewardEffect(specialToolCallBack);
|
|
}
|
|
|
|
private async Task PlayRewardEffect(Action specialToolCallBack)
|
|
{
|
|
await Awaiters.Seconds(collectionFlyDelayTime);
|
|
specialToolCallBack?.Invoke();
|
|
}
|
|
|
|
public Vector3 GetNormalPositon()
|
|
{
|
|
var pos = normalGameObject.transform.position;
|
|
return new Vector3(pos.x, pos.y + offsetY, pos.z);
|
|
}
|
|
}
|
|
} |