Exemple #1
0
 /// <summary>
 /// Reset all the things to their default values
 /// </summary>
 public void ResetAll()
 {
     MapMasking?.Reset();
     NearClipPlane.Reset();
     FarClipPlane.Reset();
     ShadowDistance.Reset();
 }
Exemple #2
0
        /// <summary>
        /// Read the extended save data and set the values of SliderSet or ToggleSet which will set the UI elements and trigger the setter method
        /// </summary>
        protected override void OnSceneLoad(SceneOperationKind operation, ReadOnlyDictionary <int, ObjectCtrlInfo> loadedItems)
        {
            if (operation == SceneOperationKind.Load)
            {
                var data = GetExtendedData();
                if (data?.data == null)
                {
                    ResetAll();
                }
                else
                {
                    if (data.data.TryGetValue("MapMasking", out var mapMasking) && mapMasking != null)
                    {
                        MapMasking.Value = (bool)mapMasking;
                    }
                    else
                    {
                        MapMasking.Reset();
                    }

                    if (data.data.TryGetValue("NearClipPlane", out var nearClipPlane) && nearClipPlane != null && (float)nearClipPlane != 0f)
                    {
                        NearClipPlane.Value = (float)nearClipPlane;
                    }
                    else
                    {
                        NearClipPlane.Reset();
                    }

                    if (data.data.TryGetValue("FarClipPlane", out var farClipPlane) && farClipPlane != null && (float)farClipPlane != 0f)
                    {
                        FarClipPlane.Value = (float)farClipPlane;
                    }
                    else
                    {
                        FarClipPlane.Reset();
                    }

                    if (data.data.TryGetValue("ShadowDistance", out var shadowDistance) && shadowDistance != null && (float)shadowDistance != 0f)
                    {
                        ShadowDistance.Value = (float)shadowDistance;
                    }
                    else
                    {
                        ShadowDistance.Reset();
                    }
                }
            }
            else if (operation == SceneOperationKind.Clear)
            {
                ResetAll();
            }
            //Do not import saved data, keep current settings
        }
Exemple #3
0
 /// <summary>
 /// Reset all the things to their default values
 /// </summary>
 public void ResetAll()
 {
     MapMasking?.Reset();
     NearClipPlane.Reset();
     FarClipPlane.Reset();
 }