void OnTakeDamageHandler(TakeDamageData data) { if (data.go == null) { return; } switch (data.spriteEffectType) { case SpriteEffectType.Blink: StartCoroutine(DoBlink(data.go, MatBlink, data.spriteEffectDuration)); break; case SpriteEffectType.BlinkDark: StartCoroutine(DoBlink(data.go, MatBinkDark, data.spriteEffectDuration)); break; case SpriteEffectType.NeonColor: StartCoroutine(SwapMat(data.go, MatNeon, data.spriteEffectDuration)); break; default: break; } }
void OnTakeDamageHandler(TakeDamageData data) { if (data.go == null) { return; } switch (data.spriteEffectType) { case SpriteEffectType.Blink: StartCoroutine(DoBlink(data.go, MatBlink)); break; case SpriteEffectType.BlinkDark: StartCoroutine(DoBlink(data.go, MatBinkDark)); break; default: break; } }
public void OnTakeDamage(TakeDamageData data) { OnTakeDamageHandler?.Invoke(data); }
// TODO: chang ethis datatype to a dedicated one public void OnSpriteEffect(TakeDamageData data) { OnSpriteEffectHandler?.Invoke(data); }