Exemplo n.º 1
0
        private void Start()
        {
            _menuParent = GetComponentInChildren <ToolPanel>(true) as ToolPanel;

            GGVMenuTextComponents = _menuParent.GetComponentsInChildren <TextMeshPro>(true);

            SetVisibleTextLabels(false);
            GalaxyExplorerManager.Instance.GeFadeManager.OnFadeComplete += OnFadeComplete;

            RaiseButton.SetActive(false);
            _resetButton.SetActive(false);
            _backButton.SetActive(false);

            SetMenuAvailability(false, false, false);
            ToolsVisible = false;

            // Store the x value of the local position for the back button when all menu buttons are visible
            _fullMenuVisibleBackButtonX = _backButton.transform.localPosition.x;

            // Since reset is not visible during most of the app states, regard its local position as the default back button local position
            _defaultBackButtonLocalPosition = _resetButton.transform.localPosition;

            // Since the app starts with reset button not visible, move the back button to its spot instead
            _backButton.transform.localPosition = _defaultBackButtonLocalPosition;
        }
Exemplo n.º 2
0
        private void SetVisibleTextLabels(bool isVisible)
        {
            if (GGVMenuTextComponents == null)
            {
                _menuParent = GetComponentInChildren <ToolPanel>(true) as ToolPanel;

                GGVMenuTextComponents = _menuParent.GetComponentsInChildren <TextMeshPro>(true);

                if (GGVMenuTextComponents == null)
                {
                    Debug.LogWarning("GGVMenuTextComponents not found");
                    return;
                }
            }

            foreach (TextMeshPro text in GGVMenuTextComponents)
            {
                text.enabled = isVisible;
            }
        }