Exemple #1
0
        protected override void OnValidate()
        {
            base.OnValidate();

            if (CanValidate() == false)
            {
                return;
            }

            bButtonReference = GetComponent <BButton>();
            if (bButtonReference)
            {
                if (toBMenu)
                {
                    showToMenuReferenceNotSet = false;

                    if (overrideBButtonUIName == true)
                    {
                        bButtonReference.UIElementName = "B_ToM_" + toBMenu.UIElementName;
                    }
                }
                else
                {
                    showToMenuReferenceNotSet = true;
                    LogConsoleError(infoToMenuReferenceNotSet);
                }
            }
        }
Exemple #2
0
 private void On_BButton_ButtonPressed(BButton maleficusButton, bool cursorInsideButton)
 {
     if (cursorInsideButton == true)
     {
         Execute();
     }
 }
Exemple #3
0
 public void UnPopulateNavigationButtons()
 {
     LogConsole("Unpopulating buttons");
     LeftButton   = null;
     RightButton  = null;
     UpperButton  = null;
     BottomButton = null;
 }
Exemple #4
0
 private void On_ButtonReleased(BButton bButton, bool cursorOutside)
 {
     if ((cursorOutside == true) &&
         (IS_NOT_NULL(bButtonReference)) &&
         (IS_NOT_NULL(bButtonReference.ParentBFrame)))
     {
         bButtonReference.ParentBFrame.UpdateCurrentBMenu(toBMenu);
     }
 }
Exemple #5
0
        protected override void Awake()
        {
            base.Awake();

            bButton = GetComponent <BButton>();
            if (IS_NOT_NULL(bButton))
            {
                bButton.ButtonPressed += On_BButton_ButtonPressed;
            }
        }
Exemple #6
0
        protected override void InitializeComponents()
        {
            base.InitializeComponents();

            // Check Start Highlight BButton
            highlightedBButtonReference = startHighlightedBButton;
            //if (highlightedBButtonReference == null)
            //{
            //    LogConsoleError("No BButton selected as highlight!");
            //}
        }
Exemple #7
0
 public void OnBButtonHighlighted(BButton bButton)
 {
     if (IS_NOT_NULL(bButton))
     {
         if (bButton != highlightedBButtonReference)
         {
             if (highlightedBButtonReference)
             {
                 highlightedBButtonReference.OnUnhighlighted();
             }
             highlightedBButtonReference = bButton;
         }
     }
 }
Exemple #8
0
        protected override void OnValidate()
        {
            base.OnValidate();

            if (cameraRayCaster == null)
            {
                cameraRayCaster = FindObjectOfType <CameraRayCaster>();
            }

            if (bButton == null)
            {
                bButton = GetComponent <BButton>();
            }
        }
Exemple #9
0
        public void SetStartHighlightedBButton(BButton bButton)
        {
            if (IS_NOT_NULL(bButton))
            {
                if (highlightedBButtonReference)
                {
                    highlightedBButtonReference.OnUnhighlighted();
                }

                startHighlightedBButton     = bButton;
                highlightedBButtonReference = bButton;

                highlightedBButtonReference.OnHighlighted();
            }
        }
Exemple #10
0
        public void OnBecameActive()
        {
            IsActive = true;

            ShowUIElement();

            if (BEventsCollection.IsInstanceSet)
            {
                BEventsCollection.UI_HighlightedBMenuUpdated.Invoke(new BEHandle <BMenu>(this), MotherOfManagers.Instance.DebugUIButtonsEvents);
            }

            if (startHighlightedBButton)
            {
                startHighlightedBButton.OnHighlighted();
                highlightedBButtonReference = startHighlightedBButton;
            }
        }
