Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
feature: Add AwakeAsObservable() trigger.
Browse files Browse the repository at this point in the history
  • Loading branch information
shanecelis committed Apr 13, 2022
1 parent 1ee7547 commit 7a4fc28
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System; // require keep for Windows Universal App
using UnityEngine;

namespace UniRx.Triggers
{
public class ObservableAwakeTrigger : ObservableTriggerBase
{
protected override void RaiseOnCompletedOnDestroy() { }
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,13 @@ public static IObservable<Unit> UpdateAsObservable(this GameObject gameObject)
return GetOrAddComponent<ObservableUpdateTrigger>(gameObject).UpdateAsObservable();
}

/// <summary>Call on Awake.</summary>
public static IObservable<Unit> AwakeAsObservable(this GameObject gameObject)
{
if (gameObject == null) return Observable.Empty<Unit>();
return GetOrAddComponent<ObservableAwakeTrigger>(gameObject).AwakeAsObservable();
}

#endregion

#region ObservableVisibleTrigger
Expand Down

0 comments on commit 7a4fc28

Please sign in to comment.