This repository has been archived by the owner on Feb 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 888
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
83 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
UniRx - Reactive Extensions for Unity | ||
UniRx - Reactive Extensions for Unity / ver.4.4 | ||
=== | ||
Created by Yoshifumi Kawai(neuecc) | ||
|
||
|
@@ -16,6 +16,8 @@ https://github.com/neuecc/UniRx/issues | |
|
||
Last, send me an email at: [email protected] | ||
|
||
Release Notes, see [UniRx/releases](https://github.com/neuecc/UniRx/releases) | ||
|
||
Why Rx? | ||
--- | ||
Ordinary, Unity Network operation use `WWW` and `Coroutine` but `Coroutine` is not good practice for asynchronous operation. | ||
|
@@ -323,6 +325,39 @@ LogHelper.LogCallbackAsObservable() | |
.Subscribe(); | ||
``` | ||
|
||
Stream Logger | ||
--- | ||
```csharp | ||
// using UniRx.Diagnostics; | ||
|
||
// logger is threadsafe, define per class with name. | ||
static readonly Logger logger = new Logger("Sample11"); | ||
|
||
// call once at applicationinit | ||
public static void ApplicationInitialize() | ||
{ | ||
// Log as Stream, UniRx.Diagnostics.ObservableLogger.Listener is IObservable<LogEntry> | ||
// You can subscribe and output to any place. | ||
ObservableLogger.Listener.LogToUnityDebug(); | ||
|
||
// for example, filter only Exception and upload to web. | ||
// (make custom sink(IObserver<EventEntry>) is better to use) | ||
ObservableLogger.Listener | ||
.Where(x => x.LogType == LogType.Exception) | ||
.Subscribe(x => | ||
{ | ||
// ObservableWWW.Post("", null).Subscribe(); | ||
}); | ||
} | ||
|
||
// Debug is write only DebugBuild. | ||
logger.Debug("Debug Message"); | ||
|
||
// or other logging methods | ||
logger.Log("Message"); | ||
logger.Exception(new Exception("test exception")); | ||
``` | ||
|
||
Unity specified extra gems | ||
--- | ||
```csharp | ||
|
@@ -349,6 +384,11 @@ Observable.FromCoroutine((observer, token) => enumerator(observer, token)); | |
yield return Observable.Range(1, 10).StartAsCoroutine(); | ||
``` | ||
|
||
Samples | ||
--- | ||
see [UniRx/Examples](https://github.com/neuecc/UniRx/tree/master/Assets/UniRx/Examples) | ||
How to ResourceManagement(Sample09_EventHandling), What is MainThreadDispatcher? and other notes. | ||
|
||
vs iOS AOT | ||
--- | ||
UniRx has AotSafe Utilities. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters