private void OnGUISceneSettings(VRC_SceneDescriptor scene) { GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.BeginVertical(VRCSdkControlPanel.boxGuiStyle, GUILayout.Width(VRCSdkControlPanel.SdkWindowWidth)); string name = "Unpublished VRChat World"; if (scene.apiWorld != null) { name = (scene.apiWorld as Core.ApiWorld)?.name; } EditorGUILayout.Space(); EditorGUILayout.LabelField(name, VRCSdkControlPanel.titleGuiStyle); Core.PipelineManager[] pms = Tools.FindSceneObjectsOfTypeAll <Core.PipelineManager>(); if (pms.Length == 1) { if (!string.IsNullOrEmpty(pms[0].blueprintId)) { if (scene.apiWorld == null) { Core.ApiWorld world = Core.API.FromCacheOrNew <Core.ApiWorld>(pms[0].blueprintId); world.Fetch(null, null, (c) => scene.apiWorld = c.Model as Core.ApiWorld, (c) => { if (c.Code == 404) { Core.Logger.Log( $"Could not load world {pms[0].blueprintId} because it didn't exist.", Core.DebugLevel.All); Core.ApiCache.Invalidate <Core.ApiWorld>(pms[0].blueprintId); } else { Debug.LogErrorFormat("Could not load world {0} because {1}", pms[0].blueprintId, c.Error); } }); scene.apiWorld = world; } } else { // clear scene.apiWorld if blueprint ID has been detached, so world details in builder panel are also cleared scene.apiWorld = null; } } if (scene.apiWorld != null) { Core.ApiWorld w = (scene.apiWorld as Core.ApiWorld); DrawContentInfoForWorld(w); VRCSdkControlPanel.DrawContentPlatformSupport(w); } VRCSdkControlPanel.DrawBuildTargetSwitcher(); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); }
private static void DrawContentInfoForWorld(Core.ApiWorld w) { VRCSdkControlPanel.DrawContentInfo(w.name, w.version.ToString(), w.description, w.capacity.ToString(), w.releaseStatus, w.tags); }