예제 #1
0
 void OnDisable()
 {
     if (_root != null)
     {
         _root.Dispose();
         _root = null;
     }
 }
예제 #2
0
        void OnErrorOccurred(Exception e)
        {
            Log.ErrorException(e);

            // If we are continually getting errors every frame then just give up completely
            // To avoid freezing the unity editor
            if (_consecutiveUpdateErrorCount > 5 || _consecutiveGuiErrorCount > 5)
            {
                _root = null;
                // Try again next assembly reload
                _hasInitialized = false;
            }

            // If a one-off error occurred that doesn't repeat, display it as a popup
            if (_root != null)
            {
                _root.DisplayError(e);
            }
        }
예제 #3
0
        void Initialize()
        {
            bool isFirstLoad = false;

            if (!_hasInitialized)
            {
                isFirstLoad = true;

                _model     = new PmModel();
                _viewModel = new PmView.Model();

                for (int i = 0; i < (int)DragListTypes.Count; i++)
                {
                    _viewModel.ListModels.Add(new DragList.Model());
                }
            }

            _root = new PmCompositionRoot(_model, _viewModel, isFirstLoad);
            _root.Initialize();

            // Put the _hasInitialized here so that if it fails to initialize it will try again next assembly reload
            // Otherwise it might serialize half-initialized data
            _hasInitialized = true;
        }
예제 #4
0
        void OnEnable()
        {
            bool isFirstLoad = false;

            if (!_hasInitialized)
            {
                _hasInitialized = true;
                isFirstLoad = true;

                Assert.IsNull(_model);
                Assert.IsNull(_viewModel);

                _model = new PmModel();
                _viewModel = new PmView.Model();

                for (int i = 0; i < (int)DragListTypes.Count; i++)
                {
                    _viewModel.ListModels.Add(new DragList.Model());
                }
            }

            _root = new PmCompositionRoot(_model, _viewModel, isFirstLoad);
            _root.Initialize();
        }
예제 #5
0
        void OnEnable()
        {
            bool isFirstLoad = false;

            if (!_hasInitialized)
            {
                _hasInitialized = true;
                isFirstLoad     = true;

                Assert.IsNull(_model);
                Assert.IsNull(_viewModel);

                _model     = new PmModel();
                _viewModel = new PmView.Model();

                for (int i = 0; i < (int)DragListTypes.Count; i++)
                {
                    _viewModel.ListModels.Add(new DragList.Model());
                }
            }

            _root = new PmCompositionRoot(_model, _viewModel, isFirstLoad);
            _root.Initialize();
        }
예제 #6
0
        void OnErrorOccurred(Exception e)
        {
            Log.ErrorException(e);

            // If we are continually getting errors every frame then just give up completely
            // To avoid freezing the unity editor
            if (_consecutiveUpdateErrorCount > 5 || _consecutiveGuiErrorCount > 5)
            {
                _root = null;
                // Try again next assembly reload
                _hasInitialized = false;
            }

            // If a one-off error occurred that doesn't repeat, display it as a popup
            if (_root != null)
            {
                _root.DisplayError(e);
            }
        }
예제 #7
0
 void OnDisable()
 {
     if (_root != null)
     {
         _root.Dispose();
         _root = null;
     }
 }
예제 #8
0
        void Initialize()
        {
            bool isFirstLoad = false;

            if (!_hasInitialized)
            {
                isFirstLoad = true;

                _model = new PmModel();
                _viewModel = new PmView.Model();

                for (int i = 0; i < (int)DragListTypes.Count; i++)
                {
                    _viewModel.ListModels.Add(new DragList.Model());
                }
            }

            _root = new PmCompositionRoot(_model, _viewModel, isFirstLoad);
            _root.Initialize();

            // Put the _hasInitialized here so that if it fails to initialize it will try again next assembly reload
            // Otherwise it might serialize half-initialized data
            _hasInitialized = true;
        }
예제 #9
0
 void OnDisable()
 {
     Assert.IsNotNull(_root);
     _root.Dispose();
     _root = null;
 }
예제 #10
0
 void OnDisable()
 {
     Assert.IsNotNull(_root);
     _root.Dispose();
     _root = null;
 }