protected override void OnSceneLoad(SceneOperationKind operation, ReadOnlyDictionary <int, ObjectCtrlInfo> loadedItems) { if (operation == SceneOperationKind.Load) { var data = GetExtendedData(); if (data?.data == null) { ResetAll(); } else { #if KK if (data.data.TryGetValue("MapMasking", out var mapMasking) && mapMasking != null) { MapMasking.Value = (bool)mapMasking; } else { MapMasking.Reset(); } #endif 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(); } } } else if (operation == SceneOperationKind.Clear) { ResetAll(); } else //Do not import saved data, keep current settings { return; } }
/// <summary> /// Reset all the things to their default values /// </summary> public void ResetAll() { MapMasking?.Reset(); NearClipPlane.Reset(); FarClipPlane.Reset(); }