Unity/UniRx/キー取得
ナビゲーションに移動
検索に移動
キー入力取得判定
using UniRx;
var observable = Observable.EveryUpdate()
.Select(_ => Input.inputString)
.Where(_ => Input.anyKeyDown)
.Subscribe(key => Debug.Log(key))
.AddTo(gameObject);
参考:https://qiita.com/Jshirius/items/ad53546f416323c6db2c
escapeで前画面へ戻る(androidのみ)サンプル
// escapeで前画面へ戻る(androidのみ)
var observable = Observable.EveryUpdate()
.Where(_ => Application.platform == RuntimePlatform.Android)
.Where(_ => Input.GetKeyDown(KeyCode.Escape))
.Subscribe(_ => Debug.Log("Escape"))
.AddTo(gameObject);