private async void Start() { _worldAnchorManager.IsMoving .Buffer(2, 1) .Subscribe(data => { status.text = $"{data[0]} => {data[1]}"; }); await ARSessionManager.Instance.PowerOnAsync(); // 最初にマーカー認識してからは認識頻度を落とす SubscribeFirstAction(); // ボタン操作によるARSessionのリセット btn.OnClickAsObservable() .Subscribe(async _ => { btn.interactable = false; var nextMode = txt.text == "interval" ? "normal" : "interval"; if (nextMode == "normal") { _disposable.Clear(); _ctsIntervalTracking?.Cancel(); if (SystemInfo.deviceModel.StartsWith("iPhone10")) { await ARSessionManager.Instance.PowerOffAsync(); await ARSessionManager.Instance.PowerOnAsync(autoFocus: true); } else { await ARSessionManager.Instance.ResetSessionAsync(); } } else { _ctsIntervalTracking = new CancellationTokenSource(); _disposable.Add(_worldAnchorManager.RegisterIntervalTracking(_ctsIntervalTracking)); } txt.text = nextMode; btn.interactable = true; }).AddTo(this); }