Пример #1
0
        private void OnDisable()
        {
            try
            {
                if (!Mopc)
                {
                    Mopc = GetComponentInParent <ModOptionPanelController>();
                }

                if (!Mopc.initialized)
                {
                    return;
                }

                if (_genericDescriptionPanel)
                {
                    _genericDescriptionPanel.SetActive(true);
                }

                Mopc.UnLoad();
            }
            catch
            {
                // ignored
            }
        }
Пример #2
0
        private void OnEnable()
        {
            if (!GetComponentInParent <ModOptionPanelController>().initialized)
            {
                return;
            }

            if (!_mopc)
            {
                _mopc = GetComponentInParent <ModOptionPanelController>();
            }

            HGHeaderNavigationController navigationController = GetComponent <HGHeaderNavigationController>();

            navigationController.headerHighlightObject.transform.SetParent(transform);
            navigationController.headerHighlightObject.SetActive(false);

            if (navigationController.currentHeaderIndex >= 0)
            {
                navigationController.headers[navigationController.currentHeaderIndex].headerButton.interactable = true;
            }
        }
        protected override void Start()
        {
            base.Start();

            if (nameLabel)
            {
                nameLabel.token = token;
            }

            if (!Mopc)
            {
                Mopc = GetComponentInParent <ModOptionPanelController>();
            }

            //_icon = GetComponentInChildren<UnityEngine.UI.Image>();

            onClick.AddListener(delegate
            {
                navigationController.ChooseHeaderByButton(this);

                Mopc.LoadModOptionsFromOptionCollection(modGuid);
            });
        }