Example #1
0
        /// <summary>
        /// This method should be used only on deserialization step to restore parent model relationship
        /// </summary>
        /// <param name="model"></param>
        /// <exception cref="ArgumentNullException"></exception>
        private void SetParentModel(VoxelModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            VoxelModel = model;

            // init the cached state, cached state should have the same structure as parent model states
            SetState(model.GetMainState());
        }
Example #2
0
 /// <summary>
 /// Call this method when the parent model has changed parts count (Editor use case)
 /// </summary>
 public void UpdateStates()
 {
     SetState(VoxelModel.GetMainState());
 }