Esempio n. 1
0
        void OnDestroy()
        {
            try
            {
                if (_currentSkin != null)
                {
                    _currentSkin.Rollback();
                }

                _currentSkin = null;

                if (_quartzPanel != null)
                {
                    Debug.Log("Unload Quartz Panel");
                    Destroy(_quartzPanel);
                }

                if (_quartzButton != null)
                {
                    Debug.Log("Unload Quartz Button");
                    Destroy(_quartzButton);
                }

                SetCameraRectHelper.Deinitialize();

                _bootstrapped = false;
            }
            catch (Exception ex)
            {
                Debug.LogException(ex);
            }
        }
Esempio n. 2
0
        public void Rollback()
        {
            if (!isValid)
            {
                Debug.LogWarning("Trying to roll-back an invalid skin");
                return;
            }

            _applicator.Rollback();
            SetCameraRectHelper.ResetCameraRect();
        }
Esempio n. 3
0
        void Start()
        {
            Debug.Log("Start ran!");
            if (!MyInfo().isEnabled)
            {
                Deinitialize();
                return;
            }
            SetCameraRectHelper.Initialize();

            if (!Directory.Exists(OverrideDirectory))
            {
                try
                {
                    Directory.CreateDirectory(OverrideDirectory);
                }
                catch (Exception ex)
                {
                    Debug.LogException(ex);
                }
            }

            InitializeInGamePanels();

            _availableSkins = SkinLoader.FindAllSkins();

            if (!string.IsNullOrEmpty(ConfigManager.SelectedSkinPath) && ConfigManager.ApplySkinOnStartup)
            {
                foreach (var metadata in _availableSkins)
                {
                    if (metadata.Path == ConfigManager.SelectedSkinPath)
                    {
                        _currentSkin            = Skin.FromXmlFile(Path.Combine(metadata.Path, "skin.xml"), false);
                        _needToApplyCurrentSkin = true;
                        break;
                    }
                }
            }

            CreateUI();

            _debugRenderer = gameObject.AddComponent <DebugRenderer>();
        }