Exemplo n.º 1
0
    private void Start()
    {
        //CaptureView
        selectButton.OnClickAsObservable()
        .Subscribe(_ => captureViewController.SelectTapped());

        closeButton.OnClickAsObservable()
        .Subscribe(_ => captureViewController.CloseSelectPanel());

        captureButton.OnClickAsObservable()
        .Subscribe(_ => captureViewController.CaptureTapped());

        markerlessStartButton.OnClickAsObservable()
        .Subscribe(_ => captureViewController.MarkerlessStartTapped());

        AppStateManager.Instance.CurrentState
        .Subscribe(state =>
        {
            if (state == AppState.None)
            {
                captureViewController.MarkerlessStartDisable();
            }
            else
            {
                captureViewController.MarkerlessStartEnable();
            }
        });

        //SaveView
        backButton.OnClickAsObservable()
        .Subscribe(_ => saveViewController.BackTapped());

        saveButton.OnClickAsObservable()
        .Subscribe(_ => saveViewController.SaveTapped());

        shareButton.OnClickAsObservable()
        .Subscribe(_ => saveViewController.ShareTapped());
    }
Exemplo n.º 2
0
    private void Start()
    {
        if (SceneManager.GetActiveScene().name == "CaptureViewScene")
        {
            selectButton.OnClickAsObservable()
            .Subscribe(_ =>
            {
                Debug.Log("select");
                captureViewController.SelectTapped();
            });

            closeButton.OnClickAsObservable()
            .Subscribe(_ =>
            {
                Debug.Log("close");
                captureViewController.CloseSelectPanel();
            });

            captureButton.OnClickAsObservable()
            .Subscribe(_ =>
            {
                Debug.Log("capture");
                captureViewController.CaptureTapped();
            });

            markerlessStartButton.OnClickAsObservable()
            .Subscribe(_ =>
            {
                Debug.Log("markerlessStart");
                captureViewController.MarkerlessStartTapped();
            });

            fireworkButton.OnClickAsObservable()
            .Subscribe(_ =>
            {
                Debug.Log("firework");
                captureViewController.FireworkTapped();
            });
        }

        if (SceneManager.GetActiveScene().name == "SaveViewScene")
        {
            backButton.OnClickAsObservable()
            .Subscribe(_ =>
            {
                Debug.Log("back");
                saveViewController.BackTapped();
            });

            saveButton.OnClickAsObservable()
            .Subscribe(_ =>
            {
                Debug.Log("save");
                saveViewController.SaveTapped();
            });

            shareButton.OnClickAsObservable()
            .Subscribe(_ =>
            {
                Debug.Log("share");
                saveViewController.ShareTapped();
            });
        }
    }