예제 #1
0
        public static bool TryReloadConfiguratorState()
        {
            if (_jsonLoader.TryLoadConfiguratorState(out var state))
            {
                ConfiguratorState = state;
                return(true);
            }

            return(false);
        }
예제 #2
0
        public static bool TryReloadConfiguratorState()
        {
            MaterialColorState state;

            if (!_jsonLoader.TryLoadConfiguratorState(out state))
            {
                return(false);
            }
            ConfiguratorState = state;

            return(true);
        }
예제 #3
0
        private bool TryLoadLastAppState()
        {
            var result = true;

            try
            {
                MaterialState = _stateManager.LoadMaterialColorState();
            }
            catch (Exception e)
            {
                Status = "Can't load last material state";

                _logger.Log(e);

                MaterialState = new MaterialColorState();

                result = false;
            }

            try
            {
                OnionState = _stateManager.LoadOnionState();
            }
            catch (Exception e)
            {
                Status = "Can't load last onion state";

                _logger.Log(e);

                OnionState = new OnionState();

                result = false;
            }

            try
            {
                TemperatureOverlayState = _stateManager.LoadTemperatureState();
            }
            catch (Exception e)
            {
                Status = "Can't load last temperature overlay state";

                _logger.Log(e);

                TemperatureOverlayState = new TemperatureOverlayState();

                result = false;
            }

            return(result);
        }
예제 #4
0
        public bool TryLoadConfiguratorState(out MaterialColorState state)
        {
            try
            {
                state = this._configuratorStateManager.LoadMaterialColorState();
                return(true);
            }
            catch (Exception ex)
            {
                const string Message = "Can't load configurator state.";

                this._logger.Log(ex);
                this._logger.Log(Message);

                Debug.LogError(Message);

                state = new MaterialColorState();

                return(false);
            }
        }
예제 #5
0
 public void SaveMaterialColorState(MaterialColorState state)
 {
     this._manager.Serialize(state, Paths.MaterialColorStatePath);
 }