Esempio n. 1
0
        public IEnumerator Toggle()
        {
            InputAction_Trigger action = null;
            var inputController        = GameObject.FindObjectOfType <InputController>();

            for (int i = 0; i < inputController.triggerTimeActions.Length; i++)
            {
                // Find the open nav map action used by the input controller
                if (inputController.triggerTimeActions[i].GetDCLAction() == DCLAction_Trigger.ToggleNavMap)
                {
                    action = inputController.triggerTimeActions[i];
                    break;
                }
            }

            Assert.IsNotNull(action);

            action.RaiseOnTriggered();

            yield return(null);

            Assert.IsTrue(navmapView.scrollRect.gameObject.activeSelf);

            action.RaiseOnTriggered();

            yield return(null);

            Assert.IsFalse(navmapView.scrollRect.gameObject.activeSelf);
        }
Esempio n. 2
0
    void OnJumpIn(Vector2Int coords, string serverName, string layerName)
    {
        if (view.IsVisible())
        {
            toggleExploreTrigger.RaiseOnTriggered();
        }

        if (string.IsNullOrEmpty(serverName) || string.IsNullOrEmpty(layerName))
        {
            WebInterface.GoTo(coords.x, coords.y);
        }
        else
        {
            WebInterface.JumpIn(coords.x, coords.y, serverName, layerName);
        }
    }
    internal void ActivateControlsButton()
    {
        controlsButton.gameObject.SetActive(true);

        controlsButton.mainButton.onClick.AddListener(() =>
        {
            controlsToggleAction.RaiseOnTriggered();
            view.moreButton.SetToggleState(false);
        });
    }
Esempio n. 4
0
    public ExploreHUDController()
    {
        view      = UnityEngine.Object.Instantiate(Resources.Load <GameObject>("ExploreHUD")).GetComponent <ExploreHUDView>();
        view.name = "_ExploreHUD";
        view.popup.gameObject.SetActive(false);

        toggleExploreTrigger              = Resources.Load <InputAction_Trigger>("ToggleExploreHud");
        toggleExploreTrigger.OnTriggered += OnToggleActionTriggered;

        view.OnCloseButtonPressed += () =>
        {
            if (view.IsVisible())
            {
                toggleExploreTrigger.RaiseOnTriggered();
            }
        };

        view.gotoMagicButton.OnGotoMagicPressed += GoToMagic;
        view.togglePopupButton.onPointerDown    += () => toggleExploreTrigger.RaiseOnTriggered();
        HotSceneCellView.OnJumpIn += OnJumpIn;
    }
Esempio n. 5
0
 public void Have_WasTriggeredThisFrame_On_AfterRaisingInTheSameFrame()
 {
     action.RaiseOnTriggered();
     Assert.True(action.WasTriggeredThisFrame());
 }