void OnGUI() { GUILayout.BeginVertical(); //绘制标题 GUILayout.Space(10); GUI.skin.label.fontSize = 24; GUI.skin.label.fontStyle = FontStyle.Bold; GUI.skin.label.alignment = TextAnchor.MiddleCenter;//居中 //GUIContent uIContent = new GUIContent("xxx", texture, "sss"); //EditorGUILayout.LabelField(uIContent); //texture = EditorGUILayout.ObjectField("",texture, typeof(Texture), true) as Texture; GUILayout.Label(texture); GUILayout.Label("向 阳 的 黑 小 孩"); GUILayout.Space(8); GUI.skin.textField.fontSize = 10; GUI.skin.textField.fontStyle = FontStyle.Normal; GUI.skin.textField.alignment = TextAnchor.MiddleCenter;// GUILayout.Space(10); ScenesName = EditorGUILayout.TextField("场景名称:", ScenesName); GUILayout.Space(10); //GUILayout.Space(90); if (GUILayout.Button("确认创建!")) { try { if (ScenesName == "") { Debug.LogError("亲,给你的场景起个名字吧!"); this.ShowNotification(new GUIContent("失败 + 1")); return; } if (!ZXTK_Implement.CreatSceneOfVR(ScenesName)) { this.ShowNotification(new GUIContent("失败 + 1")); return; } this.ShowNotification(new GUIContent("创建《" + ScenesName + "》,成功 + 1")); } catch (System.Exception) { throw; } finally { GUI.skin.label.fontSize = 23; GUI.skin.label.fontStyle = FontStyle.Normal; } } if (!Error.Equals("")) { this.ShowNotification(new GUIContent(Error)); } }
private static void CreateBasicFolder() { ZXTK_Implement.GenerateFolder(); }
private static void AddVRcomponent() { ZXTK_Implement.CreatePrefabOfVR(); EditorSceneManager.SaveScene(UnityEngine.SceneManagement.SceneManager.GetActiveScene()); Debug.Log("已为当前场景添加VR环境!"); }