#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Threading; using UnityEngine; using UnityEngine.EventSystems; namespace UniRx.Async.Triggers { #region FixedUpdate public interface IAsyncFixedUpdateHandler { UniTask FixedUpdateAsync(); } public partial class AsyncTriggerHandler : IAsyncFixedUpdateHandler { UniTask IAsyncFixedUpdateHandler.FixedUpdateAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncFixedUpdateTrigger GetAsyncFixedUpdateTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncFixedUpdateTrigger GetAsyncFixedUpdateTrigger(this Component component) { return component.gameObject.GetAsyncFixedUpdateTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncFixedUpdateTrigger : AsyncTriggerBase { TriggerEvent fixedUpdateTriggerEvent; void FixedUpdate() { fixedUpdateTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncFixedUpdateHandler GetFixedUpdateAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref fixedUpdateTriggerEvent), false); } public IAsyncFixedUpdateHandler GetFixedUpdateAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref fixedUpdateTriggerEvent), cancellationToken, false); } public UniTask FixedUpdateAsync() { return ((IAsyncFixedUpdateHandler)new AsyncTriggerHandler(SetTriggerEvent(ref fixedUpdateTriggerEvent), true)).FixedUpdateAsync(); } public UniTask FixedUpdateAsync(CancellationToken cancellationToken) { return ((IAsyncFixedUpdateHandler)new AsyncTriggerHandler(SetTriggerEvent(ref fixedUpdateTriggerEvent), cancellationToken, true)).FixedUpdateAsync(); } } #endregion #region LateUpdate public interface IAsyncLateUpdateHandler { UniTask LateUpdateAsync(); } public partial class AsyncTriggerHandler : IAsyncLateUpdateHandler { UniTask IAsyncLateUpdateHandler.LateUpdateAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncLateUpdateTrigger GetAsyncLateUpdateTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncLateUpdateTrigger GetAsyncLateUpdateTrigger(this Component component) { return component.gameObject.GetAsyncLateUpdateTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncLateUpdateTrigger : AsyncTriggerBase { TriggerEvent lateUpdateTriggerEvent; void LateUpdate() { lateUpdateTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncLateUpdateHandler GetLateUpdateAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref lateUpdateTriggerEvent), false); } public IAsyncLateUpdateHandler GetLateUpdateAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref lateUpdateTriggerEvent), cancellationToken, false); } public UniTask LateUpdateAsync() { return ((IAsyncLateUpdateHandler)new AsyncTriggerHandler(SetTriggerEvent(ref lateUpdateTriggerEvent), true)).LateUpdateAsync(); } public UniTask LateUpdateAsync(CancellationToken cancellationToken) { return ((IAsyncLateUpdateHandler)new AsyncTriggerHandler(SetTriggerEvent(ref lateUpdateTriggerEvent), cancellationToken, true)).LateUpdateAsync(); } } #endregion #region AnimatorIK public interface IAsyncOnAnimatorIKHandler { UniTask OnAnimatorIKAsync(); } public partial class AsyncTriggerHandler : IAsyncOnAnimatorIKHandler { UniTask IAsyncOnAnimatorIKHandler.OnAnimatorIKAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncAnimatorIKTrigger GetAsyncAnimatorIKTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncAnimatorIKTrigger GetAsyncAnimatorIKTrigger(this Component component) { return component.gameObject.GetAsyncAnimatorIKTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncAnimatorIKTrigger : AsyncTriggerBase { TriggerEvent onAnimatorIKTriggerEvent; void OnAnimatorIK(int layerIndex) { onAnimatorIKTriggerEvent?.TrySetResult((layerIndex)); } public IAsyncOnAnimatorIKHandler GetOnAnimatorIKAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onAnimatorIKTriggerEvent), false); } public IAsyncOnAnimatorIKHandler GetOnAnimatorIKAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onAnimatorIKTriggerEvent), cancellationToken, false); } public UniTask OnAnimatorIKAsync() { return ((IAsyncOnAnimatorIKHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onAnimatorIKTriggerEvent), true)).OnAnimatorIKAsync(); } public UniTask OnAnimatorIKAsync(CancellationToken cancellationToken) { return ((IAsyncOnAnimatorIKHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onAnimatorIKTriggerEvent), cancellationToken, true)).OnAnimatorIKAsync(); } } #endregion #region AnimatorMove public interface IAsyncOnAnimatorMoveHandler { UniTask OnAnimatorMoveAsync(); } public partial class AsyncTriggerHandler : IAsyncOnAnimatorMoveHandler { UniTask IAsyncOnAnimatorMoveHandler.OnAnimatorMoveAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncAnimatorMoveTrigger GetAsyncAnimatorMoveTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncAnimatorMoveTrigger GetAsyncAnimatorMoveTrigger(this Component component) { return component.gameObject.GetAsyncAnimatorMoveTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncAnimatorMoveTrigger : AsyncTriggerBase { TriggerEvent onAnimatorMoveTriggerEvent; void OnAnimatorMove() { onAnimatorMoveTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnAnimatorMoveHandler GetOnAnimatorMoveAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onAnimatorMoveTriggerEvent), false); } public IAsyncOnAnimatorMoveHandler GetOnAnimatorMoveAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onAnimatorMoveTriggerEvent), cancellationToken, false); } public UniTask OnAnimatorMoveAsync() { return ((IAsyncOnAnimatorMoveHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onAnimatorMoveTriggerEvent), true)).OnAnimatorMoveAsync(); } public UniTask OnAnimatorMoveAsync(CancellationToken cancellationToken) { return ((IAsyncOnAnimatorMoveHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onAnimatorMoveTriggerEvent), cancellationToken, true)).OnAnimatorMoveAsync(); } } #endregion #region ApplicationFocus public interface IAsyncOnApplicationFocusHandler { UniTask OnApplicationFocusAsync(); } public partial class AsyncTriggerHandler : IAsyncOnApplicationFocusHandler { UniTask IAsyncOnApplicationFocusHandler.OnApplicationFocusAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncApplicationFocusTrigger GetAsyncApplicationFocusTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncApplicationFocusTrigger GetAsyncApplicationFocusTrigger(this Component component) { return component.gameObject.GetAsyncApplicationFocusTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncApplicationFocusTrigger : AsyncTriggerBase { TriggerEvent onApplicationFocusTriggerEvent; void OnApplicationFocus(bool hasFocus) { onApplicationFocusTriggerEvent?.TrySetResult((hasFocus)); } public IAsyncOnApplicationFocusHandler GetOnApplicationFocusAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onApplicationFocusTriggerEvent), false); } public IAsyncOnApplicationFocusHandler GetOnApplicationFocusAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onApplicationFocusTriggerEvent), cancellationToken, false); } public UniTask OnApplicationFocusAsync() { return ((IAsyncOnApplicationFocusHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onApplicationFocusTriggerEvent), true)).OnApplicationFocusAsync(); } public UniTask OnApplicationFocusAsync(CancellationToken cancellationToken) { return ((IAsyncOnApplicationFocusHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onApplicationFocusTriggerEvent), cancellationToken, true)).OnApplicationFocusAsync(); } } #endregion #region ApplicationPause public interface IAsyncOnApplicationPauseHandler { UniTask OnApplicationPauseAsync(); } public partial class AsyncTriggerHandler : IAsyncOnApplicationPauseHandler { UniTask IAsyncOnApplicationPauseHandler.OnApplicationPauseAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncApplicationPauseTrigger GetAsyncApplicationPauseTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncApplicationPauseTrigger GetAsyncApplicationPauseTrigger(this Component component) { return component.gameObject.GetAsyncApplicationPauseTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncApplicationPauseTrigger : AsyncTriggerBase { TriggerEvent onApplicationPauseTriggerEvent; void OnApplicationPause(bool pauseStatus) { onApplicationPauseTriggerEvent?.TrySetResult((pauseStatus)); } public IAsyncOnApplicationPauseHandler GetOnApplicationPauseAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onApplicationPauseTriggerEvent), false); } public IAsyncOnApplicationPauseHandler GetOnApplicationPauseAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onApplicationPauseTriggerEvent), cancellationToken, false); } public UniTask OnApplicationPauseAsync() { return ((IAsyncOnApplicationPauseHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onApplicationPauseTriggerEvent), true)).OnApplicationPauseAsync(); } public UniTask OnApplicationPauseAsync(CancellationToken cancellationToken) { return ((IAsyncOnApplicationPauseHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onApplicationPauseTriggerEvent), cancellationToken, true)).OnApplicationPauseAsync(); } } #endregion #region ApplicationQuit public interface IAsyncOnApplicationQuitHandler { UniTask OnApplicationQuitAsync(); } public partial class AsyncTriggerHandler : IAsyncOnApplicationQuitHandler { UniTask IAsyncOnApplicationQuitHandler.OnApplicationQuitAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncApplicationQuitTrigger GetAsyncApplicationQuitTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncApplicationQuitTrigger GetAsyncApplicationQuitTrigger(this Component component) { return component.gameObject.GetAsyncApplicationQuitTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncApplicationQuitTrigger : AsyncTriggerBase { TriggerEvent onApplicationQuitTriggerEvent; void OnApplicationQuit() { onApplicationQuitTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnApplicationQuitHandler GetOnApplicationQuitAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onApplicationQuitTriggerEvent), false); } public IAsyncOnApplicationQuitHandler GetOnApplicationQuitAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onApplicationQuitTriggerEvent), cancellationToken, false); } public UniTask OnApplicationQuitAsync() { return ((IAsyncOnApplicationQuitHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onApplicationQuitTriggerEvent), true)).OnApplicationQuitAsync(); } public UniTask OnApplicationQuitAsync(CancellationToken cancellationToken) { return ((IAsyncOnApplicationQuitHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onApplicationQuitTriggerEvent), cancellationToken, true)).OnApplicationQuitAsync(); } } #endregion #region AudioFilterRead public interface IAsyncOnAudioFilterReadHandler { UniTask<(float[] data, int channels)> OnAudioFilterReadAsync(); } public partial class AsyncTriggerHandler : IAsyncOnAudioFilterReadHandler { UniTask<(float[] data, int channels)> IAsyncOnAudioFilterReadHandler.OnAudioFilterReadAsync() { core.Reset(); return new UniTask<(float[] data, int channels)>((IUniTaskSource<(float[] data, int channels)>)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncAudioFilterReadTrigger GetAsyncAudioFilterReadTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncAudioFilterReadTrigger GetAsyncAudioFilterReadTrigger(this Component component) { return component.gameObject.GetAsyncAudioFilterReadTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncAudioFilterReadTrigger : AsyncTriggerBase { TriggerEvent<(float[] data, int channels)> onAudioFilterReadTriggerEvent; void OnAudioFilterRead(float[] data, int channels) { onAudioFilterReadTriggerEvent?.TrySetResult((data, channels)); } public IAsyncOnAudioFilterReadHandler GetOnAudioFilterReadAsyncHandler() { return new AsyncTriggerHandler<(float[] data, int channels)>(SetTriggerEvent(ref onAudioFilterReadTriggerEvent), false); } public IAsyncOnAudioFilterReadHandler GetOnAudioFilterReadAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler<(float[] data, int channels)>(SetTriggerEvent(ref onAudioFilterReadTriggerEvent), cancellationToken, false); } public UniTask<(float[] data, int channels)> OnAudioFilterReadAsync() { return ((IAsyncOnAudioFilterReadHandler)new AsyncTriggerHandler<(float[] data, int channels)>(SetTriggerEvent(ref onAudioFilterReadTriggerEvent), true)).OnAudioFilterReadAsync(); } public UniTask<(float[] data, int channels)> OnAudioFilterReadAsync(CancellationToken cancellationToken) { return ((IAsyncOnAudioFilterReadHandler)new AsyncTriggerHandler<(float[] data, int channels)>(SetTriggerEvent(ref onAudioFilterReadTriggerEvent), cancellationToken, true)).OnAudioFilterReadAsync(); } } #endregion #region BecameInvisible public interface IAsyncOnBecameInvisibleHandler { UniTask OnBecameInvisibleAsync(); } public partial class AsyncTriggerHandler : IAsyncOnBecameInvisibleHandler { UniTask IAsyncOnBecameInvisibleHandler.OnBecameInvisibleAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncBecameInvisibleTrigger GetAsyncBecameInvisibleTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncBecameInvisibleTrigger GetAsyncBecameInvisibleTrigger(this Component component) { return component.gameObject.GetAsyncBecameInvisibleTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncBecameInvisibleTrigger : AsyncTriggerBase { TriggerEvent onBecameInvisibleTriggerEvent; void OnBecameInvisible() { onBecameInvisibleTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnBecameInvisibleHandler GetOnBecameInvisibleAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onBecameInvisibleTriggerEvent), false); } public IAsyncOnBecameInvisibleHandler GetOnBecameInvisibleAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onBecameInvisibleTriggerEvent), cancellationToken, false); } public UniTask OnBecameInvisibleAsync() { return ((IAsyncOnBecameInvisibleHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onBecameInvisibleTriggerEvent), true)).OnBecameInvisibleAsync(); } public UniTask OnBecameInvisibleAsync(CancellationToken cancellationToken) { return ((IAsyncOnBecameInvisibleHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onBecameInvisibleTriggerEvent), cancellationToken, true)).OnBecameInvisibleAsync(); } } #endregion #region BecameVisible public interface IAsyncOnBecameVisibleHandler { UniTask OnBecameVisibleAsync(); } public partial class AsyncTriggerHandler : IAsyncOnBecameVisibleHandler { UniTask IAsyncOnBecameVisibleHandler.OnBecameVisibleAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncBecameVisibleTrigger GetAsyncBecameVisibleTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncBecameVisibleTrigger GetAsyncBecameVisibleTrigger(this Component component) { return component.gameObject.GetAsyncBecameVisibleTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncBecameVisibleTrigger : AsyncTriggerBase { TriggerEvent onBecameVisibleTriggerEvent; void OnBecameVisible() { onBecameVisibleTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnBecameVisibleHandler GetOnBecameVisibleAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onBecameVisibleTriggerEvent), false); } public IAsyncOnBecameVisibleHandler GetOnBecameVisibleAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onBecameVisibleTriggerEvent), cancellationToken, false); } public UniTask OnBecameVisibleAsync() { return ((IAsyncOnBecameVisibleHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onBecameVisibleTriggerEvent), true)).OnBecameVisibleAsync(); } public UniTask OnBecameVisibleAsync(CancellationToken cancellationToken) { return ((IAsyncOnBecameVisibleHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onBecameVisibleTriggerEvent), cancellationToken, true)).OnBecameVisibleAsync(); } } #endregion #region BeforeTransformParentChanged public interface IAsyncOnBeforeTransformParentChangedHandler { UniTask OnBeforeTransformParentChangedAsync(); } public partial class AsyncTriggerHandler : IAsyncOnBeforeTransformParentChangedHandler { UniTask IAsyncOnBeforeTransformParentChangedHandler.OnBeforeTransformParentChangedAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncBeforeTransformParentChangedTrigger GetAsyncBeforeTransformParentChangedTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncBeforeTransformParentChangedTrigger GetAsyncBeforeTransformParentChangedTrigger(this Component component) { return component.gameObject.GetAsyncBeforeTransformParentChangedTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncBeforeTransformParentChangedTrigger : AsyncTriggerBase { TriggerEvent onBeforeTransformParentChangedTriggerEvent; void OnBeforeTransformParentChanged() { onBeforeTransformParentChangedTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnBeforeTransformParentChangedHandler GetOnBeforeTransformParentChangedAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onBeforeTransformParentChangedTriggerEvent), false); } public IAsyncOnBeforeTransformParentChangedHandler GetOnBeforeTransformParentChangedAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onBeforeTransformParentChangedTriggerEvent), cancellationToken, false); } public UniTask OnBeforeTransformParentChangedAsync() { return ((IAsyncOnBeforeTransformParentChangedHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onBeforeTransformParentChangedTriggerEvent), true)).OnBeforeTransformParentChangedAsync(); } public UniTask OnBeforeTransformParentChangedAsync(CancellationToken cancellationToken) { return ((IAsyncOnBeforeTransformParentChangedHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onBeforeTransformParentChangedTriggerEvent), cancellationToken, true)).OnBeforeTransformParentChangedAsync(); } } #endregion #region OnCanvasGroupChanged public interface IAsyncOnCanvasGroupChangedHandler { UniTask OnCanvasGroupChangedAsync(); } public partial class AsyncTriggerHandler : IAsyncOnCanvasGroupChangedHandler { UniTask IAsyncOnCanvasGroupChangedHandler.OnCanvasGroupChangedAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncOnCanvasGroupChangedTrigger GetAsyncOnCanvasGroupChangedTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncOnCanvasGroupChangedTrigger GetAsyncOnCanvasGroupChangedTrigger(this Component component) { return component.gameObject.GetAsyncOnCanvasGroupChangedTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncOnCanvasGroupChangedTrigger : AsyncTriggerBase { TriggerEvent onCanvasGroupChangedTriggerEvent; void OnCanvasGroupChanged() { onCanvasGroupChangedTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnCanvasGroupChangedHandler GetOnCanvasGroupChangedAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onCanvasGroupChangedTriggerEvent), false); } public IAsyncOnCanvasGroupChangedHandler GetOnCanvasGroupChangedAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onCanvasGroupChangedTriggerEvent), cancellationToken, false); } public UniTask OnCanvasGroupChangedAsync() { return ((IAsyncOnCanvasGroupChangedHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onCanvasGroupChangedTriggerEvent), true)).OnCanvasGroupChangedAsync(); } public UniTask OnCanvasGroupChangedAsync(CancellationToken cancellationToken) { return ((IAsyncOnCanvasGroupChangedHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onCanvasGroupChangedTriggerEvent), cancellationToken, true)).OnCanvasGroupChangedAsync(); } } #endregion #region CollisionEnter public interface IAsyncOnCollisionEnterHandler { UniTask OnCollisionEnterAsync(); } public partial class AsyncTriggerHandler : IAsyncOnCollisionEnterHandler { UniTask IAsyncOnCollisionEnterHandler.OnCollisionEnterAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncCollisionEnterTrigger GetAsyncCollisionEnterTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncCollisionEnterTrigger GetAsyncCollisionEnterTrigger(this Component component) { return component.gameObject.GetAsyncCollisionEnterTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncCollisionEnterTrigger : AsyncTriggerBase { TriggerEvent onCollisionEnterTriggerEvent; void OnCollisionEnter(Collision coll) { onCollisionEnterTriggerEvent?.TrySetResult((coll)); } public IAsyncOnCollisionEnterHandler GetOnCollisionEnterAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionEnterTriggerEvent), false); } public IAsyncOnCollisionEnterHandler GetOnCollisionEnterAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionEnterTriggerEvent), cancellationToken, false); } public UniTask OnCollisionEnterAsync() { return ((IAsyncOnCollisionEnterHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionEnterTriggerEvent), true)).OnCollisionEnterAsync(); } public UniTask OnCollisionEnterAsync(CancellationToken cancellationToken) { return ((IAsyncOnCollisionEnterHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionEnterTriggerEvent), cancellationToken, true)).OnCollisionEnterAsync(); } } #endregion #region CollisionEnter2D public interface IAsyncOnCollisionEnter2DHandler { UniTask OnCollisionEnter2DAsync(); } public partial class AsyncTriggerHandler : IAsyncOnCollisionEnter2DHandler { UniTask IAsyncOnCollisionEnter2DHandler.OnCollisionEnter2DAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncCollisionEnter2DTrigger GetAsyncCollisionEnter2DTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncCollisionEnter2DTrigger GetAsyncCollisionEnter2DTrigger(this Component component) { return component.gameObject.GetAsyncCollisionEnter2DTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncCollisionEnter2DTrigger : AsyncTriggerBase { TriggerEvent onCollisionEnter2DTriggerEvent; void OnCollisionEnter2D(Collision2D coll) { onCollisionEnter2DTriggerEvent?.TrySetResult((coll)); } public IAsyncOnCollisionEnter2DHandler GetOnCollisionEnter2DAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionEnter2DTriggerEvent), false); } public IAsyncOnCollisionEnter2DHandler GetOnCollisionEnter2DAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionEnter2DTriggerEvent), cancellationToken, false); } public UniTask OnCollisionEnter2DAsync() { return ((IAsyncOnCollisionEnter2DHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionEnter2DTriggerEvent), true)).OnCollisionEnter2DAsync(); } public UniTask OnCollisionEnter2DAsync(CancellationToken cancellationToken) { return ((IAsyncOnCollisionEnter2DHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionEnter2DTriggerEvent), cancellationToken, true)).OnCollisionEnter2DAsync(); } } #endregion #region CollisionExit public interface IAsyncOnCollisionExitHandler { UniTask OnCollisionExitAsync(); } public partial class AsyncTriggerHandler : IAsyncOnCollisionExitHandler { UniTask IAsyncOnCollisionExitHandler.OnCollisionExitAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncCollisionExitTrigger GetAsyncCollisionExitTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncCollisionExitTrigger GetAsyncCollisionExitTrigger(this Component component) { return component.gameObject.GetAsyncCollisionExitTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncCollisionExitTrigger : AsyncTriggerBase { TriggerEvent onCollisionExitTriggerEvent; void OnCollisionExit(Collision coll) { onCollisionExitTriggerEvent?.TrySetResult((coll)); } public IAsyncOnCollisionExitHandler GetOnCollisionExitAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionExitTriggerEvent), false); } public IAsyncOnCollisionExitHandler GetOnCollisionExitAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionExitTriggerEvent), cancellationToken, false); } public UniTask OnCollisionExitAsync() { return ((IAsyncOnCollisionExitHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionExitTriggerEvent), true)).OnCollisionExitAsync(); } public UniTask OnCollisionExitAsync(CancellationToken cancellationToken) { return ((IAsyncOnCollisionExitHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionExitTriggerEvent), cancellationToken, true)).OnCollisionExitAsync(); } } #endregion #region CollisionExit2D public interface IAsyncOnCollisionExit2DHandler { UniTask OnCollisionExit2DAsync(); } public partial class AsyncTriggerHandler : IAsyncOnCollisionExit2DHandler { UniTask IAsyncOnCollisionExit2DHandler.OnCollisionExit2DAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncCollisionExit2DTrigger GetAsyncCollisionExit2DTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncCollisionExit2DTrigger GetAsyncCollisionExit2DTrigger(this Component component) { return component.gameObject.GetAsyncCollisionExit2DTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncCollisionExit2DTrigger : AsyncTriggerBase { TriggerEvent onCollisionExit2DTriggerEvent; void OnCollisionExit2D(Collision2D coll) { onCollisionExit2DTriggerEvent?.TrySetResult((coll)); } public IAsyncOnCollisionExit2DHandler GetOnCollisionExit2DAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionExit2DTriggerEvent), false); } public IAsyncOnCollisionExit2DHandler GetOnCollisionExit2DAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionExit2DTriggerEvent), cancellationToken, false); } public UniTask OnCollisionExit2DAsync() { return ((IAsyncOnCollisionExit2DHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionExit2DTriggerEvent), true)).OnCollisionExit2DAsync(); } public UniTask OnCollisionExit2DAsync(CancellationToken cancellationToken) { return ((IAsyncOnCollisionExit2DHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionExit2DTriggerEvent), cancellationToken, true)).OnCollisionExit2DAsync(); } } #endregion #region CollisionStay public interface IAsyncOnCollisionStayHandler { UniTask OnCollisionStayAsync(); } public partial class AsyncTriggerHandler : IAsyncOnCollisionStayHandler { UniTask IAsyncOnCollisionStayHandler.OnCollisionStayAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncCollisionStayTrigger GetAsyncCollisionStayTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncCollisionStayTrigger GetAsyncCollisionStayTrigger(this Component component) { return component.gameObject.GetAsyncCollisionStayTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncCollisionStayTrigger : AsyncTriggerBase { TriggerEvent onCollisionStayTriggerEvent; void OnCollisionStay(Collision coll) { onCollisionStayTriggerEvent?.TrySetResult((coll)); } public IAsyncOnCollisionStayHandler GetOnCollisionStayAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionStayTriggerEvent), false); } public IAsyncOnCollisionStayHandler GetOnCollisionStayAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionStayTriggerEvent), cancellationToken, false); } public UniTask OnCollisionStayAsync() { return ((IAsyncOnCollisionStayHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionStayTriggerEvent), true)).OnCollisionStayAsync(); } public UniTask OnCollisionStayAsync(CancellationToken cancellationToken) { return ((IAsyncOnCollisionStayHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionStayTriggerEvent), cancellationToken, true)).OnCollisionStayAsync(); } } #endregion #region CollisionStay2D public interface IAsyncOnCollisionStay2DHandler { UniTask OnCollisionStay2DAsync(); } public partial class AsyncTriggerHandler : IAsyncOnCollisionStay2DHandler { UniTask IAsyncOnCollisionStay2DHandler.OnCollisionStay2DAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncCollisionStay2DTrigger GetAsyncCollisionStay2DTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncCollisionStay2DTrigger GetAsyncCollisionStay2DTrigger(this Component component) { return component.gameObject.GetAsyncCollisionStay2DTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncCollisionStay2DTrigger : AsyncTriggerBase { TriggerEvent onCollisionStay2DTriggerEvent; void OnCollisionStay2D(Collision2D coll) { onCollisionStay2DTriggerEvent?.TrySetResult((coll)); } public IAsyncOnCollisionStay2DHandler GetOnCollisionStay2DAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionStay2DTriggerEvent), false); } public IAsyncOnCollisionStay2DHandler GetOnCollisionStay2DAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionStay2DTriggerEvent), cancellationToken, false); } public UniTask OnCollisionStay2DAsync() { return ((IAsyncOnCollisionStay2DHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionStay2DTriggerEvent), true)).OnCollisionStay2DAsync(); } public UniTask OnCollisionStay2DAsync(CancellationToken cancellationToken) { return ((IAsyncOnCollisionStay2DHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onCollisionStay2DTriggerEvent), cancellationToken, true)).OnCollisionStay2DAsync(); } } #endregion #region ControllerColliderHit public interface IAsyncOnControllerColliderHitHandler { UniTask OnControllerColliderHitAsync(); } public partial class AsyncTriggerHandler : IAsyncOnControllerColliderHitHandler { UniTask IAsyncOnControllerColliderHitHandler.OnControllerColliderHitAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncControllerColliderHitTrigger GetAsyncControllerColliderHitTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncControllerColliderHitTrigger GetAsyncControllerColliderHitTrigger(this Component component) { return component.gameObject.GetAsyncControllerColliderHitTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncControllerColliderHitTrigger : AsyncTriggerBase { TriggerEvent onControllerColliderHitTriggerEvent; void OnControllerColliderHit(ControllerColliderHit hit) { onControllerColliderHitTriggerEvent?.TrySetResult((hit)); } public IAsyncOnControllerColliderHitHandler GetOnControllerColliderHitAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onControllerColliderHitTriggerEvent), false); } public IAsyncOnControllerColliderHitHandler GetOnControllerColliderHitAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onControllerColliderHitTriggerEvent), cancellationToken, false); } public UniTask OnControllerColliderHitAsync() { return ((IAsyncOnControllerColliderHitHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onControllerColliderHitTriggerEvent), true)).OnControllerColliderHitAsync(); } public UniTask OnControllerColliderHitAsync(CancellationToken cancellationToken) { return ((IAsyncOnControllerColliderHitHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onControllerColliderHitTriggerEvent), cancellationToken, true)).OnControllerColliderHitAsync(); } } #endregion #region Disable public interface IAsyncOnDisableHandler { UniTask OnDisableAsync(); } public partial class AsyncTriggerHandler : IAsyncOnDisableHandler { UniTask IAsyncOnDisableHandler.OnDisableAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncDisableTrigger GetAsyncDisableTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncDisableTrigger GetAsyncDisableTrigger(this Component component) { return component.gameObject.GetAsyncDisableTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncDisableTrigger : AsyncTriggerBase { TriggerEvent onDisableTriggerEvent; void OnDisable() { onDisableTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnDisableHandler GetOnDisableAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onDisableTriggerEvent), false); } public IAsyncOnDisableHandler GetOnDisableAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onDisableTriggerEvent), cancellationToken, false); } public UniTask OnDisableAsync() { return ((IAsyncOnDisableHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onDisableTriggerEvent), true)).OnDisableAsync(); } public UniTask OnDisableAsync(CancellationToken cancellationToken) { return ((IAsyncOnDisableHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onDisableTriggerEvent), cancellationToken, true)).OnDisableAsync(); } } #endregion #region DrawGizmos public interface IAsyncOnDrawGizmosHandler { UniTask OnDrawGizmosAsync(); } public partial class AsyncTriggerHandler : IAsyncOnDrawGizmosHandler { UniTask IAsyncOnDrawGizmosHandler.OnDrawGizmosAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncDrawGizmosTrigger GetAsyncDrawGizmosTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncDrawGizmosTrigger GetAsyncDrawGizmosTrigger(this Component component) { return component.gameObject.GetAsyncDrawGizmosTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncDrawGizmosTrigger : AsyncTriggerBase { TriggerEvent onDrawGizmosTriggerEvent; void OnDrawGizmos() { onDrawGizmosTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnDrawGizmosHandler GetOnDrawGizmosAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onDrawGizmosTriggerEvent), false); } public IAsyncOnDrawGizmosHandler GetOnDrawGizmosAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onDrawGizmosTriggerEvent), cancellationToken, false); } public UniTask OnDrawGizmosAsync() { return ((IAsyncOnDrawGizmosHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onDrawGizmosTriggerEvent), true)).OnDrawGizmosAsync(); } public UniTask OnDrawGizmosAsync(CancellationToken cancellationToken) { return ((IAsyncOnDrawGizmosHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onDrawGizmosTriggerEvent), cancellationToken, true)).OnDrawGizmosAsync(); } } #endregion #region DrawGizmosSelected public interface IAsyncOnDrawGizmosSelectedHandler { UniTask OnDrawGizmosSelectedAsync(); } public partial class AsyncTriggerHandler : IAsyncOnDrawGizmosSelectedHandler { UniTask IAsyncOnDrawGizmosSelectedHandler.OnDrawGizmosSelectedAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncDrawGizmosSelectedTrigger GetAsyncDrawGizmosSelectedTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncDrawGizmosSelectedTrigger GetAsyncDrawGizmosSelectedTrigger(this Component component) { return component.gameObject.GetAsyncDrawGizmosSelectedTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncDrawGizmosSelectedTrigger : AsyncTriggerBase { TriggerEvent onDrawGizmosSelectedTriggerEvent; void OnDrawGizmosSelected() { onDrawGizmosSelectedTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnDrawGizmosSelectedHandler GetOnDrawGizmosSelectedAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onDrawGizmosSelectedTriggerEvent), false); } public IAsyncOnDrawGizmosSelectedHandler GetOnDrawGizmosSelectedAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onDrawGizmosSelectedTriggerEvent), cancellationToken, false); } public UniTask OnDrawGizmosSelectedAsync() { return ((IAsyncOnDrawGizmosSelectedHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onDrawGizmosSelectedTriggerEvent), true)).OnDrawGizmosSelectedAsync(); } public UniTask OnDrawGizmosSelectedAsync(CancellationToken cancellationToken) { return ((IAsyncOnDrawGizmosSelectedHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onDrawGizmosSelectedTriggerEvent), cancellationToken, true)).OnDrawGizmosSelectedAsync(); } } #endregion #region Enable public interface IAsyncOnEnableHandler { UniTask OnEnableAsync(); } public partial class AsyncTriggerHandler : IAsyncOnEnableHandler { UniTask IAsyncOnEnableHandler.OnEnableAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncEnableTrigger GetAsyncEnableTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncEnableTrigger GetAsyncEnableTrigger(this Component component) { return component.gameObject.GetAsyncEnableTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncEnableTrigger : AsyncTriggerBase { TriggerEvent onEnableTriggerEvent; void OnEnable() { onEnableTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnEnableHandler GetOnEnableAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onEnableTriggerEvent), false); } public IAsyncOnEnableHandler GetOnEnableAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onEnableTriggerEvent), cancellationToken, false); } public UniTask OnEnableAsync() { return ((IAsyncOnEnableHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onEnableTriggerEvent), true)).OnEnableAsync(); } public UniTask OnEnableAsync(CancellationToken cancellationToken) { return ((IAsyncOnEnableHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onEnableTriggerEvent), cancellationToken, true)).OnEnableAsync(); } } #endregion #region GUI public interface IAsyncOnGUIHandler { UniTask OnGUIAsync(); } public partial class AsyncTriggerHandler : IAsyncOnGUIHandler { UniTask IAsyncOnGUIHandler.OnGUIAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncGUITrigger GetAsyncGUITrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncGUITrigger GetAsyncGUITrigger(this Component component) { return component.gameObject.GetAsyncGUITrigger(); } } [DisallowMultipleComponent] public sealed class AsyncGUITrigger : AsyncTriggerBase { TriggerEvent onGUITriggerEvent; void OnGUI() { onGUITriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnGUIHandler GetOnGUIAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onGUITriggerEvent), false); } public IAsyncOnGUIHandler GetOnGUIAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onGUITriggerEvent), cancellationToken, false); } public UniTask OnGUIAsync() { return ((IAsyncOnGUIHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onGUITriggerEvent), true)).OnGUIAsync(); } public UniTask OnGUIAsync(CancellationToken cancellationToken) { return ((IAsyncOnGUIHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onGUITriggerEvent), cancellationToken, true)).OnGUIAsync(); } } #endregion #region JointBreak public interface IAsyncOnJointBreakHandler { UniTask OnJointBreakAsync(); } public partial class AsyncTriggerHandler : IAsyncOnJointBreakHandler { UniTask IAsyncOnJointBreakHandler.OnJointBreakAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncJointBreakTrigger GetAsyncJointBreakTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncJointBreakTrigger GetAsyncJointBreakTrigger(this Component component) { return component.gameObject.GetAsyncJointBreakTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncJointBreakTrigger : AsyncTriggerBase { TriggerEvent onJointBreakTriggerEvent; void OnJointBreak(float breakForce) { onJointBreakTriggerEvent?.TrySetResult((breakForce)); } public IAsyncOnJointBreakHandler GetOnJointBreakAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onJointBreakTriggerEvent), false); } public IAsyncOnJointBreakHandler GetOnJointBreakAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onJointBreakTriggerEvent), cancellationToken, false); } public UniTask OnJointBreakAsync() { return ((IAsyncOnJointBreakHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onJointBreakTriggerEvent), true)).OnJointBreakAsync(); } public UniTask OnJointBreakAsync(CancellationToken cancellationToken) { return ((IAsyncOnJointBreakHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onJointBreakTriggerEvent), cancellationToken, true)).OnJointBreakAsync(); } } #endregion #region JointBreak2D public interface IAsyncOnJointBreak2DHandler { UniTask OnJointBreak2DAsync(); } public partial class AsyncTriggerHandler : IAsyncOnJointBreak2DHandler { UniTask IAsyncOnJointBreak2DHandler.OnJointBreak2DAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncJointBreak2DTrigger GetAsyncJointBreak2DTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncJointBreak2DTrigger GetAsyncJointBreak2DTrigger(this Component component) { return component.gameObject.GetAsyncJointBreak2DTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncJointBreak2DTrigger : AsyncTriggerBase { TriggerEvent onJointBreak2DTriggerEvent; void OnJointBreak2D(Joint2D brokenJoint) { onJointBreak2DTriggerEvent?.TrySetResult((brokenJoint)); } public IAsyncOnJointBreak2DHandler GetOnJointBreak2DAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onJointBreak2DTriggerEvent), false); } public IAsyncOnJointBreak2DHandler GetOnJointBreak2DAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onJointBreak2DTriggerEvent), cancellationToken, false); } public UniTask OnJointBreak2DAsync() { return ((IAsyncOnJointBreak2DHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onJointBreak2DTriggerEvent), true)).OnJointBreak2DAsync(); } public UniTask OnJointBreak2DAsync(CancellationToken cancellationToken) { return ((IAsyncOnJointBreak2DHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onJointBreak2DTriggerEvent), cancellationToken, true)).OnJointBreak2DAsync(); } } #endregion #region MouseDown public interface IAsyncOnMouseDownHandler { UniTask OnMouseDownAsync(); } public partial class AsyncTriggerHandler : IAsyncOnMouseDownHandler { UniTask IAsyncOnMouseDownHandler.OnMouseDownAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncMouseDownTrigger GetAsyncMouseDownTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncMouseDownTrigger GetAsyncMouseDownTrigger(this Component component) { return component.gameObject.GetAsyncMouseDownTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncMouseDownTrigger : AsyncTriggerBase { TriggerEvent onMouseDownTriggerEvent; void OnMouseDown() { onMouseDownTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnMouseDownHandler GetOnMouseDownAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onMouseDownTriggerEvent), false); } public IAsyncOnMouseDownHandler GetOnMouseDownAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onMouseDownTriggerEvent), cancellationToken, false); } public UniTask OnMouseDownAsync() { return ((IAsyncOnMouseDownHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onMouseDownTriggerEvent), true)).OnMouseDownAsync(); } public UniTask OnMouseDownAsync(CancellationToken cancellationToken) { return ((IAsyncOnMouseDownHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onMouseDownTriggerEvent), cancellationToken, true)).OnMouseDownAsync(); } } #endregion #region MouseDrag public interface IAsyncOnMouseDragHandler { UniTask OnMouseDragAsync(); } public partial class AsyncTriggerHandler : IAsyncOnMouseDragHandler { UniTask IAsyncOnMouseDragHandler.OnMouseDragAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncMouseDragTrigger GetAsyncMouseDragTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncMouseDragTrigger GetAsyncMouseDragTrigger(this Component component) { return component.gameObject.GetAsyncMouseDragTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncMouseDragTrigger : AsyncTriggerBase { TriggerEvent onMouseDragTriggerEvent; void OnMouseDrag() { onMouseDragTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnMouseDragHandler GetOnMouseDragAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onMouseDragTriggerEvent), false); } public IAsyncOnMouseDragHandler GetOnMouseDragAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onMouseDragTriggerEvent), cancellationToken, false); } public UniTask OnMouseDragAsync() { return ((IAsyncOnMouseDragHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onMouseDragTriggerEvent), true)).OnMouseDragAsync(); } public UniTask OnMouseDragAsync(CancellationToken cancellationToken) { return ((IAsyncOnMouseDragHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onMouseDragTriggerEvent), cancellationToken, true)).OnMouseDragAsync(); } } #endregion #region MouseEnter public interface IAsyncOnMouseEnterHandler { UniTask OnMouseEnterAsync(); } public partial class AsyncTriggerHandler : IAsyncOnMouseEnterHandler { UniTask IAsyncOnMouseEnterHandler.OnMouseEnterAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncMouseEnterTrigger GetAsyncMouseEnterTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncMouseEnterTrigger GetAsyncMouseEnterTrigger(this Component component) { return component.gameObject.GetAsyncMouseEnterTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncMouseEnterTrigger : AsyncTriggerBase { TriggerEvent onMouseEnterTriggerEvent; void OnMouseEnter() { onMouseEnterTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnMouseEnterHandler GetOnMouseEnterAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onMouseEnterTriggerEvent), false); } public IAsyncOnMouseEnterHandler GetOnMouseEnterAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onMouseEnterTriggerEvent), cancellationToken, false); } public UniTask OnMouseEnterAsync() { return ((IAsyncOnMouseEnterHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onMouseEnterTriggerEvent), true)).OnMouseEnterAsync(); } public UniTask OnMouseEnterAsync(CancellationToken cancellationToken) { return ((IAsyncOnMouseEnterHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onMouseEnterTriggerEvent), cancellationToken, true)).OnMouseEnterAsync(); } } #endregion #region MouseExit public interface IAsyncOnMouseExitHandler { UniTask OnMouseExitAsync(); } public partial class AsyncTriggerHandler : IAsyncOnMouseExitHandler { UniTask IAsyncOnMouseExitHandler.OnMouseExitAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncMouseExitTrigger GetAsyncMouseExitTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncMouseExitTrigger GetAsyncMouseExitTrigger(this Component component) { return component.gameObject.GetAsyncMouseExitTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncMouseExitTrigger : AsyncTriggerBase { TriggerEvent onMouseExitTriggerEvent; void OnMouseExit() { onMouseExitTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnMouseExitHandler GetOnMouseExitAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onMouseExitTriggerEvent), false); } public IAsyncOnMouseExitHandler GetOnMouseExitAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onMouseExitTriggerEvent), cancellationToken, false); } public UniTask OnMouseExitAsync() { return ((IAsyncOnMouseExitHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onMouseExitTriggerEvent), true)).OnMouseExitAsync(); } public UniTask OnMouseExitAsync(CancellationToken cancellationToken) { return ((IAsyncOnMouseExitHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onMouseExitTriggerEvent), cancellationToken, true)).OnMouseExitAsync(); } } #endregion #region MouseOver public interface IAsyncOnMouseOverHandler { UniTask OnMouseOverAsync(); } public partial class AsyncTriggerHandler : IAsyncOnMouseOverHandler { UniTask IAsyncOnMouseOverHandler.OnMouseOverAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncMouseOverTrigger GetAsyncMouseOverTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncMouseOverTrigger GetAsyncMouseOverTrigger(this Component component) { return component.gameObject.GetAsyncMouseOverTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncMouseOverTrigger : AsyncTriggerBase { TriggerEvent onMouseOverTriggerEvent; void OnMouseOver() { onMouseOverTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnMouseOverHandler GetOnMouseOverAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onMouseOverTriggerEvent), false); } public IAsyncOnMouseOverHandler GetOnMouseOverAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onMouseOverTriggerEvent), cancellationToken, false); } public UniTask OnMouseOverAsync() { return ((IAsyncOnMouseOverHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onMouseOverTriggerEvent), true)).OnMouseOverAsync(); } public UniTask OnMouseOverAsync(CancellationToken cancellationToken) { return ((IAsyncOnMouseOverHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onMouseOverTriggerEvent), cancellationToken, true)).OnMouseOverAsync(); } } #endregion #region MouseUp public interface IAsyncOnMouseUpHandler { UniTask OnMouseUpAsync(); } public partial class AsyncTriggerHandler : IAsyncOnMouseUpHandler { UniTask IAsyncOnMouseUpHandler.OnMouseUpAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncMouseUpTrigger GetAsyncMouseUpTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncMouseUpTrigger GetAsyncMouseUpTrigger(this Component component) { return component.gameObject.GetAsyncMouseUpTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncMouseUpTrigger : AsyncTriggerBase { TriggerEvent onMouseUpTriggerEvent; void OnMouseUp() { onMouseUpTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnMouseUpHandler GetOnMouseUpAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onMouseUpTriggerEvent), false); } public IAsyncOnMouseUpHandler GetOnMouseUpAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onMouseUpTriggerEvent), cancellationToken, false); } public UniTask OnMouseUpAsync() { return ((IAsyncOnMouseUpHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onMouseUpTriggerEvent), true)).OnMouseUpAsync(); } public UniTask OnMouseUpAsync(CancellationToken cancellationToken) { return ((IAsyncOnMouseUpHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onMouseUpTriggerEvent), cancellationToken, true)).OnMouseUpAsync(); } } #endregion #region MouseUpAsButton public interface IAsyncOnMouseUpAsButtonHandler { UniTask OnMouseUpAsButtonAsync(); } public partial class AsyncTriggerHandler : IAsyncOnMouseUpAsButtonHandler { UniTask IAsyncOnMouseUpAsButtonHandler.OnMouseUpAsButtonAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncMouseUpAsButtonTrigger GetAsyncMouseUpAsButtonTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncMouseUpAsButtonTrigger GetAsyncMouseUpAsButtonTrigger(this Component component) { return component.gameObject.GetAsyncMouseUpAsButtonTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncMouseUpAsButtonTrigger : AsyncTriggerBase { TriggerEvent onMouseUpAsButtonTriggerEvent; void OnMouseUpAsButton() { onMouseUpAsButtonTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnMouseUpAsButtonHandler GetOnMouseUpAsButtonAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onMouseUpAsButtonTriggerEvent), false); } public IAsyncOnMouseUpAsButtonHandler GetOnMouseUpAsButtonAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onMouseUpAsButtonTriggerEvent), cancellationToken, false); } public UniTask OnMouseUpAsButtonAsync() { return ((IAsyncOnMouseUpAsButtonHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onMouseUpAsButtonTriggerEvent), true)).OnMouseUpAsButtonAsync(); } public UniTask OnMouseUpAsButtonAsync(CancellationToken cancellationToken) { return ((IAsyncOnMouseUpAsButtonHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onMouseUpAsButtonTriggerEvent), cancellationToken, true)).OnMouseUpAsButtonAsync(); } } #endregion #region ParticleCollision public interface IAsyncOnParticleCollisionHandler { UniTask OnParticleCollisionAsync(); } public partial class AsyncTriggerHandler : IAsyncOnParticleCollisionHandler { UniTask IAsyncOnParticleCollisionHandler.OnParticleCollisionAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncParticleCollisionTrigger GetAsyncParticleCollisionTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncParticleCollisionTrigger GetAsyncParticleCollisionTrigger(this Component component) { return component.gameObject.GetAsyncParticleCollisionTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncParticleCollisionTrigger : AsyncTriggerBase { TriggerEvent onParticleCollisionTriggerEvent; void OnParticleCollision(GameObject other) { onParticleCollisionTriggerEvent?.TrySetResult((other)); } public IAsyncOnParticleCollisionHandler GetOnParticleCollisionAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onParticleCollisionTriggerEvent), false); } public IAsyncOnParticleCollisionHandler GetOnParticleCollisionAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onParticleCollisionTriggerEvent), cancellationToken, false); } public UniTask OnParticleCollisionAsync() { return ((IAsyncOnParticleCollisionHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onParticleCollisionTriggerEvent), true)).OnParticleCollisionAsync(); } public UniTask OnParticleCollisionAsync(CancellationToken cancellationToken) { return ((IAsyncOnParticleCollisionHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onParticleCollisionTriggerEvent), cancellationToken, true)).OnParticleCollisionAsync(); } } #endregion #region ParticleSystemStopped public interface IAsyncOnParticleSystemStoppedHandler { UniTask OnParticleSystemStoppedAsync(); } public partial class AsyncTriggerHandler : IAsyncOnParticleSystemStoppedHandler { UniTask IAsyncOnParticleSystemStoppedHandler.OnParticleSystemStoppedAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncParticleSystemStoppedTrigger GetAsyncParticleSystemStoppedTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncParticleSystemStoppedTrigger GetAsyncParticleSystemStoppedTrigger(this Component component) { return component.gameObject.GetAsyncParticleSystemStoppedTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncParticleSystemStoppedTrigger : AsyncTriggerBase { TriggerEvent onParticleSystemStoppedTriggerEvent; void OnParticleSystemStopped() { onParticleSystemStoppedTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnParticleSystemStoppedHandler GetOnParticleSystemStoppedAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onParticleSystemStoppedTriggerEvent), false); } public IAsyncOnParticleSystemStoppedHandler GetOnParticleSystemStoppedAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onParticleSystemStoppedTriggerEvent), cancellationToken, false); } public UniTask OnParticleSystemStoppedAsync() { return ((IAsyncOnParticleSystemStoppedHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onParticleSystemStoppedTriggerEvent), true)).OnParticleSystemStoppedAsync(); } public UniTask OnParticleSystemStoppedAsync(CancellationToken cancellationToken) { return ((IAsyncOnParticleSystemStoppedHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onParticleSystemStoppedTriggerEvent), cancellationToken, true)).OnParticleSystemStoppedAsync(); } } #endregion #region ParticleTrigger public interface IAsyncOnParticleTriggerHandler { UniTask OnParticleTriggerAsync(); } public partial class AsyncTriggerHandler : IAsyncOnParticleTriggerHandler { UniTask IAsyncOnParticleTriggerHandler.OnParticleTriggerAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncParticleTriggerTrigger GetAsyncParticleTriggerTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncParticleTriggerTrigger GetAsyncParticleTriggerTrigger(this Component component) { return component.gameObject.GetAsyncParticleTriggerTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncParticleTriggerTrigger : AsyncTriggerBase { TriggerEvent onParticleTriggerTriggerEvent; void OnParticleTrigger() { onParticleTriggerTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnParticleTriggerHandler GetOnParticleTriggerAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onParticleTriggerTriggerEvent), false); } public IAsyncOnParticleTriggerHandler GetOnParticleTriggerAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onParticleTriggerTriggerEvent), cancellationToken, false); } public UniTask OnParticleTriggerAsync() { return ((IAsyncOnParticleTriggerHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onParticleTriggerTriggerEvent), true)).OnParticleTriggerAsync(); } public UniTask OnParticleTriggerAsync(CancellationToken cancellationToken) { return ((IAsyncOnParticleTriggerHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onParticleTriggerTriggerEvent), cancellationToken, true)).OnParticleTriggerAsync(); } } #endregion #region ParticleUpdateJobScheduled #if UNITY_2019_3_OR_NEWER public interface IAsyncOnParticleUpdateJobScheduledHandler { UniTask OnParticleUpdateJobScheduledAsync(); } public partial class AsyncTriggerHandler : IAsyncOnParticleUpdateJobScheduledHandler { UniTask IAsyncOnParticleUpdateJobScheduledHandler.OnParticleUpdateJobScheduledAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncParticleUpdateJobScheduledTrigger GetAsyncParticleUpdateJobScheduledTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncParticleUpdateJobScheduledTrigger GetAsyncParticleUpdateJobScheduledTrigger(this Component component) { return component.gameObject.GetAsyncParticleUpdateJobScheduledTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncParticleUpdateJobScheduledTrigger : AsyncTriggerBase { TriggerEvent onParticleUpdateJobScheduledTriggerEvent; void OnParticleUpdateJobScheduled(UnityEngine.ParticleSystemJobs.ParticleSystemJobData particles) { onParticleUpdateJobScheduledTriggerEvent?.TrySetResult((particles)); } public IAsyncOnParticleUpdateJobScheduledHandler GetOnParticleUpdateJobScheduledAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onParticleUpdateJobScheduledTriggerEvent), false); } public IAsyncOnParticleUpdateJobScheduledHandler GetOnParticleUpdateJobScheduledAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onParticleUpdateJobScheduledTriggerEvent), cancellationToken, false); } public UniTask OnParticleUpdateJobScheduledAsync() { return ((IAsyncOnParticleUpdateJobScheduledHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onParticleUpdateJobScheduledTriggerEvent), true)).OnParticleUpdateJobScheduledAsync(); } public UniTask OnParticleUpdateJobScheduledAsync(CancellationToken cancellationToken) { return ((IAsyncOnParticleUpdateJobScheduledHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onParticleUpdateJobScheduledTriggerEvent), cancellationToken, true)).OnParticleUpdateJobScheduledAsync(); } } #endif #endregion #region PostRender public interface IAsyncOnPostRenderHandler { UniTask OnPostRenderAsync(); } public partial class AsyncTriggerHandler : IAsyncOnPostRenderHandler { UniTask IAsyncOnPostRenderHandler.OnPostRenderAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncPostRenderTrigger GetAsyncPostRenderTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncPostRenderTrigger GetAsyncPostRenderTrigger(this Component component) { return component.gameObject.GetAsyncPostRenderTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncPostRenderTrigger : AsyncTriggerBase { TriggerEvent onPostRenderTriggerEvent; void OnPostRender() { onPostRenderTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnPostRenderHandler GetOnPostRenderAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onPostRenderTriggerEvent), false); } public IAsyncOnPostRenderHandler GetOnPostRenderAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onPostRenderTriggerEvent), cancellationToken, false); } public UniTask OnPostRenderAsync() { return ((IAsyncOnPostRenderHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onPostRenderTriggerEvent), true)).OnPostRenderAsync(); } public UniTask OnPostRenderAsync(CancellationToken cancellationToken) { return ((IAsyncOnPostRenderHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onPostRenderTriggerEvent), cancellationToken, true)).OnPostRenderAsync(); } } #endregion #region PreCull public interface IAsyncOnPreCullHandler { UniTask OnPreCullAsync(); } public partial class AsyncTriggerHandler : IAsyncOnPreCullHandler { UniTask IAsyncOnPreCullHandler.OnPreCullAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncPreCullTrigger GetAsyncPreCullTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncPreCullTrigger GetAsyncPreCullTrigger(this Component component) { return component.gameObject.GetAsyncPreCullTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncPreCullTrigger : AsyncTriggerBase { TriggerEvent onPreCullTriggerEvent; void OnPreCull() { onPreCullTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnPreCullHandler GetOnPreCullAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onPreCullTriggerEvent), false); } public IAsyncOnPreCullHandler GetOnPreCullAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onPreCullTriggerEvent), cancellationToken, false); } public UniTask OnPreCullAsync() { return ((IAsyncOnPreCullHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onPreCullTriggerEvent), true)).OnPreCullAsync(); } public UniTask OnPreCullAsync(CancellationToken cancellationToken) { return ((IAsyncOnPreCullHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onPreCullTriggerEvent), cancellationToken, true)).OnPreCullAsync(); } } #endregion #region PreRender public interface IAsyncOnPreRenderHandler { UniTask OnPreRenderAsync(); } public partial class AsyncTriggerHandler : IAsyncOnPreRenderHandler { UniTask IAsyncOnPreRenderHandler.OnPreRenderAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncPreRenderTrigger GetAsyncPreRenderTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncPreRenderTrigger GetAsyncPreRenderTrigger(this Component component) { return component.gameObject.GetAsyncPreRenderTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncPreRenderTrigger : AsyncTriggerBase { TriggerEvent onPreRenderTriggerEvent; void OnPreRender() { onPreRenderTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnPreRenderHandler GetOnPreRenderAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onPreRenderTriggerEvent), false); } public IAsyncOnPreRenderHandler GetOnPreRenderAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onPreRenderTriggerEvent), cancellationToken, false); } public UniTask OnPreRenderAsync() { return ((IAsyncOnPreRenderHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onPreRenderTriggerEvent), true)).OnPreRenderAsync(); } public UniTask OnPreRenderAsync(CancellationToken cancellationToken) { return ((IAsyncOnPreRenderHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onPreRenderTriggerEvent), cancellationToken, true)).OnPreRenderAsync(); } } #endregion #region RectTransformDimensionsChange public interface IAsyncOnRectTransformDimensionsChangeHandler { UniTask OnRectTransformDimensionsChangeAsync(); } public partial class AsyncTriggerHandler : IAsyncOnRectTransformDimensionsChangeHandler { UniTask IAsyncOnRectTransformDimensionsChangeHandler.OnRectTransformDimensionsChangeAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncRectTransformDimensionsChangeTrigger GetAsyncRectTransformDimensionsChangeTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncRectTransformDimensionsChangeTrigger GetAsyncRectTransformDimensionsChangeTrigger(this Component component) { return component.gameObject.GetAsyncRectTransformDimensionsChangeTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncRectTransformDimensionsChangeTrigger : AsyncTriggerBase { TriggerEvent onRectTransformDimensionsChangeTriggerEvent; void OnRectTransformDimensionsChange() { onRectTransformDimensionsChangeTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnRectTransformDimensionsChangeHandler GetOnRectTransformDimensionsChangeAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onRectTransformDimensionsChangeTriggerEvent), false); } public IAsyncOnRectTransformDimensionsChangeHandler GetOnRectTransformDimensionsChangeAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onRectTransformDimensionsChangeTriggerEvent), cancellationToken, false); } public UniTask OnRectTransformDimensionsChangeAsync() { return ((IAsyncOnRectTransformDimensionsChangeHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onRectTransformDimensionsChangeTriggerEvent), true)).OnRectTransformDimensionsChangeAsync(); } public UniTask OnRectTransformDimensionsChangeAsync(CancellationToken cancellationToken) { return ((IAsyncOnRectTransformDimensionsChangeHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onRectTransformDimensionsChangeTriggerEvent), cancellationToken, true)).OnRectTransformDimensionsChangeAsync(); } } #endregion #region RectTransformRemoved public interface IAsyncOnRectTransformRemovedHandler { UniTask OnRectTransformRemovedAsync(); } public partial class AsyncTriggerHandler : IAsyncOnRectTransformRemovedHandler { UniTask IAsyncOnRectTransformRemovedHandler.OnRectTransformRemovedAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncRectTransformRemovedTrigger GetAsyncRectTransformRemovedTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncRectTransformRemovedTrigger GetAsyncRectTransformRemovedTrigger(this Component component) { return component.gameObject.GetAsyncRectTransformRemovedTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncRectTransformRemovedTrigger : AsyncTriggerBase { TriggerEvent onRectTransformRemovedTriggerEvent; void OnRectTransformRemoved() { onRectTransformRemovedTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnRectTransformRemovedHandler GetOnRectTransformRemovedAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onRectTransformRemovedTriggerEvent), false); } public IAsyncOnRectTransformRemovedHandler GetOnRectTransformRemovedAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onRectTransformRemovedTriggerEvent), cancellationToken, false); } public UniTask OnRectTransformRemovedAsync() { return ((IAsyncOnRectTransformRemovedHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onRectTransformRemovedTriggerEvent), true)).OnRectTransformRemovedAsync(); } public UniTask OnRectTransformRemovedAsync(CancellationToken cancellationToken) { return ((IAsyncOnRectTransformRemovedHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onRectTransformRemovedTriggerEvent), cancellationToken, true)).OnRectTransformRemovedAsync(); } } #endregion #region RenderImage public interface IAsyncOnRenderImageHandler { UniTask<(RenderTexture source, RenderTexture destination)> OnRenderImageAsync(); } public partial class AsyncTriggerHandler : IAsyncOnRenderImageHandler { UniTask<(RenderTexture source, RenderTexture destination)> IAsyncOnRenderImageHandler.OnRenderImageAsync() { core.Reset(); return new UniTask<(RenderTexture source, RenderTexture destination)>((IUniTaskSource<(RenderTexture source, RenderTexture destination)>)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncRenderImageTrigger GetAsyncRenderImageTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncRenderImageTrigger GetAsyncRenderImageTrigger(this Component component) { return component.gameObject.GetAsyncRenderImageTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncRenderImageTrigger : AsyncTriggerBase { TriggerEvent<(RenderTexture source, RenderTexture destination)> onRenderImageTriggerEvent; void OnRenderImage(RenderTexture source, RenderTexture destination) { onRenderImageTriggerEvent?.TrySetResult((source, destination)); } public IAsyncOnRenderImageHandler GetOnRenderImageAsyncHandler() { return new AsyncTriggerHandler<(RenderTexture source, RenderTexture destination)>(SetTriggerEvent(ref onRenderImageTriggerEvent), false); } public IAsyncOnRenderImageHandler GetOnRenderImageAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler<(RenderTexture source, RenderTexture destination)>(SetTriggerEvent(ref onRenderImageTriggerEvent), cancellationToken, false); } public UniTask<(RenderTexture source, RenderTexture destination)> OnRenderImageAsync() { return ((IAsyncOnRenderImageHandler)new AsyncTriggerHandler<(RenderTexture source, RenderTexture destination)>(SetTriggerEvent(ref onRenderImageTriggerEvent), true)).OnRenderImageAsync(); } public UniTask<(RenderTexture source, RenderTexture destination)> OnRenderImageAsync(CancellationToken cancellationToken) { return ((IAsyncOnRenderImageHandler)new AsyncTriggerHandler<(RenderTexture source, RenderTexture destination)>(SetTriggerEvent(ref onRenderImageTriggerEvent), cancellationToken, true)).OnRenderImageAsync(); } } #endregion #region RenderObject public interface IAsyncOnRenderObjectHandler { UniTask OnRenderObjectAsync(); } public partial class AsyncTriggerHandler : IAsyncOnRenderObjectHandler { UniTask IAsyncOnRenderObjectHandler.OnRenderObjectAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncRenderObjectTrigger GetAsyncRenderObjectTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncRenderObjectTrigger GetAsyncRenderObjectTrigger(this Component component) { return component.gameObject.GetAsyncRenderObjectTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncRenderObjectTrigger : AsyncTriggerBase { TriggerEvent onRenderObjectTriggerEvent; void OnRenderObject() { onRenderObjectTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnRenderObjectHandler GetOnRenderObjectAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onRenderObjectTriggerEvent), false); } public IAsyncOnRenderObjectHandler GetOnRenderObjectAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onRenderObjectTriggerEvent), cancellationToken, false); } public UniTask OnRenderObjectAsync() { return ((IAsyncOnRenderObjectHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onRenderObjectTriggerEvent), true)).OnRenderObjectAsync(); } public UniTask OnRenderObjectAsync(CancellationToken cancellationToken) { return ((IAsyncOnRenderObjectHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onRenderObjectTriggerEvent), cancellationToken, true)).OnRenderObjectAsync(); } } #endregion #region ServerInitialized public interface IAsyncOnServerInitializedHandler { UniTask OnServerInitializedAsync(); } public partial class AsyncTriggerHandler : IAsyncOnServerInitializedHandler { UniTask IAsyncOnServerInitializedHandler.OnServerInitializedAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncServerInitializedTrigger GetAsyncServerInitializedTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncServerInitializedTrigger GetAsyncServerInitializedTrigger(this Component component) { return component.gameObject.GetAsyncServerInitializedTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncServerInitializedTrigger : AsyncTriggerBase { TriggerEvent onServerInitializedTriggerEvent; void OnServerInitialized() { onServerInitializedTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnServerInitializedHandler GetOnServerInitializedAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onServerInitializedTriggerEvent), false); } public IAsyncOnServerInitializedHandler GetOnServerInitializedAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onServerInitializedTriggerEvent), cancellationToken, false); } public UniTask OnServerInitializedAsync() { return ((IAsyncOnServerInitializedHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onServerInitializedTriggerEvent), true)).OnServerInitializedAsync(); } public UniTask OnServerInitializedAsync(CancellationToken cancellationToken) { return ((IAsyncOnServerInitializedHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onServerInitializedTriggerEvent), cancellationToken, true)).OnServerInitializedAsync(); } } #endregion #region TransformChildrenChanged public interface IAsyncOnTransformChildrenChangedHandler { UniTask OnTransformChildrenChangedAsync(); } public partial class AsyncTriggerHandler : IAsyncOnTransformChildrenChangedHandler { UniTask IAsyncOnTransformChildrenChangedHandler.OnTransformChildrenChangedAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncTransformChildrenChangedTrigger GetAsyncTransformChildrenChangedTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncTransformChildrenChangedTrigger GetAsyncTransformChildrenChangedTrigger(this Component component) { return component.gameObject.GetAsyncTransformChildrenChangedTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncTransformChildrenChangedTrigger : AsyncTriggerBase { TriggerEvent onTransformChildrenChangedTriggerEvent; void OnTransformChildrenChanged() { onTransformChildrenChangedTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnTransformChildrenChangedHandler GetOnTransformChildrenChangedAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onTransformChildrenChangedTriggerEvent), false); } public IAsyncOnTransformChildrenChangedHandler GetOnTransformChildrenChangedAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onTransformChildrenChangedTriggerEvent), cancellationToken, false); } public UniTask OnTransformChildrenChangedAsync() { return ((IAsyncOnTransformChildrenChangedHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onTransformChildrenChangedTriggerEvent), true)).OnTransformChildrenChangedAsync(); } public UniTask OnTransformChildrenChangedAsync(CancellationToken cancellationToken) { return ((IAsyncOnTransformChildrenChangedHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onTransformChildrenChangedTriggerEvent), cancellationToken, true)).OnTransformChildrenChangedAsync(); } } #endregion #region TransformParentChanged public interface IAsyncOnTransformParentChangedHandler { UniTask OnTransformParentChangedAsync(); } public partial class AsyncTriggerHandler : IAsyncOnTransformParentChangedHandler { UniTask IAsyncOnTransformParentChangedHandler.OnTransformParentChangedAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncTransformParentChangedTrigger GetAsyncTransformParentChangedTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncTransformParentChangedTrigger GetAsyncTransformParentChangedTrigger(this Component component) { return component.gameObject.GetAsyncTransformParentChangedTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncTransformParentChangedTrigger : AsyncTriggerBase { TriggerEvent onTransformParentChangedTriggerEvent; void OnTransformParentChanged() { onTransformParentChangedTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnTransformParentChangedHandler GetOnTransformParentChangedAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onTransformParentChangedTriggerEvent), false); } public IAsyncOnTransformParentChangedHandler GetOnTransformParentChangedAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onTransformParentChangedTriggerEvent), cancellationToken, false); } public UniTask OnTransformParentChangedAsync() { return ((IAsyncOnTransformParentChangedHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onTransformParentChangedTriggerEvent), true)).OnTransformParentChangedAsync(); } public UniTask OnTransformParentChangedAsync(CancellationToken cancellationToken) { return ((IAsyncOnTransformParentChangedHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onTransformParentChangedTriggerEvent), cancellationToken, true)).OnTransformParentChangedAsync(); } } #endregion #region TriggerEnter public interface IAsyncOnTriggerEnterHandler { UniTask OnTriggerEnterAsync(); } public partial class AsyncTriggerHandler : IAsyncOnTriggerEnterHandler { UniTask IAsyncOnTriggerEnterHandler.OnTriggerEnterAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncTriggerEnterTrigger GetAsyncTriggerEnterTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncTriggerEnterTrigger GetAsyncTriggerEnterTrigger(this Component component) { return component.gameObject.GetAsyncTriggerEnterTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncTriggerEnterTrigger : AsyncTriggerBase { TriggerEvent onTriggerEnterTriggerEvent; void OnTriggerEnter(Collider other) { onTriggerEnterTriggerEvent?.TrySetResult((other)); } public IAsyncOnTriggerEnterHandler GetOnTriggerEnterAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerEnterTriggerEvent), false); } public IAsyncOnTriggerEnterHandler GetOnTriggerEnterAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerEnterTriggerEvent), cancellationToken, false); } public UniTask OnTriggerEnterAsync() { return ((IAsyncOnTriggerEnterHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerEnterTriggerEvent), true)).OnTriggerEnterAsync(); } public UniTask OnTriggerEnterAsync(CancellationToken cancellationToken) { return ((IAsyncOnTriggerEnterHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerEnterTriggerEvent), cancellationToken, true)).OnTriggerEnterAsync(); } } #endregion #region TriggerEnter2D public interface IAsyncOnTriggerEnter2DHandler { UniTask OnTriggerEnter2DAsync(); } public partial class AsyncTriggerHandler : IAsyncOnTriggerEnter2DHandler { UniTask IAsyncOnTriggerEnter2DHandler.OnTriggerEnter2DAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncTriggerEnter2DTrigger GetAsyncTriggerEnter2DTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncTriggerEnter2DTrigger GetAsyncTriggerEnter2DTrigger(this Component component) { return component.gameObject.GetAsyncTriggerEnter2DTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncTriggerEnter2DTrigger : AsyncTriggerBase { TriggerEvent onTriggerEnter2DTriggerEvent; void OnTriggerEnter2D(Collider2D other) { onTriggerEnter2DTriggerEvent?.TrySetResult((other)); } public IAsyncOnTriggerEnter2DHandler GetOnTriggerEnter2DAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerEnter2DTriggerEvent), false); } public IAsyncOnTriggerEnter2DHandler GetOnTriggerEnter2DAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerEnter2DTriggerEvent), cancellationToken, false); } public UniTask OnTriggerEnter2DAsync() { return ((IAsyncOnTriggerEnter2DHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerEnter2DTriggerEvent), true)).OnTriggerEnter2DAsync(); } public UniTask OnTriggerEnter2DAsync(CancellationToken cancellationToken) { return ((IAsyncOnTriggerEnter2DHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerEnter2DTriggerEvent), cancellationToken, true)).OnTriggerEnter2DAsync(); } } #endregion #region TriggerExit public interface IAsyncOnTriggerExitHandler { UniTask OnTriggerExitAsync(); } public partial class AsyncTriggerHandler : IAsyncOnTriggerExitHandler { UniTask IAsyncOnTriggerExitHandler.OnTriggerExitAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncTriggerExitTrigger GetAsyncTriggerExitTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncTriggerExitTrigger GetAsyncTriggerExitTrigger(this Component component) { return component.gameObject.GetAsyncTriggerExitTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncTriggerExitTrigger : AsyncTriggerBase { TriggerEvent onTriggerExitTriggerEvent; void OnTriggerExit(Collider other) { onTriggerExitTriggerEvent?.TrySetResult((other)); } public IAsyncOnTriggerExitHandler GetOnTriggerExitAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerExitTriggerEvent), false); } public IAsyncOnTriggerExitHandler GetOnTriggerExitAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerExitTriggerEvent), cancellationToken, false); } public UniTask OnTriggerExitAsync() { return ((IAsyncOnTriggerExitHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerExitTriggerEvent), true)).OnTriggerExitAsync(); } public UniTask OnTriggerExitAsync(CancellationToken cancellationToken) { return ((IAsyncOnTriggerExitHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerExitTriggerEvent), cancellationToken, true)).OnTriggerExitAsync(); } } #endregion #region TriggerExit2D public interface IAsyncOnTriggerExit2DHandler { UniTask OnTriggerExit2DAsync(); } public partial class AsyncTriggerHandler : IAsyncOnTriggerExit2DHandler { UniTask IAsyncOnTriggerExit2DHandler.OnTriggerExit2DAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncTriggerExit2DTrigger GetAsyncTriggerExit2DTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncTriggerExit2DTrigger GetAsyncTriggerExit2DTrigger(this Component component) { return component.gameObject.GetAsyncTriggerExit2DTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncTriggerExit2DTrigger : AsyncTriggerBase { TriggerEvent onTriggerExit2DTriggerEvent; void OnTriggerExit2D(Collider2D other) { onTriggerExit2DTriggerEvent?.TrySetResult((other)); } public IAsyncOnTriggerExit2DHandler GetOnTriggerExit2DAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerExit2DTriggerEvent), false); } public IAsyncOnTriggerExit2DHandler GetOnTriggerExit2DAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerExit2DTriggerEvent), cancellationToken, false); } public UniTask OnTriggerExit2DAsync() { return ((IAsyncOnTriggerExit2DHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerExit2DTriggerEvent), true)).OnTriggerExit2DAsync(); } public UniTask OnTriggerExit2DAsync(CancellationToken cancellationToken) { return ((IAsyncOnTriggerExit2DHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerExit2DTriggerEvent), cancellationToken, true)).OnTriggerExit2DAsync(); } } #endregion #region TriggerStay public interface IAsyncOnTriggerStayHandler { UniTask OnTriggerStayAsync(); } public partial class AsyncTriggerHandler : IAsyncOnTriggerStayHandler { UniTask IAsyncOnTriggerStayHandler.OnTriggerStayAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncTriggerStayTrigger GetAsyncTriggerStayTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncTriggerStayTrigger GetAsyncTriggerStayTrigger(this Component component) { return component.gameObject.GetAsyncTriggerStayTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncTriggerStayTrigger : AsyncTriggerBase { TriggerEvent onTriggerStayTriggerEvent; void OnTriggerStay(Collider other) { onTriggerStayTriggerEvent?.TrySetResult((other)); } public IAsyncOnTriggerStayHandler GetOnTriggerStayAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerStayTriggerEvent), false); } public IAsyncOnTriggerStayHandler GetOnTriggerStayAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerStayTriggerEvent), cancellationToken, false); } public UniTask OnTriggerStayAsync() { return ((IAsyncOnTriggerStayHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerStayTriggerEvent), true)).OnTriggerStayAsync(); } public UniTask OnTriggerStayAsync(CancellationToken cancellationToken) { return ((IAsyncOnTriggerStayHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerStayTriggerEvent), cancellationToken, true)).OnTriggerStayAsync(); } } #endregion #region TriggerStay2D public interface IAsyncOnTriggerStay2DHandler { UniTask OnTriggerStay2DAsync(); } public partial class AsyncTriggerHandler : IAsyncOnTriggerStay2DHandler { UniTask IAsyncOnTriggerStay2DHandler.OnTriggerStay2DAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncTriggerStay2DTrigger GetAsyncTriggerStay2DTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncTriggerStay2DTrigger GetAsyncTriggerStay2DTrigger(this Component component) { return component.gameObject.GetAsyncTriggerStay2DTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncTriggerStay2DTrigger : AsyncTriggerBase { TriggerEvent onTriggerStay2DTriggerEvent; void OnTriggerStay2D(Collider2D other) { onTriggerStay2DTriggerEvent?.TrySetResult((other)); } public IAsyncOnTriggerStay2DHandler GetOnTriggerStay2DAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerStay2DTriggerEvent), false); } public IAsyncOnTriggerStay2DHandler GetOnTriggerStay2DAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerStay2DTriggerEvent), cancellationToken, false); } public UniTask OnTriggerStay2DAsync() { return ((IAsyncOnTriggerStay2DHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerStay2DTriggerEvent), true)).OnTriggerStay2DAsync(); } public UniTask OnTriggerStay2DAsync(CancellationToken cancellationToken) { return ((IAsyncOnTriggerStay2DHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onTriggerStay2DTriggerEvent), cancellationToken, true)).OnTriggerStay2DAsync(); } } #endregion #region Validate public interface IAsyncOnValidateHandler { UniTask OnValidateAsync(); } public partial class AsyncTriggerHandler : IAsyncOnValidateHandler { UniTask IAsyncOnValidateHandler.OnValidateAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncValidateTrigger GetAsyncValidateTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncValidateTrigger GetAsyncValidateTrigger(this Component component) { return component.gameObject.GetAsyncValidateTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncValidateTrigger : AsyncTriggerBase { TriggerEvent onValidateTriggerEvent; void OnValidate() { onValidateTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnValidateHandler GetOnValidateAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onValidateTriggerEvent), false); } public IAsyncOnValidateHandler GetOnValidateAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onValidateTriggerEvent), cancellationToken, false); } public UniTask OnValidateAsync() { return ((IAsyncOnValidateHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onValidateTriggerEvent), true)).OnValidateAsync(); } public UniTask OnValidateAsync(CancellationToken cancellationToken) { return ((IAsyncOnValidateHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onValidateTriggerEvent), cancellationToken, true)).OnValidateAsync(); } } #endregion #region WillRenderObject public interface IAsyncOnWillRenderObjectHandler { UniTask OnWillRenderObjectAsync(); } public partial class AsyncTriggerHandler : IAsyncOnWillRenderObjectHandler { UniTask IAsyncOnWillRenderObjectHandler.OnWillRenderObjectAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncWillRenderObjectTrigger GetAsyncWillRenderObjectTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncWillRenderObjectTrigger GetAsyncWillRenderObjectTrigger(this Component component) { return component.gameObject.GetAsyncWillRenderObjectTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncWillRenderObjectTrigger : AsyncTriggerBase { TriggerEvent onWillRenderObjectTriggerEvent; void OnWillRenderObject() { onWillRenderObjectTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncOnWillRenderObjectHandler GetOnWillRenderObjectAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onWillRenderObjectTriggerEvent), false); } public IAsyncOnWillRenderObjectHandler GetOnWillRenderObjectAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onWillRenderObjectTriggerEvent), cancellationToken, false); } public UniTask OnWillRenderObjectAsync() { return ((IAsyncOnWillRenderObjectHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onWillRenderObjectTriggerEvent), true)).OnWillRenderObjectAsync(); } public UniTask OnWillRenderObjectAsync(CancellationToken cancellationToken) { return ((IAsyncOnWillRenderObjectHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onWillRenderObjectTriggerEvent), cancellationToken, true)).OnWillRenderObjectAsync(); } } #endregion #region Reset public interface IAsyncResetHandler { UniTask ResetAsync(); } public partial class AsyncTriggerHandler : IAsyncResetHandler { UniTask IAsyncResetHandler.ResetAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncResetTrigger GetAsyncResetTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncResetTrigger GetAsyncResetTrigger(this Component component) { return component.gameObject.GetAsyncResetTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncResetTrigger : AsyncTriggerBase { TriggerEvent resetTriggerEvent; void Reset() { resetTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncResetHandler GetResetAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref resetTriggerEvent), false); } public IAsyncResetHandler GetResetAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref resetTriggerEvent), cancellationToken, false); } public UniTask ResetAsync() { return ((IAsyncResetHandler)new AsyncTriggerHandler(SetTriggerEvent(ref resetTriggerEvent), true)).ResetAsync(); } public UniTask ResetAsync(CancellationToken cancellationToken) { return ((IAsyncResetHandler)new AsyncTriggerHandler(SetTriggerEvent(ref resetTriggerEvent), cancellationToken, true)).ResetAsync(); } } #endregion #region Update public interface IAsyncUpdateHandler { UniTask UpdateAsync(); } public partial class AsyncTriggerHandler : IAsyncUpdateHandler { UniTask IAsyncUpdateHandler.UpdateAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncUpdateTrigger GetAsyncUpdateTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncUpdateTrigger GetAsyncUpdateTrigger(this Component component) { return component.gameObject.GetAsyncUpdateTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncUpdateTrigger : AsyncTriggerBase { TriggerEvent updateTriggerEvent; void Update() { updateTriggerEvent?.TrySetResult(AsyncUnit.Default); } public IAsyncUpdateHandler GetUpdateAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref updateTriggerEvent), false); } public IAsyncUpdateHandler GetUpdateAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref updateTriggerEvent), cancellationToken, false); } public UniTask UpdateAsync() { return ((IAsyncUpdateHandler)new AsyncTriggerHandler(SetTriggerEvent(ref updateTriggerEvent), true)).UpdateAsync(); } public UniTask UpdateAsync(CancellationToken cancellationToken) { return ((IAsyncUpdateHandler)new AsyncTriggerHandler(SetTriggerEvent(ref updateTriggerEvent), cancellationToken, true)).UpdateAsync(); } } #endregion #region BeginDrag public interface IAsyncOnBeginDragHandler { UniTask OnBeginDragAsync(); } public partial class AsyncTriggerHandler : IAsyncOnBeginDragHandler { UniTask IAsyncOnBeginDragHandler.OnBeginDragAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncBeginDragTrigger GetAsyncBeginDragTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncBeginDragTrigger GetAsyncBeginDragTrigger(this Component component) { return component.gameObject.GetAsyncBeginDragTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncBeginDragTrigger : AsyncTriggerBase, IBeginDragHandler { TriggerEvent onBeginDragTriggerEvent; void IBeginDragHandler.OnBeginDrag(PointerEventData eventData) { onBeginDragTriggerEvent?.TrySetResult((eventData)); } public IAsyncOnBeginDragHandler GetOnBeginDragAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onBeginDragTriggerEvent), false); } public IAsyncOnBeginDragHandler GetOnBeginDragAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onBeginDragTriggerEvent), cancellationToken, false); } public UniTask OnBeginDragAsync() { return ((IAsyncOnBeginDragHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onBeginDragTriggerEvent), true)).OnBeginDragAsync(); } public UniTask OnBeginDragAsync(CancellationToken cancellationToken) { return ((IAsyncOnBeginDragHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onBeginDragTriggerEvent), cancellationToken, true)).OnBeginDragAsync(); } } #endregion #region Cancel public interface IAsyncOnCancelHandler { UniTask OnCancelAsync(); } public partial class AsyncTriggerHandler : IAsyncOnCancelHandler { UniTask IAsyncOnCancelHandler.OnCancelAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncCancelTrigger GetAsyncCancelTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncCancelTrigger GetAsyncCancelTrigger(this Component component) { return component.gameObject.GetAsyncCancelTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncCancelTrigger : AsyncTriggerBase, ICancelHandler { TriggerEvent onCancelTriggerEvent; void ICancelHandler.OnCancel(BaseEventData eventData) { onCancelTriggerEvent?.TrySetResult((eventData)); } public IAsyncOnCancelHandler GetOnCancelAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onCancelTriggerEvent), false); } public IAsyncOnCancelHandler GetOnCancelAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onCancelTriggerEvent), cancellationToken, false); } public UniTask OnCancelAsync() { return ((IAsyncOnCancelHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onCancelTriggerEvent), true)).OnCancelAsync(); } public UniTask OnCancelAsync(CancellationToken cancellationToken) { return ((IAsyncOnCancelHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onCancelTriggerEvent), cancellationToken, true)).OnCancelAsync(); } } #endregion #region Deselect public interface IAsyncOnDeselectHandler { UniTask OnDeselectAsync(); } public partial class AsyncTriggerHandler : IAsyncOnDeselectHandler { UniTask IAsyncOnDeselectHandler.OnDeselectAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncDeselectTrigger GetAsyncDeselectTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncDeselectTrigger GetAsyncDeselectTrigger(this Component component) { return component.gameObject.GetAsyncDeselectTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncDeselectTrigger : AsyncTriggerBase, IDeselectHandler { TriggerEvent onDeselectTriggerEvent; void IDeselectHandler.OnDeselect(BaseEventData eventData) { onDeselectTriggerEvent?.TrySetResult((eventData)); } public IAsyncOnDeselectHandler GetOnDeselectAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onDeselectTriggerEvent), false); } public IAsyncOnDeselectHandler GetOnDeselectAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onDeselectTriggerEvent), cancellationToken, false); } public UniTask OnDeselectAsync() { return ((IAsyncOnDeselectHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onDeselectTriggerEvent), true)).OnDeselectAsync(); } public UniTask OnDeselectAsync(CancellationToken cancellationToken) { return ((IAsyncOnDeselectHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onDeselectTriggerEvent), cancellationToken, true)).OnDeselectAsync(); } } #endregion #region Drag public interface IAsyncOnDragHandler { UniTask OnDragAsync(); } public partial class AsyncTriggerHandler : IAsyncOnDragHandler { UniTask IAsyncOnDragHandler.OnDragAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncDragTrigger GetAsyncDragTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncDragTrigger GetAsyncDragTrigger(this Component component) { return component.gameObject.GetAsyncDragTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncDragTrigger : AsyncTriggerBase, IDragHandler { TriggerEvent onDragTriggerEvent; void IDragHandler.OnDrag(PointerEventData eventData) { onDragTriggerEvent?.TrySetResult((eventData)); } public IAsyncOnDragHandler GetOnDragAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onDragTriggerEvent), false); } public IAsyncOnDragHandler GetOnDragAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onDragTriggerEvent), cancellationToken, false); } public UniTask OnDragAsync() { return ((IAsyncOnDragHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onDragTriggerEvent), true)).OnDragAsync(); } public UniTask OnDragAsync(CancellationToken cancellationToken) { return ((IAsyncOnDragHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onDragTriggerEvent), cancellationToken, true)).OnDragAsync(); } } #endregion #region Drop public interface IAsyncOnDropHandler { UniTask OnDropAsync(); } public partial class AsyncTriggerHandler : IAsyncOnDropHandler { UniTask IAsyncOnDropHandler.OnDropAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncDropTrigger GetAsyncDropTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncDropTrigger GetAsyncDropTrigger(this Component component) { return component.gameObject.GetAsyncDropTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncDropTrigger : AsyncTriggerBase, IDropHandler { TriggerEvent onDropTriggerEvent; void IDropHandler.OnDrop(PointerEventData eventData) { onDropTriggerEvent?.TrySetResult((eventData)); } public IAsyncOnDropHandler GetOnDropAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onDropTriggerEvent), false); } public IAsyncOnDropHandler GetOnDropAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onDropTriggerEvent), cancellationToken, false); } public UniTask OnDropAsync() { return ((IAsyncOnDropHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onDropTriggerEvent), true)).OnDropAsync(); } public UniTask OnDropAsync(CancellationToken cancellationToken) { return ((IAsyncOnDropHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onDropTriggerEvent), cancellationToken, true)).OnDropAsync(); } } #endregion #region EndDrag public interface IAsyncOnEndDragHandler { UniTask OnEndDragAsync(); } public partial class AsyncTriggerHandler : IAsyncOnEndDragHandler { UniTask IAsyncOnEndDragHandler.OnEndDragAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncEndDragTrigger GetAsyncEndDragTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncEndDragTrigger GetAsyncEndDragTrigger(this Component component) { return component.gameObject.GetAsyncEndDragTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncEndDragTrigger : AsyncTriggerBase, IEndDragHandler { TriggerEvent onEndDragTriggerEvent; void IEndDragHandler.OnEndDrag(PointerEventData eventData) { onEndDragTriggerEvent?.TrySetResult((eventData)); } public IAsyncOnEndDragHandler GetOnEndDragAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onEndDragTriggerEvent), false); } public IAsyncOnEndDragHandler GetOnEndDragAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onEndDragTriggerEvent), cancellationToken, false); } public UniTask OnEndDragAsync() { return ((IAsyncOnEndDragHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onEndDragTriggerEvent), true)).OnEndDragAsync(); } public UniTask OnEndDragAsync(CancellationToken cancellationToken) { return ((IAsyncOnEndDragHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onEndDragTriggerEvent), cancellationToken, true)).OnEndDragAsync(); } } #endregion #region InitializePotentialDrag public interface IAsyncOnInitializePotentialDragHandler { UniTask OnInitializePotentialDragAsync(); } public partial class AsyncTriggerHandler : IAsyncOnInitializePotentialDragHandler { UniTask IAsyncOnInitializePotentialDragHandler.OnInitializePotentialDragAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncInitializePotentialDragTrigger GetAsyncInitializePotentialDragTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncInitializePotentialDragTrigger GetAsyncInitializePotentialDragTrigger(this Component component) { return component.gameObject.GetAsyncInitializePotentialDragTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncInitializePotentialDragTrigger : AsyncTriggerBase, IInitializePotentialDragHandler { TriggerEvent onInitializePotentialDragTriggerEvent; void IInitializePotentialDragHandler.OnInitializePotentialDrag(PointerEventData eventData) { onInitializePotentialDragTriggerEvent?.TrySetResult((eventData)); } public IAsyncOnInitializePotentialDragHandler GetOnInitializePotentialDragAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onInitializePotentialDragTriggerEvent), false); } public IAsyncOnInitializePotentialDragHandler GetOnInitializePotentialDragAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onInitializePotentialDragTriggerEvent), cancellationToken, false); } public UniTask OnInitializePotentialDragAsync() { return ((IAsyncOnInitializePotentialDragHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onInitializePotentialDragTriggerEvent), true)).OnInitializePotentialDragAsync(); } public UniTask OnInitializePotentialDragAsync(CancellationToken cancellationToken) { return ((IAsyncOnInitializePotentialDragHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onInitializePotentialDragTriggerEvent), cancellationToken, true)).OnInitializePotentialDragAsync(); } } #endregion #region Move public interface IAsyncOnMoveHandler { UniTask OnMoveAsync(); } public partial class AsyncTriggerHandler : IAsyncOnMoveHandler { UniTask IAsyncOnMoveHandler.OnMoveAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncMoveTrigger GetAsyncMoveTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncMoveTrigger GetAsyncMoveTrigger(this Component component) { return component.gameObject.GetAsyncMoveTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncMoveTrigger : AsyncTriggerBase, IMoveHandler { TriggerEvent onMoveTriggerEvent; void IMoveHandler.OnMove(AxisEventData eventData) { onMoveTriggerEvent?.TrySetResult((eventData)); } public IAsyncOnMoveHandler GetOnMoveAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onMoveTriggerEvent), false); } public IAsyncOnMoveHandler GetOnMoveAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onMoveTriggerEvent), cancellationToken, false); } public UniTask OnMoveAsync() { return ((IAsyncOnMoveHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onMoveTriggerEvent), true)).OnMoveAsync(); } public UniTask OnMoveAsync(CancellationToken cancellationToken) { return ((IAsyncOnMoveHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onMoveTriggerEvent), cancellationToken, true)).OnMoveAsync(); } } #endregion #region PointerClick public interface IAsyncOnPointerClickHandler { UniTask OnPointerClickAsync(); } public partial class AsyncTriggerHandler : IAsyncOnPointerClickHandler { UniTask IAsyncOnPointerClickHandler.OnPointerClickAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncPointerClickTrigger GetAsyncPointerClickTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncPointerClickTrigger GetAsyncPointerClickTrigger(this Component component) { return component.gameObject.GetAsyncPointerClickTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncPointerClickTrigger : AsyncTriggerBase, IPointerClickHandler { TriggerEvent onPointerClickTriggerEvent; void IPointerClickHandler.OnPointerClick(PointerEventData eventData) { onPointerClickTriggerEvent?.TrySetResult((eventData)); } public IAsyncOnPointerClickHandler GetOnPointerClickAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onPointerClickTriggerEvent), false); } public IAsyncOnPointerClickHandler GetOnPointerClickAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onPointerClickTriggerEvent), cancellationToken, false); } public UniTask OnPointerClickAsync() { return ((IAsyncOnPointerClickHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onPointerClickTriggerEvent), true)).OnPointerClickAsync(); } public UniTask OnPointerClickAsync(CancellationToken cancellationToken) { return ((IAsyncOnPointerClickHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onPointerClickTriggerEvent), cancellationToken, true)).OnPointerClickAsync(); } } #endregion #region PointerDown public interface IAsyncOnPointerDownHandler { UniTask OnPointerDownAsync(); } public partial class AsyncTriggerHandler : IAsyncOnPointerDownHandler { UniTask IAsyncOnPointerDownHandler.OnPointerDownAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncPointerDownTrigger GetAsyncPointerDownTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncPointerDownTrigger GetAsyncPointerDownTrigger(this Component component) { return component.gameObject.GetAsyncPointerDownTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncPointerDownTrigger : AsyncTriggerBase, IPointerDownHandler { TriggerEvent onPointerDownTriggerEvent; void IPointerDownHandler.OnPointerDown(PointerEventData eventData) { onPointerDownTriggerEvent?.TrySetResult((eventData)); } public IAsyncOnPointerDownHandler GetOnPointerDownAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onPointerDownTriggerEvent), false); } public IAsyncOnPointerDownHandler GetOnPointerDownAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onPointerDownTriggerEvent), cancellationToken, false); } public UniTask OnPointerDownAsync() { return ((IAsyncOnPointerDownHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onPointerDownTriggerEvent), true)).OnPointerDownAsync(); } public UniTask OnPointerDownAsync(CancellationToken cancellationToken) { return ((IAsyncOnPointerDownHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onPointerDownTriggerEvent), cancellationToken, true)).OnPointerDownAsync(); } } #endregion #region PointerEnter public interface IAsyncOnPointerEnterHandler { UniTask OnPointerEnterAsync(); } public partial class AsyncTriggerHandler : IAsyncOnPointerEnterHandler { UniTask IAsyncOnPointerEnterHandler.OnPointerEnterAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncPointerEnterTrigger GetAsyncPointerEnterTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncPointerEnterTrigger GetAsyncPointerEnterTrigger(this Component component) { return component.gameObject.GetAsyncPointerEnterTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncPointerEnterTrigger : AsyncTriggerBase, IPointerEnterHandler { TriggerEvent onPointerEnterTriggerEvent; void IPointerEnterHandler.OnPointerEnter(PointerEventData eventData) { onPointerEnterTriggerEvent?.TrySetResult((eventData)); } public IAsyncOnPointerEnterHandler GetOnPointerEnterAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onPointerEnterTriggerEvent), false); } public IAsyncOnPointerEnterHandler GetOnPointerEnterAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onPointerEnterTriggerEvent), cancellationToken, false); } public UniTask OnPointerEnterAsync() { return ((IAsyncOnPointerEnterHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onPointerEnterTriggerEvent), true)).OnPointerEnterAsync(); } public UniTask OnPointerEnterAsync(CancellationToken cancellationToken) { return ((IAsyncOnPointerEnterHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onPointerEnterTriggerEvent), cancellationToken, true)).OnPointerEnterAsync(); } } #endregion #region PointerExit public interface IAsyncOnPointerExitHandler { UniTask OnPointerExitAsync(); } public partial class AsyncTriggerHandler : IAsyncOnPointerExitHandler { UniTask IAsyncOnPointerExitHandler.OnPointerExitAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncPointerExitTrigger GetAsyncPointerExitTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncPointerExitTrigger GetAsyncPointerExitTrigger(this Component component) { return component.gameObject.GetAsyncPointerExitTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncPointerExitTrigger : AsyncTriggerBase, IPointerExitHandler { TriggerEvent onPointerExitTriggerEvent; void IPointerExitHandler.OnPointerExit(PointerEventData eventData) { onPointerExitTriggerEvent?.TrySetResult((eventData)); } public IAsyncOnPointerExitHandler GetOnPointerExitAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onPointerExitTriggerEvent), false); } public IAsyncOnPointerExitHandler GetOnPointerExitAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onPointerExitTriggerEvent), cancellationToken, false); } public UniTask OnPointerExitAsync() { return ((IAsyncOnPointerExitHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onPointerExitTriggerEvent), true)).OnPointerExitAsync(); } public UniTask OnPointerExitAsync(CancellationToken cancellationToken) { return ((IAsyncOnPointerExitHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onPointerExitTriggerEvent), cancellationToken, true)).OnPointerExitAsync(); } } #endregion #region PointerUp public interface IAsyncOnPointerUpHandler { UniTask OnPointerUpAsync(); } public partial class AsyncTriggerHandler : IAsyncOnPointerUpHandler { UniTask IAsyncOnPointerUpHandler.OnPointerUpAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncPointerUpTrigger GetAsyncPointerUpTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncPointerUpTrigger GetAsyncPointerUpTrigger(this Component component) { return component.gameObject.GetAsyncPointerUpTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncPointerUpTrigger : AsyncTriggerBase, IPointerUpHandler { TriggerEvent onPointerUpTriggerEvent; void IPointerUpHandler.OnPointerUp(PointerEventData eventData) { onPointerUpTriggerEvent?.TrySetResult((eventData)); } public IAsyncOnPointerUpHandler GetOnPointerUpAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onPointerUpTriggerEvent), false); } public IAsyncOnPointerUpHandler GetOnPointerUpAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onPointerUpTriggerEvent), cancellationToken, false); } public UniTask OnPointerUpAsync() { return ((IAsyncOnPointerUpHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onPointerUpTriggerEvent), true)).OnPointerUpAsync(); } public UniTask OnPointerUpAsync(CancellationToken cancellationToken) { return ((IAsyncOnPointerUpHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onPointerUpTriggerEvent), cancellationToken, true)).OnPointerUpAsync(); } } #endregion #region Scroll public interface IAsyncOnScrollHandler { UniTask OnScrollAsync(); } public partial class AsyncTriggerHandler : IAsyncOnScrollHandler { UniTask IAsyncOnScrollHandler.OnScrollAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncScrollTrigger GetAsyncScrollTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncScrollTrigger GetAsyncScrollTrigger(this Component component) { return component.gameObject.GetAsyncScrollTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncScrollTrigger : AsyncTriggerBase, IScrollHandler { TriggerEvent onScrollTriggerEvent; void IScrollHandler.OnScroll(PointerEventData eventData) { onScrollTriggerEvent?.TrySetResult((eventData)); } public IAsyncOnScrollHandler GetOnScrollAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onScrollTriggerEvent), false); } public IAsyncOnScrollHandler GetOnScrollAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onScrollTriggerEvent), cancellationToken, false); } public UniTask OnScrollAsync() { return ((IAsyncOnScrollHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onScrollTriggerEvent), true)).OnScrollAsync(); } public UniTask OnScrollAsync(CancellationToken cancellationToken) { return ((IAsyncOnScrollHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onScrollTriggerEvent), cancellationToken, true)).OnScrollAsync(); } } #endregion #region Select public interface IAsyncOnSelectHandler { UniTask OnSelectAsync(); } public partial class AsyncTriggerHandler : IAsyncOnSelectHandler { UniTask IAsyncOnSelectHandler.OnSelectAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncSelectTrigger GetAsyncSelectTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncSelectTrigger GetAsyncSelectTrigger(this Component component) { return component.gameObject.GetAsyncSelectTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncSelectTrigger : AsyncTriggerBase, ISelectHandler { TriggerEvent onSelectTriggerEvent; void ISelectHandler.OnSelect(BaseEventData eventData) { onSelectTriggerEvent?.TrySetResult((eventData)); } public IAsyncOnSelectHandler GetOnSelectAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onSelectTriggerEvent), false); } public IAsyncOnSelectHandler GetOnSelectAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onSelectTriggerEvent), cancellationToken, false); } public UniTask OnSelectAsync() { return ((IAsyncOnSelectHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onSelectTriggerEvent), true)).OnSelectAsync(); } public UniTask OnSelectAsync(CancellationToken cancellationToken) { return ((IAsyncOnSelectHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onSelectTriggerEvent), cancellationToken, true)).OnSelectAsync(); } } #endregion #region Submit public interface IAsyncOnSubmitHandler { UniTask OnSubmitAsync(); } public partial class AsyncTriggerHandler : IAsyncOnSubmitHandler { UniTask IAsyncOnSubmitHandler.OnSubmitAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncSubmitTrigger GetAsyncSubmitTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncSubmitTrigger GetAsyncSubmitTrigger(this Component component) { return component.gameObject.GetAsyncSubmitTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncSubmitTrigger : AsyncTriggerBase, ISubmitHandler { TriggerEvent onSubmitTriggerEvent; void ISubmitHandler.OnSubmit(BaseEventData eventData) { onSubmitTriggerEvent?.TrySetResult((eventData)); } public IAsyncOnSubmitHandler GetOnSubmitAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onSubmitTriggerEvent), false); } public IAsyncOnSubmitHandler GetOnSubmitAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onSubmitTriggerEvent), cancellationToken, false); } public UniTask OnSubmitAsync() { return ((IAsyncOnSubmitHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onSubmitTriggerEvent), true)).OnSubmitAsync(); } public UniTask OnSubmitAsync(CancellationToken cancellationToken) { return ((IAsyncOnSubmitHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onSubmitTriggerEvent), cancellationToken, true)).OnSubmitAsync(); } } #endregion #region UpdateSelected public interface IAsyncOnUpdateSelectedHandler { UniTask OnUpdateSelectedAsync(); } public partial class AsyncTriggerHandler : IAsyncOnUpdateSelectedHandler { UniTask IAsyncOnUpdateSelectedHandler.OnUpdateSelectedAsync() { core.Reset(); return new UniTask((IUniTaskSource)(object)this, core.Version); } } public static partial class AsyncTriggerExtensions { public static AsyncUpdateSelectedTrigger GetAsyncUpdateSelectedTrigger(this GameObject gameObject) { return GetOrAddComponent(gameObject); } public static AsyncUpdateSelectedTrigger GetAsyncUpdateSelectedTrigger(this Component component) { return component.gameObject.GetAsyncUpdateSelectedTrigger(); } } [DisallowMultipleComponent] public sealed class AsyncUpdateSelectedTrigger : AsyncTriggerBase, IUpdateSelectedHandler { TriggerEvent onUpdateSelectedTriggerEvent; void IUpdateSelectedHandler.OnUpdateSelected(BaseEventData eventData) { onUpdateSelectedTriggerEvent?.TrySetResult((eventData)); } public IAsyncOnUpdateSelectedHandler GetOnUpdateSelectedAsyncHandler() { return new AsyncTriggerHandler(SetTriggerEvent(ref onUpdateSelectedTriggerEvent), false); } public IAsyncOnUpdateSelectedHandler GetOnUpdateSelectedAsyncHandler(CancellationToken cancellationToken) { return new AsyncTriggerHandler(SetTriggerEvent(ref onUpdateSelectedTriggerEvent), cancellationToken, false); } public UniTask OnUpdateSelectedAsync() { return ((IAsyncOnUpdateSelectedHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onUpdateSelectedTriggerEvent), true)).OnUpdateSelectedAsync(); } public UniTask OnUpdateSelectedAsync(CancellationToken cancellationToken) { return ((IAsyncOnUpdateSelectedHandler)new AsyncTriggerHandler(SetTriggerEvent(ref onUpdateSelectedTriggerEvent), cancellationToken, true)).OnUpdateSelectedAsync(); } } #endregion }