多轮审查和修复
This commit is contained in:
@@ -23,6 +23,7 @@ namespace BaseGames.VFX
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Debug.Assert(_config != null, "[HurtFlashController] _config 未赋值,请在 Inspector 中指定 FeedbackConfigSO。", this);
|
||||
if (_renderer == null)
|
||||
_renderer = GetComponent<SpriteRenderer>();
|
||||
_block = new MaterialPropertyBlock();
|
||||
@@ -39,7 +40,7 @@ namespace BaseGames.VFX
|
||||
private IEnumerator FlashCoroutine()
|
||||
{
|
||||
SetFlash(1f);
|
||||
yield return new WaitForSeconds(_config != null ? _config.HurtFlashDuration : 0.12f);
|
||||
yield return new WaitForSeconds(_config.HurtFlashDuration);
|
||||
SetFlash(0f);
|
||||
_flashCoroutine = null;
|
||||
}
|
||||
@@ -47,8 +48,7 @@ namespace BaseGames.VFX
|
||||
private void SetFlash(float amount)
|
||||
{
|
||||
_renderer.GetPropertyBlock(_block);
|
||||
if (_config != null)
|
||||
_block.SetColor(FlashColorID, _config.HurtFlashColor);
|
||||
_block.SetColor(FlashColorID, _config.HurtFlashColor);
|
||||
_block.SetFloat(FlashAmountID, amount);
|
||||
_renderer.SetPropertyBlock(_block);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user