ParticleSystemStyles() { InitStyle(out m_Label, out m_LabelBold, "ShurikenLabel"); InitStyle(out m_EditableLabel, out m_EditableLabelBold, "ShurikenEditableLabel"); InitStyle(out m_ObjectField, out m_ObjectFieldBold, "ShurikenObjectField"); InitStyle(out m_NumberField, out m_NumberFieldBold, "ShurikenValue"); InitStyle(out m_ModuleHeaderStyle, out m_ModuleHeaderStyleBold, "ShurikenModuleTitle"); InitStyle(out m_PopupStyle, out m_PopupStyleBold, "ShurikenPopUp"); InitStyle(out m_EmitterHeaderStyle, "ShurikenEmitterTitle"); InitStyle(out m_EmitterHeaderStyle, "ShurikenEmitterTitle"); InitStyle(out m_EffectBgStyle, "ShurikenEffectBg"); InitStyle(out m_ModuleBgStyle, "ShurikenModuleBg"); InitStyle(out m_Plus, "ShurikenPlus"); InitStyle(out m_Minus, "ShurikenMinus"); InitStyle(out m_Checkmark, "ShurikenCheckMark"); InitStyle(out m_CheckmarkMixed, "ShurikenCheckMarkMixed"); InitStyle(out m_MinMaxCurveStateDropDown, "ShurikenDropdown"); InitStyle(out m_Toggle, "ShurikenToggle"); InitStyle(out m_ToggleMixed, "ShurikenToggleMixed"); InitStyle(out m_SelectionMarker, "IN ThumbnailShadow"); InitStyle(out m_ToolbarButtonLeftAlignText, "ToolbarButton"); // Todo: Fix in editor resources m_EmitterHeaderStyle.clipping = TextClipping.Clip; m_EmitterHeaderStyle.padding.right = 45; m_WarningIcon = EditorGUIUtility.LoadIcon("console.infoicon.sml"); // Don't change the original as it is used in areas other than particles. m_ToolbarButtonLeftAlignText = new GUIStyle(m_ToolbarButtonLeftAlignText); m_ToolbarButtonLeftAlignText.alignment = TextAnchor.MiddleLeft; m_ModulePadding = new GUIStyle(); m_ModulePadding.padding = new RectOffset(3, 3, 4, 2); }
static internal void LoadIcons() { if (ms_LoadedIcons) { return; } ms_LoadedIcons = true; iconInfo = EditorGUIUtility.LoadIcon("console.infoicon"); iconWarn = EditorGUIUtility.LoadIcon("console.warnicon"); iconError = EditorGUIUtility.LoadIcon("console.erroricon"); iconInfoSmall = EditorGUIUtility.LoadIcon("console.infoicon.sml"); iconWarnSmall = EditorGUIUtility.LoadIcon("console.warnicon.sml"); iconErrorSmall = EditorGUIUtility.LoadIcon("console.erroricon.sml"); iconFirstErrorSmall = EditorGUIUtility.LoadIcon("sv_icon_dot14_sml"); // TODO: Once we get the proper monochrome images put them here. /*iconInfoMono = EditorGUIUtility.LoadIcon("console.infoicon.mono"); * iconWarnMono = EditorGUIUtility.LoadIcon("console.warnicon.mono"); * iconErrorMono = EditorGUIUtility.LoadIcon("console.erroricon.mono");*/ iconInfoMono = EditorGUIUtility.LoadIcon("console.infoicon.sml"); iconWarnMono = EditorGUIUtility.LoadIcon("console.warnicon.inactive.sml"); iconErrorMono = EditorGUIUtility.LoadIcon("console.erroricon.inactive.sml"); iconFirstErrorMono = EditorGUIUtility.LoadIcon("sv_icon_dot8_sml"); iconCustomFiltersMono = EditorGUIUtility.LoadIcon("sv_icon_dot0_sml"); iconCustomFiltersSmalls = new Texture2D[7]; for (int i = 0; i < 7; i++) { iconCustomFiltersSmalls[i] = EditorGUIUtility.LoadIcon("sv_icon_dot" + (i + 1) + "_sml"); } Constants.Init(); }
static internal void LoadIcons() { if (ms_LoadedIcons) { return; } ms_LoadedIcons = true; iconInfo = EditorGUIUtility.LoadIcon("console.infoicon"); iconWarn = EditorGUIUtility.LoadIcon("console.warnicon"); iconError = EditorGUIUtility.LoadIcon("console.erroricon"); iconInfoSmall = EditorGUIUtility.LoadIcon("console.infoicon.sml"); iconWarnSmall = EditorGUIUtility.LoadIcon("console.warnicon.sml"); iconErrorSmall = EditorGUIUtility.LoadIcon("console.erroricon.sml"); // TODO: Once we get the proper monochrome images put them here. /*iconInfoMono = EditorGUIUtility.LoadIcon("console.infoicon.mono"); * iconWarnMono = EditorGUIUtility.LoadIcon("console.warnicon.mono"); * iconErrorMono = EditorGUIUtility.LoadIcon("console.erroricon.mono");*/ iconInfoMono = EditorGUIUtility.LoadIcon("console.infoicon.inactive.sml"); iconWarnMono = EditorGUIUtility.LoadIcon("console.warnicon.inactive.sml"); iconErrorMono = EditorGUIUtility.LoadIcon("console.erroricon.inactive.sml"); Constants.Init(); }
void SetItemOverlayIcon(GameObjectTreeViewItem item) { item.overlayIcon = null; var go = item.objectPPTR as GameObject; if (go == null) { return; } if (PrefabUtility.IsAddedGameObjectOverride(go)) { item.overlayIcon = EditorGUIUtility.LoadIcon("PrefabOverlayAdded Icon"); } if (!EditorApplication.isPlaying) { Asset asset = GetAsset(item); if (asset != null && !m_HierarchyPrefabToAssetIDMap.ContainsKey(item.id)) { string metaPath = asset.path.Trim('/') + ".meta"; Asset metaAsset = Provider.GetAssetByPath(metaPath); Asset[] assets = new[] { asset, metaAsset }; m_HierarchyPrefabToAssetIDMap.Add(item.id, assets); } } }
private static void UpdateStatusIcon(DisplayedTask task, string iconName) { task.descriptionIcon.style.backgroundImage = EditorGUIUtility.LoadIcon(iconName); task.descriptionIcon.style.unityBackgroundScaleMode = ScaleMode.ScaleToFit; task.descriptionIcon.style.height = ProgressWindow.kIconSize; task.descriptionIcon.style.width = ProgressWindow.kIconSize; }
public static Texture2D GetIconKey() { if ((UnityEngine.Object)CurveUtility.iconKey == (UnityEngine.Object)null) { CurveUtility.iconKey = EditorGUIUtility.LoadIcon("animationkeyframe"); } return(CurveUtility.iconKey); }
public static Texture2D GetIconCurve() { if ((UnityEngine.Object)CurveUtility.iconCurve == (UnityEngine.Object)null) { CurveUtility.iconCurve = EditorGUIUtility.LoadIcon("animationanimated"); } return(CurveUtility.iconCurve); }
public static Texture2D GetMiniTypeThumbnail(Type type) { if (typeof(MonoBehaviour).IsAssignableFrom(type)) { return(EditorGUIUtility.LoadIcon(type.FullName.Replace('.', '/') + " Icon")); } return(INTERNAL_GetMiniTypeThumbnailFromType(type)); }
private static void UpdateProgressCompletion(DisplayedTask task, string iconName) { task.progressLabel.style.backgroundImage = EditorGUIUtility.LoadIcon(iconName); task.progressLabel.style.unityBackgroundScaleMode = ScaleMode.ScaleToFit; task.progressLabel.text = ""; task.progressLabel.style.width = 30; task.progressLabel.style.height = ProgressWindow.kIconSize; }
public static Texture2D GetIconCurve() { if (CurveUtility.iconCurve == null) { CurveUtility.iconCurve = EditorGUIUtility.LoadIcon("animationanimated"); } return(CurveUtility.iconCurve); }
public static Texture2D GetIconKey() { if (CurveUtility.iconKey == null) { CurveUtility.iconKey = EditorGUIUtility.LoadIcon("animationkeyframe"); } return(CurveUtility.iconKey); }
private ParticleSystemStyles() { this.emitterHeaderStyle.clipping = TextClipping.Clip; this.emitterHeaderStyle.padding.right = 45; this.warningIcon = EditorGUIUtility.LoadIcon("console.infoicon.sml"); this.toolbarButtonLeftAlignText.alignment = TextAnchor.MiddleLeft; this.modulePadding.padding = new RectOffset(3, 3, 4, 2); }
public void OnEnable() { this.m_PlayableAsset = base.serializedObject.FindProperty("m_PlayableAsset"); this.m_InitialState = base.serializedObject.FindProperty("m_InitialState"); this.m_WrapMode = base.serializedObject.FindProperty("m_WrapMode"); this.m_UpdateMethod = base.serializedObject.FindProperty("m_DirectorUpdateMode"); this.m_InitialTime = base.serializedObject.FindProperty("m_InitialTime"); this.m_SceneBindings = base.serializedObject.FindProperty("m_SceneBindings"); this.m_AnimatorContent = new GUIContent(AssetPreview.GetMiniTypeThumbnail(typeof(Animator))); this.m_AudioContent = new GUIContent(AssetPreview.GetMiniTypeThumbnail(typeof(AudioSource))); this.m_ScriptContent = new GUIContent(EditorGUIUtility.LoadIcon("ScriptableObject Icon")); this.m_DefaultScriptContentTexture = this.m_ScriptContent.image; }
public static Texture2D GetMiniTypeThumbnail(Type type) { Texture2D tex; if (typeof(MonoBehaviour).IsAssignableFrom(type)) { tex = EditorGUIUtility.LoadIcon(type.FullName.Replace('.', '/') + " Icon"); } else { tex = GetMiniTypeThumbnailFromType(type); } return(tex); }
public static Texture2D GetMiniTypeThumbnail(Type type) { Texture2D result; if (typeof(MonoBehaviour).IsAssignableFrom(type)) { result = EditorGUIUtility.LoadIcon(type.FullName.Replace('.', '/') + " Icon"); } else { result = AssetPreview.INTERNAL_GetMiniTypeThumbnailFromType(type); } return(result); }
internal static Texture2D LoadIconRequired(string name) { Texture2D texture2D = EditorGUIUtility.LoadIcon(name); if (!texture2D) { Debug.LogErrorFormat("Unable to load the icon: '{0}'.\nNote that either full project path should be used (with extension) or just the icon name if the icon is located in the following location: '{1}' (without extension, since png is assumed)", new object[] { name, "Assets/Editor Default Resources/" + EditorResourcesUtility.iconsPath }); } return(texture2D); }
void SetItemOverlayIcon(GameObjectTreeViewItem item) { item.overlayIcon = null; var go = item.objectPPTR as GameObject; if (go == null) { return; } if (PrefabUtility.IsAddedGameObjectOverride(go)) { item.overlayIcon = EditorGUIUtility.LoadIcon("PrefabOverlayAdded Icon"); } if (!EditorApplication.isPlaying) { var vco = VersionControlManager.activeVersionControlObject; if (vco != null) { if (!m_HierarchyPrefabToAssetPathMap.ContainsKey(item.id)) { var guid = GetAssetGUID(item); if (!string.IsNullOrEmpty(guid)) { var assetPath = AssetDatabase.GUIDToAssetPath(guid); if (!string.IsNullOrEmpty(assetPath)) { m_HierarchyPrefabToAssetPathMap.Add(item.id, assetPath); } } } } else { var asset = GetAsset(item); if (asset != null && !m_HierarchyPrefabToAssetIDMap.ContainsKey(item.id)) { var metaPath = asset.path.Trim('/') + ".meta"; var metaAsset = Provider.GetAssetByPath(metaPath); var assets = new[] { asset, metaAsset }; m_HierarchyPrefabToAssetIDMap.Add(item.id, assets); } } } }
private static void Init() { if (AudioClipInspector.s_PreButton == null) { AudioClipInspector.s_PreButton = "preButton"; AudioClipInspector.m_bAutoPlay = EditorPrefs.GetBool("AutoPlayAudio", false); AudioClipInspector.s_AutoPlayIcons[0] = EditorGUIUtility.TrIconContent("preAudioAutoPlayOff", "Turn Auto Play on"); AudioClipInspector.s_AutoPlayIcons[1] = EditorGUIUtility.TrIconContent("preAudioAutoPlayOn", "Turn Auto Play off"); AudioClipInspector.s_PlayIcons[0] = EditorGUIUtility.TrIconContent("preAudioPlayOff", "Play"); AudioClipInspector.s_PlayIcons[1] = EditorGUIUtility.TrIconContent("preAudioPlayOn", "Stop"); AudioClipInspector.s_LoopIcons[0] = EditorGUIUtility.TrIconContent("preAudioLoopOff", "Loop on"); AudioClipInspector.s_LoopIcons[1] = EditorGUIUtility.TrIconContent("preAudioLoopOn", "Loop off"); AudioClipInspector.s_DefaultIcon = EditorGUIUtility.LoadIcon("Profiler.Audio"); } }
private static void ShowError(string error) { if (s_WarningIcon == null) { s_WarningIcon = EditorGUIUtility.LoadIcon("console.warnicon"); } GUIContent content = new GUIContent(error) { image = s_WarningIcon }; GUILayout.Space(5f); GUILayout.BeginVertical(EditorStyles.helpBox, new GUILayoutOption[0]); GUILayout.Label(content, EditorStyles.wordWrappedMiniLabel, new GUILayoutOption[0]); GUILayout.EndVertical(); }
void SetItemOverlayIcon(GameObjectTreeViewItem item) { item.overlayIcon = null; var go = item.objectPPTR as GameObject; if (go == null) { return; } if (PrefabUtility.IsAddedGameObjectOverride(go)) { item.overlayIcon = EditorGUIUtility.LoadIcon("PrefabOverlayAdded Icon"); } }
internal static void LoadIcons() { if (!ConsoleWindow.ms_LoadedIcons) { ConsoleWindow.ms_LoadedIcons = true; ConsoleWindow.iconInfo = EditorGUIUtility.LoadIcon("console.infoicon"); ConsoleWindow.iconWarn = EditorGUIUtility.LoadIcon("console.warnicon"); ConsoleWindow.iconError = EditorGUIUtility.LoadIcon("console.erroricon"); ConsoleWindow.iconInfoSmall = EditorGUIUtility.LoadIcon("console.infoicon.sml"); ConsoleWindow.iconWarnSmall = EditorGUIUtility.LoadIcon("console.warnicon.sml"); ConsoleWindow.iconErrorSmall = EditorGUIUtility.LoadIcon("console.erroricon.sml"); ConsoleWindow.iconInfoMono = EditorGUIUtility.LoadIcon("console.infoicon.sml"); ConsoleWindow.iconWarnMono = EditorGUIUtility.LoadIcon("console.warnicon.inactive.sml"); ConsoleWindow.iconErrorMono = EditorGUIUtility.LoadIcon("console.erroricon.inactive.sml"); ConsoleWindow.Constants.Init(); } }
private void UpdateStatusIcon(string iconName) { if (string.IsNullOrEmpty(iconName)) { m_BackgroundTaskStatusIcon.style.backgroundImage = null; m_BackgroundTaskStatusIcon.style.unityBackgroundScaleMode = ScaleMode.ScaleToFit; m_BackgroundTaskStatusIcon.style.height = 0; m_BackgroundTaskStatusIcon.style.width = 0; } else { m_BackgroundTaskStatusIcon.style.backgroundImage = EditorGUIUtility.LoadIcon(iconName); m_BackgroundTaskStatusIcon.style.unityBackgroundScaleMode = ScaleMode.ScaleToFit; m_BackgroundTaskStatusIcon.style.height = k_IconSize; m_BackgroundTaskStatusIcon.style.width = k_IconSize; } }
static void Init() { if (s_PreButton != null) { return; } s_PreButton = "preButton"; s_AutoPlay = EditorPrefs.GetBool("AutoPlayAudio", false); s_Loop = false; s_AutoPlayIcon = EditorGUIUtility.TrIconContent("preAudioAutoPlayOff", "Turn Auto Play on/off"); s_PlayIcon = EditorGUIUtility.TrIconContent("PlayButton", "Play"); s_LoopIcon = EditorGUIUtility.TrIconContent("preAudioLoopOff", "Loop on/off"); s_DefaultIcon = EditorGUIUtility.LoadIcon("Profiler.Audio"); }
internal static Texture2D LoadIconRequired(string name) { Texture2D texture2D = EditorGUIUtility.LoadIcon(name); if (!texture2D) { Debug.LogError(string.Concat(new string[] { "Unable to load '", EditorResourcesUtility.iconsPath, name, "' nor '", EditorResourcesUtility.generatedIconsPath, name, "'" })); } return(texture2D); }
private UIElements.ToolbarToggle CreateStatusFiler(VisualElement parent, string controlName, string iconName) { var filterToggle = new UIElements.ToolbarToggle(); filterToggle.tooltip = controlName; filterToggle.value = EditorPrefs.GetBool($"{preferenceKey}{controlName}_filter", true); var toggleCheck = filterToggle.Q <VisualElement>("unity-checkmark"); toggleCheck.style.backgroundImage = new StyleBackground(EditorGUIUtility.LoadIcon(iconName)); toggleCheck.style.unityBackgroundScaleMode = ScaleMode.ScaleToFit; toggleCheck.style.width = kIconSize; toggleCheck.style.height = kIconSize; filterToggle.RegisterCallback <ChangeEvent <bool> >((evt) => { EditorPrefs.SetBool($"{preferenceKey}{controlName}_filter", filterToggle.value); UpdateStatusFilter(); }); parent.Add(filterToggle); return(filterToggle); }
/// <summary> /// <para>Returns the thumbnail for the type.</para> /// </summary> /// <param name="type"></param> public static Texture2D GetMiniTypeThumbnail(System.Type type) { return(!typeof(MonoBehaviour).IsAssignableFrom(type) ? AssetPreview.INTERNAL_GetMiniTypeThumbnailFromType(type) : EditorGUIUtility.LoadIcon(type.FullName.Replace('.', '/') + " Icon")); }