private void DrawGeneralSettings() { EditorGUILayout.BeginVertical(boxStyle_); showGeneralSettings_ = EditorGUILayout.Foldout(showGeneralSettings_, generalFoldoutGuiContent, true); if (showGeneralSettings_) { AddIndent(); if (settings_.enableCyanEmu && FindObjectOfType <VRC_SceneDescriptor>() == null) { EditorGUILayout.HelpBox("No VRC_SceneDescriptor in scene. Please add one to enable CyanEmu.", MessageType.Warning); } if (settings_.enableCyanEmu && Application.isPlaying && !CyanEmuMain.HasInstance()) { EditorGUILayout.HelpBox("Please exit and reenter play mode to enable CyanEmu!", MessageType.Warning); } settings_.enableCyanEmu = EditorGUILayout.Toggle(enableToggleGuiContent, settings_.enableCyanEmu); EditorGUI.BeginDisabledGroup(!settings_.enableCyanEmu); settings_.displayLogs = EditorGUILayout.Toggle(displayLogsToggleGuiContent, settings_.displayLogs); settings_.deleteEditorOnly = EditorGUILayout.Toggle(deleteEditorOnlyToggleGuiContent, settings_.deleteEditorOnly); RemoveIndent(); } EditorGUILayout.EndVertical(); }
private void DrawPlayerButtons() { EditorGUILayout.BeginVertical(boxStyle_); showPlayerButtons_ = EditorGUILayout.Foldout(showPlayerButtons_, playerButtonsFoldoutGuiContent, true); if (showPlayerButtons_) { AddIndent(); // custom name settings_.customLocalPlayerName = EditorGUILayout.TextField(localPlayerCustomNameGuiContent, settings_.customLocalPlayerName); settings_.isInstanceOwner = EditorGUILayout.Toggle(isInstanceOwnerGuiContent, settings_.isInstanceOwner); // TODO have setting for spawning players in the room before you EditorGUI.BeginDisabledGroup(!CyanEmuMain.HasInstance() || !Application.isPlaying); /* * EditorGUI.BeginDisabledGroup(CyanEmuPlayerController.instance != null); * * if (GUILayout.Button("Spawn Local Player")) * { * CyanEmuMain.SpawnPlayer(true); * } * * EditorGUI.EndDisabledGroup(); */ remotePlayerCustomName = EditorGUILayout.TextField(remotePlayerCustomNameGuiContent, remotePlayerCustomName); if (GUILayout.Button("Spawn Remote Player")) { CyanEmuMain.SpawnPlayer(false, remotePlayerCustomName); } List <VRCPlayerApi> playersToRemove = new List <VRCPlayerApi>(); if (Application.isPlaying) { foreach (var player in VRCPlayerApi.AllPlayers) { GUILayout.BeginHorizontal(); GUILayout.Label(player.displayName); GUILayout.Space(5); EditorGUI.BeginDisabledGroup(VRCPlayerApi.AllPlayers.Count == 1 || player.isLocal); if (GUILayout.Button("Remove Player")) { playersToRemove.Add(player); } EditorGUI.EndDisabledGroup(); GUILayout.EndHorizontal(); } for (int i = playersToRemove.Count - 1; i >= 0; --i) { CyanEmuMain.RemovePlayer(playersToRemove[i]); } playersToRemove.Clear(); } EditorGUI.EndDisabledGroup(); RemoveIndent(); } EditorGUILayout.EndVertical(); }