/// <summary> /// Create or update the main runtime profile with the appropriate value store. /// </summary> static void CreateOrUpdateMainRuntimeProfile() { if (!Application.isPlaying) { Debug.LogError("Cannot create main runtime profile when not playing."); return; } ValueStore currentStore = null; if (Instance.EditorSourceProfile != null) { currentStore = Instance.EditorSourceProfile.Store; } else if (Instance.PlayModeStore != null) { currentStore = Instance.PlayModeStore; } else { currentStore = Instance.store; } if (currentStore != null) { currentStore = currentStore.Clone(); } RuntimeProfile.CreateMain(currentStore); RuntimeProfile.Main.CleanStore(); }