Exemple #11
0
 private void On_BButton_ButtonPressed(BButton obj)
 {
     if (IS_NOT_NULL(bButton) &&
         IS_NOT_NULL(ARManager.Instance))
     {
         bool fixWorldRoot = ARManager.Instance.ToogleFixWorldRoot();
         if (fixWorldRoot)
         {
             bButton.SetButtonTextColor(fixedColor);
             bButton.SetButtonText("Root  Fixed");
         }
         else
         {
             bButton.SetButtonTextColor(freeColor);
             bButton.SetButtonText("Root  Free");
         }
     }
 }
Exemple #12
0
        protected override void OnValidate()
        {
            objectNamePrefix = "M_";

            base.OnValidate();

            if (CanValidate() == false)
            {
                return;
            }

            // Get all children BMenu
            childrenBButtons     = GetComponentsInChildren <BButton>();
            childrenBButtonsList = new List <BBMenuChildBButton>();
            foreach (BButton bButton in childrenBButtons)
            {
                childrenBButtonsList.Add(new BBMenuChildBButton(bButton, this));
            }


            // Check Start Highlight BMenu
            highlightedBButtonReference = null;
            if (startHighlightedBButton)
            {
                showNoStartButtonHighlight  = false;
                highlightedBButtonReference = startHighlightedBButton;
            }
            else
            {
                if ((childrenBButtons.Length > 0) &&
                    (childrenBButtons[0]))
                {
                    startHighlightedBButton     = childrenBButtons[0];
                    showNoStartButtonHighlight  = false;
                    highlightedBButtonReference = startHighlightedBButton;
                }
                else
                {
                    //LogConsole(infoNoStartBButtonHighlight);
                    showNoStartButtonHighlight = true;
                }
            }
        }
Exemple #13
0
        private void On_INPUT_ButtonPressed(BEHandle <EControllerID, EInputButton> eventHandle)
        {
            EInputButton inputButton = eventHandle.Arg2;

            if (CurrentBButtonHighlighted)
            {
                BButton nextButton = null;
                switch (inputButton)
                {
                case EInputButton.CONFIRM:
                    CurrentBButtonHighlighted.OnPressed();
                    canPressButton = true;
                    break;

                case EInputButton.LEFT:
                    nextButton = CurrentBButtonHighlighted.GetNextButton(EButtonDirection.LEFT);
                    break;

                case EInputButton.RIGHT:
                    nextButton = CurrentBButtonHighlighted.GetNextButton(EButtonDirection.RIGHT);
                    break;

                case EInputButton.UP:
                    nextButton = CurrentBButtonHighlighted.GetNextButton(EButtonDirection.UP);
                    break;

                case EInputButton.DOWN:
                    nextButton = CurrentBButtonHighlighted.GetNextButton(EButtonDirection.DOWN);
                    break;
                }

                // Update highlighted button
                if (nextButton != null)
                {
                    CurrentBButtonHighlighted.OnUnhighlighted();
                    CurrentBButtonHighlighted = nextButton;
                    nextButton.OnHighlighted();
                    canPressButton = false;
                }
            }
        }
Exemple #14
0
        public BButton GetNextButton(EButtonDirection buttonDirection)
        {
            BButton buttonToReturn = null;

            switch (buttonDirection)
            {
            case EButtonDirection.LEFT:
                buttonToReturn = leftButton;
                break;

            case EButtonDirection.RIGHT:
                buttonToReturn = rightButton;
                break;

            case EButtonDirection.UP:
                buttonToReturn = upperButton;
                break;

            case EButtonDirection.DOWN:
                buttonToReturn = buttomButton;
                break;
            }
            return(buttonToReturn);
        }
Exemple #15
0
 private void On_UI_ButtonHighlighted(BEHandle <BButton> bEHandle)
 {
     CurrentBButtonHighlighted = bEHandle.Arg1;
 }
Exemple #16
0
        protected override void InitializeComponents()
        {
            base.InitializeComponents();

            bButtonReference = GetComponent <BButton>();
        }
Exemple #17
0
 public BBMenuChildBButton(BButton bButton, BMenu bMenu)
 {
     childBButton   = bButton;
     bMenuReference = bMenu;
 }