VisualElement GenerateTriggerSection(List <string> triggerIdList) { var triggerSection = EditorUIGenerator.GenerateSection(); triggerSection.Add(EditorUIGenerator.GenerateLabel(LabelType.h1, "トリガー")); //一般用トリガーとスタッフ向けトリガーにリストを分離 var audienceTriggerList = triggerIdList.Where(x => x.StartsWith("@")).ToList(); var staffTriggerList = triggerIdList.Where(x => !x.StartsWith("@")).ToList(); if (audienceTriggerList.Count != 0) { triggerSection.Add(GenerateTriggerSender(audienceTriggerList, "一般参加者向けトリガー")); } if (staffTriggerList.Count != 0) { triggerSection.Add(GenerateTriggerSender(staffTriggerList, "スタッフ向けトリガー")); } triggerSection.Add(EditorUIGenerator.GenerateLabel(LabelType.h2, "Jsonからトリガーを発火")); Button openTriggerFromJsonWindowButton = new Button(PreviewTriggerFromJsonWindow.Show); openTriggerFromJsonWindowButton.text = "開く"; triggerSection.Add(openTriggerFromJsonWindowButton); return(triggerSection); }
VisualElement GenerateTriggersSection() { triggersRoot = EditorUIGenerator.GenerateSection(); UpdateTriggerButtons(trigger); triggersRoot.SetEnabled(Application.isPlaying); return(triggersRoot); }
VisualElement GenerateMainScreenSection() { var mainScreenSection = EditorUIGenerator.GenerateSection(); mainScreenSection.Add(EditorUIGenerator.GenerateLabel(LabelType.h1, "メインスクリーン")); Button sampleImageSendButton = new Button(ShowMainScreenPicture); sampleImageSendButton.text = "サンプル画像を投影"; mainScreenSection.Add(sampleImageSendButton); return(mainScreenSection); }
VisualElement GenerateControlSection() { var controlSection = EditorUIGenerator.GenerateSection(); var loadJsonButton = new Button(LoadJsonTrigger) { text = "JSONを読み込む" }; controlSection.Add(loadJsonButton); return(controlSection); }
VisualElement GenerateUserDataSection() { var userDataSection = EditorUIGenerator.GenerateSection(); userDataSection.Add(EditorUIGenerator.GenerateLabel(LabelType.h1, "プレイヤー情報")); userDataSection.Add(EditorUIGenerator.GenerateLabel(LabelType.h2, "権限")); var currentPermission = EditorUIGenerator.GenerateLabel(LabelType.h2, "現在の権限:参加者"); Button permissionChangeButton = new Button(() => { if (!Bootstrap.IsInGameMode) { Debug.LogWarning(messageWhenNotPlayMode); return; } if (Bootstrap.PlayerPresenter.PermissionType == PermissionType.Audience) { Bootstrap.PlayerPresenter.ChangePermissionType(PermissionType.Performer); currentPermission.text = "現在の権限:パフォーマー"; } else { Bootstrap.PlayerPresenter.ChangePermissionType(PermissionType.Audience); currentPermission.text = "現在の権限:参加者"; } }); permissionChangeButton.text = "権限変更"; userDataSection.Add(currentPermission); userDataSection.Add(permissionChangeButton); userDataSection.Add(EditorUIGenerator.GenerateLabel(LabelType.h2, "リスポーン")); Button respawnButton = new Button(() => { Bootstrap.SpawnPointManager.Respawn(Bootstrap.PlayerPresenter.PermissionType, Bootstrap.PlayerPresenter.PlayerTransform, Bootstrap.PlayerPresenter.CameraTransform); }); respawnButton.text = "リスポーンする"; userDataSection.Add(respawnButton); return(userDataSection); }
VisualElement GenerateCommentSection() { var commentSection = EditorUIGenerator.GenerateSection(); commentSection.Add(EditorUIGenerator.GenerateLabel(LabelType.h1, "コメント")); commentSection.Add(EditorUIGenerator.GenerateLabel(LabelType.h2, "表示名")); TextField displayNameField = new TextField(); commentSection.Add(displayNameField); commentSection.Add(EditorUIGenerator.GenerateLabel(LabelType.h2, "ユーザー名")); TextField userNameField = new TextField(); commentSection.Add(userNameField); commentSection.Add(EditorUIGenerator.GenerateLabel(LabelType.h2, "コメント内容")); TextField commentContentField = new TextField(); commentContentField.style.unityTextAlign = TextAnchor.UpperLeft; commentContentField.multiline = true; commentContentField.style.height = 50; foreach (var child in commentContentField.Children()) { child.style.unityTextAlign = TextAnchor.UpperLeft; } commentSection.Add(commentContentField); Button commentSendButton = new Button(() => { SendComment(displayNameField.value, userNameField.value, commentContentField.value); displayNameField.value = ""; userNameField.value = ""; commentContentField.value = ""; }); commentSendButton.text = "コメントを送信"; commentSection.Add(commentSendButton); return(commentSection); }