private void DisplayUnityEditorTab() { if (!IssuesUtility.HasEditorIssues()) { return; } EditorGUIHelper.DrawTitleFoldout("Unity Editor", ref _showEditor, () => { EditorGUI.indentLevel++; EditorGUIHelper.DrawSpritedLabel("Ensure you are using Unity 2019.1.10f1 as your development environment", ErrorTexture, GUILayout.MaxWidth(16), GUILayout.MaxHeight(16)); GUILayout.Space(EditorGUIUtility.singleLineHeight); EditorGUI.indentLevel--; }); }
private void DisplayRenderingTab() { if (!IssuesUtility.HasRenderingIssues()) { return; } EditorGUIHelper.DrawTitleFoldout("Rendering", ref _showRendering, () => { EditorGUI.indentLevel++; if (!PlayerSettings.virtualRealitySupported) { EditorGUILayout.BeginHorizontal(); EditorGUIHelper.DrawSpritedLabel("Virtual Reality Must Be Supported", ErrorTexture, GUILayout.MaxWidth(16), GUILayout.MaxHeight(16)); if (GUILayout.Button("Enable VR Support")) { PlayerSettings.virtualRealitySupported = true; } EditorGUILayout.EndHorizontal(); GUILayout.Space(EditorGUIUtility.singleLineHeight); EditorGUI.indentLevel--; } if (PlayerSettings.stereoRenderingPath != StereoRenderingPath.SinglePass) { EditorGUILayout.BeginHorizontal(); EditorGUIHelper.DrawSpritedLabel("Stereo Rendering Mode Must be Set To Single Pass", ErrorTexture, GUILayout.MaxWidth(16), GUILayout.MaxHeight(16)); if (GUILayout.Button("Set To Single Pass")) { PlayerSettings.stereoRenderingPath = StereoRenderingPath.SinglePass; } EditorGUILayout.EndHorizontal(); GUILayout.Space(EditorGUIUtility.singleLineHeight); EditorGUI.indentLevel--; } EditorGUI.indentLevel--; }); }
public override void Draw(BuildWindowConfig config) { EditorGUILayout.BeginVertical("Box"); { EditorGUIHelper.DrawTitle("Build Limapp"); EditorGUILayout.LabelField("This process will build a limapp file that will run on the Liminal Platform"); EditorGUILayout.TextArea("", GUI.skin.horizontalSlider); GUILayout.Space(10); DrawSceneSelector(ref _scenePath, "Target Scene", config); config.TargetScene = _scenePath; EditorGUILayout.Space(); _selectedPlatform = config.SelectedPlatform; _selectedPlatform = (BuildPlatform)EditorGUILayout.EnumPopup("Select Platform", _selectedPlatform); config.SelectedPlatform = _selectedPlatform; _compressionType = config.CompressionType; _compressionType = (ECompressionType)EditorGUILayout.EnumPopup("Compression Format", _compressionType); config.CompressionType = _compressionType; if (_compressionType == ECompressionType.Uncompressed) { EditorGUILayout.LabelField("Uncompressed limapps are not valid for release.", EditorStyles.boldLabel); } GUILayout.Space(EditorGUIUtility.singleLineHeight); EditorGUILayout.LabelField("Additional References"); EditorGUI.indentLevel++; var toRemove = new List <string>(); foreach (var reference in config.AdditionalReferences) { GUILayout.BeginHorizontal(); { EditorGUILayout.LabelField(reference); if (GUILayout.Button("X")) { toRemove.Add(reference); } } GUILayout.EndHorizontal(); } foreach (var reference in toRemove) { config.AdditionalReferences.Remove(reference); } GUILayout.BeginHorizontal(); { _referenceInput = EditorGUILayout.TextField("Reference: ", _referenceInput); if (GUILayout.Button("+")) { if (string.IsNullOrEmpty(_referenceInput)) { return; } if (config.DefaultAdditionalReferences.Contains(_referenceInput)) { Debug.Log($"The default references already included {_referenceInput}"); return; } var refAsm = Assembly.Load(_referenceInput); if (refAsm == null) { Debug.LogError($"Assembly: {_referenceInput} does not exist."); return; } if (!config.AdditionalReferences.Contains(_referenceInput)) { config.AdditionalReferences.Add(_referenceInput); } _referenceInput = ""; } } GUILayout.EndHorizontal(); EditorGUI.indentLevel--; GUILayout.FlexibleSpace(); var enabled = !_scenePath.Equals(string.Empty); if (!enabled) { GUILayout.Label("Scene cannot be empty", "CN StatusWarn"); } GUI.enabled = !EditorApplication.isCompiling; if (GUILayout.Button("Build")) { //run checks here. IssuesUtility.CheckForAllIssues(); var hasBuildIssues = EditorPrefs.GetBool("HasBuildIssues"); if (hasBuildIssues) { if (EditorUtility.DisplayDialog("Build Issues Detected", "Outstanding issues have been detected in your project. " + "Navigate to Build Settings->Issues for help resolving them", "Build Anyway", "Cancel Build")) { Build(); } } else { Build(); } } EditorGUILayout.EndVertical(); } }
private static void ScriptsCompiled() { _currentAssemblies = AppDomain.CurrentDomain.GetAssemblies().ToList(); IssuesUtility.CheckForForbiddenCalls("Library/ScriptAssemblies/Assembly-CSharp.dll", ref _forbiddenCallsAndScripts); }
private void DisplayVRAvatarTab() { VRAvatar avatar = null; foreach (var item in _sceneGameObjects) { if (item.GetComponentInChildren <VRAvatar>()) { avatar = item.GetComponentInChildren <VRAvatar>(); break; } } if (!IssuesUtility.HasAvatarIssues(avatar)) { return; } EditorGUIHelper.DrawTitleFoldout("VR Avatar", ref _showVRAvatar, () => { EditorGUI.indentLevel++; if (avatar == null) { EditorGUIHelper.DrawSpritedLabel("Scene Must Contain A VR Avatar", ErrorTexture, GUILayout.MaxWidth(16), GUILayout.MaxHeight(16)); GUILayout.Space(EditorGUIUtility.singleLineHeight); EditorGUI.indentLevel--; return; } IssuesUtility.CheckEyes(avatar, out var eyePosWrong, out var eyeRotWrong, out var eyes); if (avatar.Head.Transform.localEulerAngles != Vector3.zero) { EditorGUILayout.BeginHorizontal(); EditorGUIHelper.DrawSpritedLabel("VR Avatar Head rotation must be Zeroed", ErrorTexture, GUILayout.MaxWidth(16), GUILayout.MaxHeight(16)); if (GUILayout.Button("Reset Head Rotation")) { avatar.Head.Transform.localEulerAngles = Vector3.zero; } EditorGUILayout.EndHorizontal(); } if (avatar.Head.Transform.localPosition != new Vector3(0, 1.7f, 0)) { EditorGUILayout.BeginHorizontal(); EditorGUIHelper.DrawSpritedLabel("VR Avatar Head postion should be (0, 1.7f, 0)", ErrorTexture, GUILayout.MaxWidth(16), GUILayout.MaxHeight(16)); if (GUILayout.Button("Reset Head Position")) { avatar.Head.Transform.localPosition = new Vector3(0, 1.7f, 0); } EditorGUILayout.EndHorizontal(); } if (eyePosWrong || eyeRotWrong) { if (eyeRotWrong) { EditorGUILayout.BeginHorizontal(); EditorGUIHelper.DrawSpritedLabel("Eye Local Rotation Must be Zeroed", ErrorTexture, GUILayout.MaxWidth(16), GUILayout.MaxHeight(16)); if (GUILayout.Button("Reset Eye Rotation")) { eyes.ForEach(x => x.transform.localEulerAngles = Vector3.zero); } EditorGUILayout.EndHorizontal(); } if (eyePosWrong) { EditorGUILayout.BeginHorizontal(); EditorGUIHelper.DrawSpritedLabel("Eye Local Position Must be Zeroed", ErrorTexture, GUILayout.MaxWidth(16), GUILayout.MaxHeight(16)); if (GUILayout.Button("Reset Eye Position")) { eyes.ForEach(x => x.transform.localPosition = Vector3.zero); } EditorGUILayout.EndHorizontal(); } GUILayout.Space(EditorGUIUtility.singleLineHeight); } EditorGUI.indentLevel--; });