private static bool DrawPlayerTemplateWithRemoveButton(PlayerTemplate playerTemplate, bool withRemoveButton) { EditorGUI.indentLevel++; playerTemplate.playerName = EditorGUILayout.TextField("Name", playerTemplate.playerName); SimpleGUI.DrawFoldout(playerTemplate, "More settings", () => { playerTemplate.avatarPrefab = SimpleGUI.ObjectField("Custom avatar", playerTemplate.avatarPrefab, false); playerTemplate.spawnPoint = SimpleGUI.ObjectField("Custom spawn point", playerTemplate.spawnPoint, true); playerTemplate.customId = EditorGUILayout.IntField("Custom id", playerTemplate.customId); }); GUILayout.BeginHorizontal(); GUILayout.Label("Has Vr"); playerTemplate.hasVr = EditorGUILayout.Toggle(playerTemplate.hasVr); GUILayout.Label("Join on start"); playerTemplate.joinByDefault = EditorGUILayout.Toggle(playerTemplate.joinByDefault); bool remove = false; if (withRemoveButton) { remove = GUILayout.Button("Remove"); } GUILayout.EndHorizontal(); EditorGUI.indentLevel--; return(remove); }
public static void DrawActiveRuntimePlayer(VRCEmulator emulator, SimulatedVRCPlayer player) { DrawRuntimePlayer(player); GUILayout.BeginHorizontal(); if (emulator.GetAmountOfPlayers() > 1) { SimpleGUI.ActionButton("Disconnect", () => emulator.RemovePlayer(player)); } if (!player.IsUsingVR()) { SimpleGUI.ActionButton("Make VR", player.PromoteToVRUser); } else { SimpleGUI.ActionButton("Make Desktop", player.DemoteToDesktopUser); } SimpleGUI.ActionButton("Make Master", () => emulator.MakeMaster(player)); SimpleGUI.ActionButton("Make Local", () => emulator.MakeLocal(player)); GUILayout.EndHorizontal(); SimpleGUI.DrawFoldout(player, "More settings", () => { AvatarChangeDialog(player); TagsDialog(player); }); }
private void OnGUI() { #if GOTOUDON_DEV ReleaseHelper.DrawReleaseHelper(); #endif #if GOTOUDON_SIMULATION_LEGACY UpdaterEditor.Instance.DrawVersionInformation(); ImplementationValidator.DrawValidationErrors(ImplementationValidator.ValidateEmulator()); SimpleGUI.WarningBox(true, "NETWORK AND VRCHAT PHYSICS ARE NOT SIMULATED, NETWORK RELATED SETTINGS ONLY AFFECT RETURNED VALUES IN SCRIPTS, DEFAULT UNITY PHYSICS APPLIES (might be improved later)"); _scroll = GUILayout.BeginScrollView(_scroll, GUIStyle.none); if (EditorApplication.isPlaying) { DrawPlayersEditor(); } else { DrawTemplatesEditor(); } #else _scroll = GUILayout.BeginScrollView(_scroll, GUIStyle.none); #endif if (GUILayout.Button( $"============ IMPORTANT ============\nFor emulation use CyanEmu instead: https://github.com/CyanLaser/CyanEmu", EditorStyles.helpBox)) { Application.OpenURL("https://github.com/CyanLaser/CyanEmu"); } if (SimpleGUI.DrawFoldout("Unsafe Simulation", "UNSAFE") && SimpleGUI.DrawFoldout("Unsafe Simulation", "VERY UNSAFE")) { if (!EditorApplication.isPlaying) { DrawGlobalOptions(GotoUdonSettings.Instance); } } SimpleGUI.DrawFooterInformation(); GUILayout.EndScrollView(); }
private void OnGUI() { #if GOTOUDON_DEV DrawReleaseHelper(); #endif UpdaterEditor.Instance.DrawVersionInformation(); _scroll = GUILayout.BeginScrollView(_scroll, GUIStyle.none); if (!Application.isPlaying) { VRCSdkControlPanel.InitAccount(); } _settings.Init(); SimpleGUI.DrawFoldout(this, "Help", () => { SimpleGUI.InfoBox(true, "Here you can prepare profiles (vrchat --profile=x option) and launch them at once and connect to given world.\n" + "Each profile can be logged in to other vrchat account, allowing you for simple testing.\n" + "You can also disable some profiles, this will just simply ignore them when using button to start all clients.\n" + "Keeping instance might cause issues on restart with multiple clients, vrchat servers might still think you are trying to join twice."); }); EditorGUI.BeginChangeCheck(); SimpleGUI.DrawFoldout(this, "Advanced settings", () => { SimpleGUI.WarningBox(string.IsNullOrWhiteSpace(_settings.WorldId), "Missing world. Make sure your world have a vrc world descriptor and you are logged in to SDK."); SimpleGUI.InfoBox(string.IsNullOrWhiteSpace(_settings.UserId), "Login to SDK and User ID field will fill up itself"); _settings.userId = EditorGUILayout.TextField("User ID", _settings.userId); SimpleGUI.InfoBox(string.IsNullOrWhiteSpace(_settings.gamePath), "This should be automatically filled from sdk, but if its not, point it to your vrchat.exe"); _settings.gamePath = EditorGUILayout.TextField("Game path", _settings.gamePath); _settings.launchOptions = EditorGUILayout.TextField("Launch options", _settings.launchOptions); _settings.localLaunchOptions = EditorGUILayout.TextField("Local launch options", _settings.localLaunchOptions); // _settings.sendInvitesOnUpdate = EditorGUILayout.Toggle("Send invites on world update", _settings.sendInvitesOnUpdate); _settings.accessType = (ApiWorldInstance.AccessType)EditorGUILayout.EnumPopup("Access Type", _settings.accessType); _keepInstanceForce = EditorGUILayout.Toggle("Force keep instance ID", _keepInstanceForce); if (_keepInstanceForce) { _keepInstance = true; } GUILayout.BeginHorizontal(); GUILayout.Label("Same room restart wait time (s)", GUILayout.Width(200)); _settings.sameInstanceRestartDelay = EditorGUILayout.IntField(_settings.sameInstanceRestartDelay, GUILayout.Width(30)); GUILayout.EndHorizontal(); }); SimpleGUI.SectionSpacing(); DrawClientSection(); SimpleGUI.SectionSpacing(); if (SimpleGUI.EndChangeCheck()) { EditorUtility.SetDirty(_settings); EditorUtility.SetDirty(GotoUdonInternalState.Instance); } SimpleGUI.DrawFooterInformation(); GUILayout.EndScrollView(); }