You've already forked taptap2024_GJ_chidouren
updat core
This commit is contained in:
@@ -6,19 +6,25 @@ using UnityEngine;
|
||||
|
||||
public class AttackTimer : MonoBehaviour
|
||||
{
|
||||
[SerializeField, Header ("追逐时长")] private float AttackRealTime;
|
||||
private TimeHandler _timeHandler;
|
||||
[SerializeField , Header ("准备时间")] private float AttackBeforeTime = 1.5f;
|
||||
[SerializeField, Header ("追逐时长")] private float AttackRealTime;
|
||||
private TimeHandler _atkReadyTimeHandler;
|
||||
private TimeHandler _timeHandler;
|
||||
|
||||
[ProgressBar(0 , "Curprogress")]
|
||||
public float Curprogress => this._timeHandler?.CurProgress ?? 0;
|
||||
[ProgressBar (0 , "Curprogress")] public float Curprogress => this._timeHandler?.CurProgress ?? 0;
|
||||
|
||||
public bool IsRunning => this._timeHandler?.IsPlaying ?? false;
|
||||
|
||||
|
||||
|
||||
|
||||
public void StartAttack (Action callback)
|
||||
{
|
||||
this._timeHandler?.Kill ();
|
||||
this._timeHandler = GameUpdateMgr.Instance.CreateTimer (this.AttackRealTime , callback);
|
||||
this._timeHandler = null;
|
||||
_atkReadyTimeHandler?.Kill ();
|
||||
this._atkReadyTimeHandler = GameUpdateMgr.Instance.CreateTimer (this.AttackBeforeTime , () =>
|
||||
{
|
||||
this._timeHandler = GameUpdateMgr.Instance.CreateTimer (this.AttackRealTime , callback);
|
||||
});
|
||||
}
|
||||
|
||||
public void StopAttack ()
|
||||
|
||||
Reference in New Issue
Block a user