static Constants() { PackageImportTreeView.PackageImportTreeViewGUI.Constants.folderIcon = EditorGUIUtility.FindTexture(EditorResourcesUtility.folderIconName); PackageImportTreeView.PackageImportTreeViewGUI.Constants.badgeNew = EditorGUIUtility.IconContent("AS Badge New", "|This is a new Asset"); PackageImportTreeView.PackageImportTreeViewGUI.Constants.badgeDelete = EditorGUIUtility.IconContent("AS Badge Delete", "|These files will be deleted!"); PackageImportTreeView.PackageImportTreeViewGUI.Constants.badgeWarn = EditorGUIUtility.IconContent("console.warnicon", "|Warning: File exists in project, but with different GUID. Will override existing asset which may be undesired."); PackageImportTreeView.PackageImportTreeViewGUI.Constants.badgeChange = EditorGUIUtility.IconContent("playLoopOff", "|This file is new or has changed."); PackageImportTreeView.PackageImportTreeViewGUI.Constants.paddinglessStyle = new GUIStyle(); PackageImportTreeView.PackageImportTreeViewGUI.Constants.paddinglessStyle.padding = new RectOffset(0, 0, 0, 0); }
// Create a folder public static void CreateFolder() { StartNameEditingIfProjectWindowExists(0, ScriptableObject.CreateInstance <DoCreateFolder>(), "New Folder", EditorGUIUtility.IconContent(EditorResources.emptyFolderIconName).image as Texture2D, null); }
public static System.Type SearchBar(params System.Type[] types) { if (SceneModeUtility.s_NoneButtonContent == null) { SceneModeUtility.s_NoneButtonContent = EditorGUIUtility.IconContent("sv_icon_none"); SceneModeUtility.s_NoneButtonContent.text = "None"; } if (SceneModeUtility.s_FocusType != null && ((UnityEngine.Object)SceneModeUtility.s_HierarchyWindow == (UnityEngine.Object)null || SceneModeUtility.s_HierarchyWindow.m_SearchFilter != "t:" + SceneModeUtility.s_FocusType.Name)) { SceneModeUtility.s_FocusType = (System.Type)null; } GUILayout.Label("Scene Filter:"); EditorGUILayout.BeginHorizontal(); if (SceneModeUtility.TypeButton(EditorGUIUtility.TempContent("All", (Texture)AssetPreview.GetMiniTypeThumbnail(typeof(GameObject))), SceneModeUtility.s_FocusType == null, SceneModeUtility.styles.typeButton)) { SceneModeUtility.SearchForType((System.Type)null); } for (int index = 0; index < types.Length; ++index) { System.Type type = types[index]; Texture2D texture2D = type != typeof(Renderer) ? (type != typeof(Terrain) ? AssetPreview.GetMiniTypeThumbnail(type) : EditorGUIUtility.IconContent("Terrain Icon").image as Texture2D) : EditorGUIUtility.IconContent("MeshRenderer Icon").image as Texture2D; if (SceneModeUtility.TypeButton(EditorGUIUtility.TempContent(ObjectNames.NicifyVariableName(type.Name) + "s", (Texture)texture2D), type == SceneModeUtility.s_FocusType, SceneModeUtility.styles.typeButton)) { SceneModeUtility.SearchForType(type); } } GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); return(SceneModeUtility.s_FocusType); }
private static void CreateAnimatorController() { Texture2D icon = EditorGUIUtility.IconContent("AnimatorController Icon").image as Texture2D; ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, ScriptableObject.CreateInstance <DoCreateAnimatorController>(), "New Animator Controller.controller", icon, null); }
public static void CreatePrefab() { ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, ScriptableObject.CreateInstance <DoCreatePrefab>(), "New Prefab.prefab", EditorGUIUtility.IconContent("Prefab Icon").image as Texture2D, null); }
public static bool OKButton(Rect rect) { return(GUI.Button(rect, EditorGUIUtility.IconContent("Button Icon"), skin.button)); }
private static void Init() { WebCamTextureInspector.s_PlayIcons[0] = EditorGUIUtility.IconContent("preAudioPlayOff"); WebCamTextureInspector.s_PlayIcons[1] = EditorGUIUtility.IconContent("preAudioPlayOn"); }
public static bool SettingButton() { return(GUILayout.Button(EditorGUIUtility.IconContent("GameManager Icon"), skin.button, GUILayout.Width(40), GUILayout.Height(40))); }
public static bool SerachButton() { return(GUILayout.Button(EditorGUIUtility.IconContent("d_ViewToolZoom On"), skin.button, GUILayout.Width(30), GUILayout.Height(30))); }
private void InitializeToolIcons() { if (Toolbar.s_ToolIcons == null) { Toolbar.s_ToolIcons = new GUIContent[] { EditorGUIUtility.IconContent("MoveTool", "|Move the selected objects."), EditorGUIUtility.IconContent("RotateTool", "|Rotate the selected objects."), EditorGUIUtility.IconContent("ScaleTool", "|Scale the selected objects."), EditorGUIUtility.IconContent("RectTool"), EditorGUIUtility.IconContent("MoveTool On"), EditorGUIUtility.IconContent("RotateTool On"), EditorGUIUtility.IconContent("ScaleTool On"), EditorGUIUtility.IconContent("RectTool On") }; Toolbar.s_ViewToolIcons = new GUIContent[] { EditorGUIUtility.IconContent("ViewToolOrbit", "|Orbit the Scene view."), EditorGUIUtility.IconContent("ViewToolMove"), EditorGUIUtility.IconContent("ViewToolZoom"), EditorGUIUtility.IconContent("ViewToolOrbit", "|Orbit the Scene view."), EditorGUIUtility.IconContent("ViewToolOrbit On"), EditorGUIUtility.IconContent("ViewToolMove On"), EditorGUIUtility.IconContent("ViewToolZoom On"), EditorGUIUtility.IconContent("ViewToolOrbit On") }; Toolbar.s_PivotIcons = new GUIContent[] { EditorGUIUtility.TextContentWithIcon("Center|The tool handle is placed at the center of the selection.", "ToolHandleCenter"), EditorGUIUtility.TextContentWithIcon("Pivot|The tool handle is placed at the active object's pivot point.", "ToolHandlePivot") }; Toolbar.s_PivotRotation = new GUIContent[] { EditorGUIUtility.TextContentWithIcon("Local|Tool handles are in active object's rotation.", "ToolHandleLocal"), EditorGUIUtility.TextContentWithIcon("Global|Tool handles are in global rotation.", "ToolHandleGlobal") }; Toolbar.s_LayerContent = EditorGUIUtility.TextContent("Layers|Which layers are visible in the Scene views."); Toolbar.s_PlayIcons = new GUIContent[] { EditorGUIUtility.IconContent("PlayButton"), EditorGUIUtility.IconContent("PauseButton"), EditorGUIUtility.IconContent("StepButton"), EditorGUIUtility.IconContent("PlayButtonProfile"), EditorGUIUtility.IconContent("PlayButton On"), EditorGUIUtility.IconContent("PauseButton On"), EditorGUIUtility.IconContent("StepButton On"), EditorGUIUtility.IconContent("PlayButtonProfile On"), EditorGUIUtility.IconContent("PlayButton Anim"), EditorGUIUtility.IconContent("PauseButton Anim"), EditorGUIUtility.IconContent("StepButton Anim"), EditorGUIUtility.IconContent("PlayButtonProfile Anim") }; Toolbar.s_CloudIcon = EditorGUIUtility.IconContent("CloudConnect"); Toolbar.s_AccountContent = new GUIContent("Account"); Toolbar.s_CollabIcons = new GUIContent[] { EditorGUIUtility.TextContentWithIcon("Collab| You need to enable collab.", "CollabNew"), EditorGUIUtility.TextContentWithIcon("Collab| You are up to date.", "Collab"), EditorGUIUtility.TextContentWithIcon("Collab| Please fix your conflicts prior to publishing.", "CollabConflict"), EditorGUIUtility.TextContentWithIcon("Collab| Last operation failed. Please retry later.", "CollabError"), EditorGUIUtility.TextContentWithIcon("Collab| Please update, there are server changes.", "CollabPull"), EditorGUIUtility.TextContentWithIcon("Collab| You have files to publish.", "CollabPush"), EditorGUIUtility.TextContentWithIcon("Collab| Operation in progress.", "CollabProgress"), EditorGUIUtility.TextContentWithIcon("Collab| Collab is disabled.", "CollabNew"), EditorGUIUtility.TextContentWithIcon("Collab| Please check your network connection.", "CollabNew") }; } }
public static bool ConfigIconButton() { return(GUILayout.Button(EditorGUIUtility.IconContent("d__Popup"), skin.button, GUILayout.Width(40), GUILayout.Height(40))); }
public static GUIContent IconContent(string name) { string tooltip = null; return(EditorGUIUtility.IconContent(name, tooltip)); }
private void Init() { if (this.m_PreviewUtility == null) { this.m_PreviewUtility = new PreviewRenderUtility(); } if (SubstanceImporterInspector.s_Meshes[0] == null) { GameObject gameObject = (GameObject)EditorGUIUtility.LoadRequired("Previews/PreviewMaterials.fbx"); gameObject.SetActive(false); IEnumerator enumerator = gameObject.transform.GetEnumerator(); try { while (enumerator.MoveNext()) { Transform transform = (Transform)enumerator.Current; MeshFilter component = transform.GetComponent <MeshFilter>(); string name = transform.name; if (name == null) { goto IL_107; } if (!(name == "sphere")) { if (!(name == "cube")) { if (!(name == "cylinder")) { if (!(name == "torus")) { goto IL_107; } SubstanceImporterInspector.s_Meshes[3] = component.sharedMesh; } else { SubstanceImporterInspector.s_Meshes[2] = component.sharedMesh; } } else { SubstanceImporterInspector.s_Meshes[1] = component.sharedMesh; } } else { SubstanceImporterInspector.s_Meshes[0] = component.sharedMesh; } continue; IL_107: Debug.Log("Something is wrong, weird object found: " + transform.name); } } finally { IDisposable disposable; if ((disposable = (enumerator as IDisposable)) != null) { disposable.Dispose(); } } SubstanceImporterInspector.s_MeshIcons[0] = EditorGUIUtility.IconContent("PreMatSphere"); SubstanceImporterInspector.s_MeshIcons[1] = EditorGUIUtility.IconContent("PreMatCube"); SubstanceImporterInspector.s_MeshIcons[2] = EditorGUIUtility.IconContent("PreMatCylinder"); SubstanceImporterInspector.s_MeshIcons[3] = EditorGUIUtility.IconContent("PreMatTorus"); SubstanceImporterInspector.s_LightIcons[0] = EditorGUIUtility.IconContent("PreMatLight0"); SubstanceImporterInspector.s_LightIcons[1] = EditorGUIUtility.IconContent("PreMatLight1"); } }
static CurveEditorWindow() { CurveEditorWindow.s_WrapModeMenuIcon = EditorGUIUtility.IconContent("AnimationWrapModeMenu"); }
public static bool MinusButton(Rect rect) { return(GUI.Button(rect, EditorGUIUtility.IconContent("d_Toolbar Minus"), skin.button)); }
public static bool RefreshButton() { return(GUILayout.Button(EditorGUIUtility.IconContent("d_RotateTool"), skin.button, GUILayout.Width(30), GUILayout.Height(30))); }
public static bool ListButton() { return(GUILayout.Button(EditorGUIUtility.IconContent("ListIcon"), skin.button, GUILayout.Width(30), GUILayout.Height(30))); }
public static bool MinusButton() { return(GUILayout.Button(EditorGUIUtility.IconContent("d_Toolbar Minus"), skin.button, GUILayout.Width(30), GUILayout.Height(30))); }
public static bool OKButton() { return(GUILayout.Button(EditorGUIUtility.IconContent("Button Icon"), skin.button, GUILayout.Width(40), GUILayout.Height(40))); }
public static bool ConfigIconButton(Rect rect) { return(GUI.Button(rect, EditorGUIUtility.IconContent("d__Popup"), skin.button)); }
protected void InspectorEditButtonGUI() { UnityEditorInternal.EditMode.DoEditModeInspectorModeButton(UnityEditorInternal.EditMode.SceneViewEditMode.Collider, "Edit Collider", EditorGUIUtility.IconContent("EditCollider"), GetColliderBounds(base.target), this); }
public static bool SettingButton(Rect rect) { return(GUI.Button(rect, EditorGUIUtility.IconContent("GameManager Icon"), skin.button)); }
internal static void CreateFolderWithTemplates(string defaultName, params string[] templates) { DoCreateFolderWithTemplates doCreateFolderWithTemplates = ScriptableObject.CreateInstance <DoCreateFolderWithTemplates>(); doCreateFolderWithTemplates.templates = templates; ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, doCreateFolderWithTemplates, defaultName, EditorGUIUtility.IconContent(EditorResourcesUtility.emptyFolderIconName).image as Texture2D, null); }
public static bool SerachButton(Rect rect) { return(GUI.Button(rect, EditorGUIUtility.IconContent("d_ViewToolZoom On"), skin.button)); }
static Styles() { editModeButton = EditorGUIUtility.IconContent("EditCollider"); }
public static bool RefreshButton(Rect rect) { return(GUI.Button(rect, EditorGUIUtility.IconContent("d_RotateTool"), skin.button)); }
static private void CreateAudioMixer() { var icon = EditorGUIUtility.IconContent <AudioMixerController>().image as Texture2D; StartNameEditingIfProjectWindowExists(0, ScriptableObject.CreateInstance <DoCreateAudioMixer>(), "NewAudioMixer.mixer", icon, null); }
public static bool AddButton(Rect rect) { return(GUI.Button(rect, EditorGUIUtility.IconContent("d_Toolbar Plus More"), skin.button)); }
void InitializeToolIcons() { if (s_ToolIcons != null) { return; } s_ToolIcons = new GUIContent[k_TransformToolCount * 2]; int index = 0; s_ToolIcons[index++] = EditorGUIUtility.TrIconContent("MoveTool", "Move Tool"); s_ToolIcons[index++] = EditorGUIUtility.TrIconContent("RotateTool", "Rotate Tool"); s_ToolIcons[index++] = EditorGUIUtility.TrIconContent("ScaleTool", "Scale Tool"); s_ToolIcons[index++] = EditorGUIUtility.TrIconContent("RectTool", "Rect Tool"); s_ToolIcons[index++] = EditorGUIUtility.TrIconContent("TransformTool", "Move, Rotate or Scale selected objects."); s_ToolIcons[index++] = EditorGUIUtility.TrTextContent("Editor tool"); s_ToolIcons[index++] = EditorGUIUtility.IconContent("MoveTool On"); s_ToolIcons[index++] = EditorGUIUtility.IconContent("RotateTool On"); s_ToolIcons[index++] = EditorGUIUtility.IconContent("ScaleTool On"); s_ToolIcons[index++] = EditorGUIUtility.IconContent("RectTool On"); s_ToolIcons[index++] = EditorGUIUtility.IconContent("TransformTool On"); s_ToolIcons[index] = EditorGUIUtility.TrTextContent("Editor tool"); s_CustomToolIcon = EditorGUIUtility.TrIconContent("CustomTool", "Available Custom Editor Tools"); index = 0; s_ToolControlNames = new string[k_ToolCount]; s_ToolControlNames[index++] = "ToolbarPersistentToolsPan"; s_ToolControlNames[index++] = "ToolbarPersistentToolsTranslate"; s_ToolControlNames[index++] = "ToolbarPersistentToolsRotate"; s_ToolControlNames[index++] = "ToolbarPersistentToolsScale"; s_ToolControlNames[index++] = "ToolbarPersistentToolsRect"; s_ToolControlNames[index++] = "ToolbarPersistentToolsTransform"; s_ToolControlNames[index] = "ToolbarPersistentToolsCustom"; s_ShownToolIcons = new GUIContent[k_ToolCount]; string viewToolsTooltipText = "Hand Tool"; s_ViewToolIcons = new GUIContent[] { EditorGUIUtility.TrIconContent("ViewToolOrbit", viewToolsTooltipText), EditorGUIUtility.TrIconContent("ViewToolMove", viewToolsTooltipText), EditorGUIUtility.TrIconContent("ViewToolZoom", viewToolsTooltipText), EditorGUIUtility.TrIconContent("ViewToolOrbit", viewToolsTooltipText), EditorGUIUtility.TrIconContent("ViewToolOrbit", "Orbit the Scene view."), EditorGUIUtility.TrIconContent("ViewToolOrbit On", viewToolsTooltipText), EditorGUIUtility.TrIconContent("ViewToolMove On", viewToolsTooltipText), EditorGUIUtility.TrIconContent("ViewToolZoom On", viewToolsTooltipText), EditorGUIUtility.TrIconContent("ViewToolOrbit On"), EditorGUIUtility.TrIconContent("ViewToolOrbit On", viewToolsTooltipText) }; s_ViewToolOnOffset = s_ViewToolIcons.Length / 2; s_LayerContent = EditorGUIUtility.TrTextContent("Layers", "Which layers are visible in the Scene views."); s_PlayIcons = new GUIContent[] { EditorGUIUtility.TrIconContent("PlayButton", "Play"), EditorGUIUtility.TrIconContent("PauseButton", "Pause"), EditorGUIUtility.TrIconContent("StepButton", "Step"), EditorGUIUtility.TrIconContent("PlayButtonProfile", "Profiler Play"), EditorGUIUtility.IconContent("PlayButton On"), EditorGUIUtility.IconContent("PauseButton On"), EditorGUIUtility.IconContent("StepButton On"), EditorGUIUtility.IconContent("PlayButtonProfile On") }; s_CloudIcon = EditorGUIUtility.IconContent("CloudConnect"); s_AccountContent = EditorGUIUtility.TrTextContent("Account"); }
static Styles() { ReflectionProbeEditor.Styles.richTextMiniLabel = new GUIStyle(EditorStyles.miniLabel); ReflectionProbeEditor.Styles.bakeButtonText = "Bake"; ReflectionProbeEditor.Styles.editBoundsText = "Edit Bounds"; ReflectionProbeEditor.Styles.bakeCustomButtonsText = new string[] { "Bake as new Cubemap..." }; ReflectionProbeEditor.Styles.bakeButtonsText = new string[] { "Bake All Reflection Probes" }; ReflectionProbeEditor.Styles.runtimeSettingsHeader = new GUIContent("Runtime settings", "These settings are used by objects when they render with the cubemap of this probe"); ReflectionProbeEditor.Styles.backgroundColorText = new GUIContent("Background", "Camera clears the screen to this color before rendering."); ReflectionProbeEditor.Styles.clearFlagsText = new GUIContent("Clear Flags"); ReflectionProbeEditor.Styles.intensityText = new GUIContent("Intensity"); ReflectionProbeEditor.Styles.resolutionText = new GUIContent("Resolution"); ReflectionProbeEditor.Styles.captureCubemapHeaderText = new GUIContent("Cubemap capture settings"); ReflectionProbeEditor.Styles.boxProjectionText = new GUIContent("Box Projection", "Box projection is useful for reflections in enclosed spaces where some parrallax and movement in the reflection is wanted. If not set then cubemap reflection will we treated as coming infinite far away. And within this zone objects with the Standard shader will receive this probe's cubemap."); ReflectionProbeEditor.Styles.blendDistanceText = new GUIContent("Blend Distance", "Area around the probe where it is blended with other probes. Only used in deferred probes."); ReflectionProbeEditor.Styles.sizeText = new GUIContent("Size"); ReflectionProbeEditor.Styles.centerText = new GUIContent("Probe Origin"); ReflectionProbeEditor.Styles.skipFramesText = new GUIContent("Skip frames"); ReflectionProbeEditor.Styles.customCubemapText = new GUIContent("Cubemap"); ReflectionProbeEditor.Styles.editorUpdateText = new GUIContent("Editor Update"); ReflectionProbeEditor.Styles.importanceText = new GUIContent("Importance"); ReflectionProbeEditor.Styles.renderDynamicObjects = new GUIContent("Dynamic Objects", "If enabled dynamic objects are also rendered into the cubemap"); ReflectionProbeEditor.Styles.timeSlicing = new GUIContent("Time Slicing", "If enabled this probe will update over several frames, to help reduce the impact on the frame rate"); ReflectionProbeEditor.Styles.refreshMode = new GUIContent("Refresh Mode", "Controls how this probe refreshes in the Player"); ReflectionProbeEditor.Styles.typeText = new GUIContent("Type", "'Baked Cubemap' uses the 'Auto Baking' mode from the Lighting window. If it is enabled then baking is automatic otherwise manual bake is needed (use the bake button below). \n'Custom' can be used if a custom cubemap is wanted. \n'Realtime' can be used to dynamically re-render the cubemap during runtime (via scripting)."); ReflectionProbeEditor.Styles.reflectionProbeMode = new GUIContent[] { new GUIContent("Baked"), new GUIContent("Custom"), new GUIContent("Realtime") }; ReflectionProbeEditor.Styles.reflectionProbeModeValues = new int[] { 0, 2, 1 }; ReflectionProbeEditor.Styles.renderTextureSizesValues = new int[] { 16, 32, 64, 128, 256, 512, 1024, 2048 }; ReflectionProbeEditor.Styles.renderTextureSizes = (from n in ReflectionProbeEditor.Styles.renderTextureSizesValues select new GUIContent(n.ToString())).ToArray <GUIContent>(); ReflectionProbeEditor.Styles.clearFlags = new GUIContent[] { new GUIContent("Skybox"), new GUIContent("Solid Color") }; ReflectionProbeEditor.Styles.clearFlagsValues = new int[] { 1, 2 }; ReflectionProbeEditor.Styles.toolContents = new GUIContent[] { EditorGUIUtility.IconContent("EditCollider"), EditorGUIUtility.IconContent("MoveTool", "|Move the selected objects.") }; ReflectionProbeEditor.Styles.sceneViewEditModes = new EditMode.SceneViewEditMode[] { EditMode.SceneViewEditMode.ReflectionProbeBox, EditMode.SceneViewEditMode.ReflectionProbeOrigin }; ReflectionProbeEditor.Styles.baseSceneEditingToolText = "<color=grey>Probe Scene Editing Mode:</color> "; ReflectionProbeEditor.Styles.toolNames = new GUIContent[] { new GUIContent(ReflectionProbeEditor.Styles.baseSceneEditingToolText + "Box Projection Bounds", string.Empty), new GUIContent(ReflectionProbeEditor.Styles.baseSceneEditingToolText + "Probe Origin", string.Empty) }; ReflectionProbeEditor.Styles.commandStyle = "Command"; ReflectionProbeEditor.Styles.richTextMiniLabel.richText = true; }