updat core

This commit is contained in:
2024-10-23 14:56:16 +08:00
parent 61972881b6
commit 4fc0810107
28 changed files with 990 additions and 68 deletions

View File

@@ -162,20 +162,34 @@ namespace Game.Component
return true;
}
}
#if UNITY_EDITOR
public bool HasRunaway => MapContent.Instance?.IsRunaway ?? false;
public float CurMoveSpeed => this._curMoveSpeedOffset * (this.MaxMoveSpeed *
(1 +
( this._expTimeHandler?.IsPlaying ?? false
? (1 - this._expTimeHandler.CurProgress) * this._expSpeedOffset
: 0f)
)
);
public float CurMoveSpeed => (MapContent.Instance?.MoveGlobalOffset ?? 0) * this._curMoveSpeedOffset * (this.MaxMoveSpeed *
(1 +
( this._expTimeHandler?.IsPlaying ?? false
? (1 - this._expTimeHandler.CurProgress) * this._expSpeedOffset
: 0f)
)
);
#else
public bool HasRunaway => MapContent.Instance.IsRunaway ?? false;
public float CurMoveSpeed => (MapContent.Instance.MoveGlobalOffset) * this._curMoveSpeedOffset * (this.MaxMoveSpeed *
(1 +
( this._expTimeHandler?.IsPlaying ?? false
? (1 - this._expTimeHandler.CurProgress) * this._expSpeedOffset
: 0f)
)
);
#endif
public void ResetState ()
{
this.transform.position = this.CreatePos;
this.AnimState.SetState (EnemyAnimStateType.Idle);
EndAttack ();
this.UpdateSpeedState (false , false);
_curAttackingTime = 0;
_curAttackCDTime = 0;
@@ -267,10 +281,11 @@ namespace Game.Component
public void CheckUpdateFsmData (bool isUpdate = false)
{
isUpdate |= _fsmData.HasAttack != this.HasAttack;
isUpdate |= _fsmData.HasSafeArea != this.HasSafeArea;
isUpdate |= _fsmData.HasRunaway != this.HasRunaway;
isUpdate |= _fsmData.HasActive != MapContent.Instance.IsActiveGame;
this._aiLerp.speed = this.CurMoveSpeed;
isUpdate |= _fsmData.HasAttack != this.HasAttack;
isUpdate |= _fsmData.HasSafeArea != this.HasSafeArea;
isUpdate |= _fsmData.HasRunaway != this.HasRunaway;
isUpdate |= _fsmData.HasActive != MapContent.Instance.IsActiveGame;
this._fsmData.HasAttack = HasAttack;
this._fsmData.HasSafeArea = HasSafeArea;
@@ -294,9 +309,8 @@ namespace Game.Component
this._expSpeedOffset = offset;
this._expTimeHandler?.Kill ();
this._expTimeHandler = GameUpdateMgr.Instance.CreateTimer (duration , null);
}
public void EndAttack ()
{
this._hasAtkState = false;