Example #1
0
 void OnToggleActionTriggered(DCLAction_Trigger action)
 {
     if (view)
     {
         SetVisibility(!view.IsVisible());
         OnToggleTriggered?.Invoke();
     }
 }
Example #2
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;
    }