Esempio n. 1
0
    private void OnCoordinatorStateChange(RemoteRenderingCoordinator.RemoteRenderingState state)
    {
        switch (state)
        {
        case RemoteRenderingCoordinator.RemoteRenderingState.NotSet:
        case RemoteRenderingCoordinator.RemoteRenderingState.NotInitialized:
        case RemoteRenderingCoordinator.RemoteRenderingState.ConnectingToExistingRemoteSession:
        case RemoteRenderingCoordinator.RemoteRenderingState.ConnectingToNewRemoteSession:
        case RemoteRenderingCoordinator.RemoteRenderingState.RemoteSessionReady:
        case RemoteRenderingCoordinator.RemoteRenderingState.ConnectingToRuntime:
        case RemoteRenderingCoordinator.RemoteRenderingState.RuntimeConnected:
            gameObject.SetActive(false);
            break;

        case RemoteRenderingCoordinator.RemoteRenderingState.NoSession:
            gameObject.SetActive(usesAuthConnection);
            break;

        case RemoteRenderingCoordinator.RemoteRenderingState.NotAuthorized:
            gameObject.SetActive(true);
            buttonApprove.SetActive(true);
            authInstructions.SetActive(false);
            break;
        }
    }
Esempio n. 2
0
    private void OnCoordinatorStateChange(RemoteRenderingCoordinator.RemoteRenderingState state)
    {
        // If any of the game objects is not set or already destroyed on shutdown skip update
        if (gameObject == null || buttonApprove == null || authInstructions == null)
        {
            return;
        }
        switch (state)
        {
        case RemoteRenderingCoordinator.RemoteRenderingState.NotSet:
        case RemoteRenderingCoordinator.RemoteRenderingState.NotInitialized:
        case RemoteRenderingCoordinator.RemoteRenderingState.ConnectingToExistingRemoteSession:
        case RemoteRenderingCoordinator.RemoteRenderingState.ConnectingToNewRemoteSession:
        case RemoteRenderingCoordinator.RemoteRenderingState.RemoteSessionReady:
        case RemoteRenderingCoordinator.RemoteRenderingState.ConnectingToRuntime:
        case RemoteRenderingCoordinator.RemoteRenderingState.RuntimeConnected:
            gameObject.SetActive(false);
            break;

        case RemoteRenderingCoordinator.RemoteRenderingState.NoSession:
            gameObject.SetActive(usesAuthConnection);
            break;

        case RemoteRenderingCoordinator.RemoteRenderingState.NotAuthorized:
            gameObject.SetActive(true);
            buttonApprove.SetActive(true);
            authInstructions.SetActive(false);
            break;
        }
    }
Esempio n. 3
0
    /// <summary>
    /// Configure the view to match the supplied state
    /// </summary>
    /// <param name="state">The state to match the current view to</param>
    private void ApplyStateToView(RemoteRenderingCoordinator.RemoteRenderingState state)
    {
        DisableAllButtons();
        switch (state)
        {
        case RemoteRenderingCoordinator.RemoteRenderingState.NotInitialized:
            InitializeButton.SetState(ButtonState.Ready);
            break;

        case RemoteRenderingCoordinator.RemoteRenderingState.NotAuthorized:
            InitializeButton.SetState(ButtonState.Active);
            break;

        case RemoteRenderingCoordinator.RemoteRenderingState.NoSession:
            InitializeButton.SetState(ButtonState.Active);
            RemoteSessionButton.SetState(ButtonState.Ready);
            break;

        case RemoteRenderingCoordinator.RemoteRenderingState.ConnectingToExistingRemoteSession:
            InitializeButton.SetState(ButtonState.Active);
            RemoteSessionButton.SetState(ButtonState.Working);
            RemoteSessionButton.SetText("Connecting to existing Remote Session");
            break;

        case RemoteRenderingCoordinator.RemoteRenderingState.ConnectingToNewRemoteSession:
            InitializeButton.SetState(ButtonState.Active);
            RemoteSessionButton.SetState(ButtonState.Working);
            RemoteSessionButton.SetText("Connecting to new Remote Session");
            break;

        case RemoteRenderingCoordinator.RemoteRenderingState.RemoteSessionReady:
            InitializeButton.SetState(ButtonState.Active);
            RemoteSessionButton.SetState(ButtonState.Active);
            RemoteSessionButton.SetText("Connected to new Remote Session");
            RuntimeButton.SetState(ButtonState.Ready);
            break;

        case RemoteRenderingCoordinator.RemoteRenderingState.ConnectingToRuntime:
            menuController.SelectSection(sessionMenuButton);
            InitializeButton.SetState(ButtonState.Active);
            RemoteSessionButton.SetState(ButtonState.Active);
            RuntimeButton.SetState(ButtonState.Working);
            break;

        case RemoteRenderingCoordinator.RemoteRenderingState.RuntimeConnected:
            sessionToolsMenuButton.Interactable.IsEnabled = true;
            InitializeButton.SetState(ButtonState.Active);
            RemoteSessionButton.SetState(ButtonState.Active);
            RuntimeButton.SetState(ButtonState.Active);
            break;
        }

        // Update menu buttons based on session state
        bool runtimeConnected = state == RemoteRenderingCoordinator.RemoteRenderingState.RuntimeConnected;

        menuController.SelectSection(sessionMenuButton);
        sessionToolsMenuButton.Interactable.IsEnabled = runtimeConnected;
    }
    private void OnCoordinatorStateChange(RemoteRenderingCoordinator.RemoteRenderingState state)
    {
        if (state == RemoteRenderingCoordinator.RemoteRenderingState.RuntimeConnected)
        {
            TryFindBaseObject();

            if (baseObject != null)
            {
                if (!viewEnabled)
                {
                    SetViewEnabled(true);
                }
            }
            else
            {
                // Expected when the functionality hasn't been implmented yet
                NotificationBar.Message($"View disabled: No object of type {typeof(T)} found.");
            }
        }
    }