12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- using System;
- public class FaderEventDriven : BaseFader
- {
- protected override void ApplyFadeValue(float value)
- {
- if (this.onApplyFadeValue != null)
- {
- this.onApplyFadeValue(value);
- }
- }
- protected override float GetFadeValue()
- {
- return (this.onGetFadeValue == null) ? 0f : this.onGetFadeValue();
- }
- protected override bool CheckSkipState()
- {
- return this.onCheckSkipState != null && this.onCheckSkipState();
- }
- protected override void OnBeforeFadeIn()
- {
- if (this.onBeforeFadeIn != null)
- {
- this.onBeforeFadeIn();
- }
- }
- protected override void OnAfterFadeIn()
- {
- if (this.onAfterFadeIn != null)
- {
- this.onAfterFadeIn();
- }
- }
- protected override void OnBeforeFadeOut()
- {
- if (this.onBeforeFadeOut != null)
- {
- this.onBeforeFadeOut();
- }
- }
- protected override void OnAfterFadeOut()
- {
- if (this.onAfterFadeOut != null)
- {
- this.onAfterFadeOut();
- }
- }
- protected override void OnAbortFadeIn()
- {
- if (this.onAbortFadeIn != null)
- {
- this.onAbortFadeIn();
- }
- }
- protected override void OnAbortFadeOut()
- {
- if (this.onAbortFadeOut != null)
- {
- this.onAbortFadeOut();
- }
- }
- public Action<float> onApplyFadeValue;
- public Func<float> onGetFadeValue;
- public Func<bool> onCheckSkipState;
- public Action onBeforeFadeIn;
- public Action onAfterFadeIn;
- public Action onBeforeFadeOut;
- public Action onAfterFadeOut;
- public Action onAbortFadeIn;
- public Action onAbortFadeOut;
- }
|