internal static StyleBlock FindBlock(int name, DrawStates drawStates) { StyleState stateFlags = 0; if (GUI.enabled) { if (drawStates.hasKeyboardFocus && GUIView.current.hasFocus) { stateFlags |= StyleState.focus; } if (drawStates.isActive || GUI.HasMouseControl(drawStates.controlId)) { stateFlags |= StyleState.active; } if (drawStates.isHover && GUIUtility.hotControl == 0 && IsMouseOverGUIView()) { stateFlags |= StyleState.hover; } } else { stateFlags |= StyleState.disabled; } if (drawStates.on) { stateFlags |= StyleState.@checked; } StyleState[] states; if (!s_StatesCache.TryGetValue(stateFlags, out states)) { states = new[] { stateFlags, stateFlags & StyleState.disabled, stateFlags & StyleState.active, stateFlags & StyleState.@checked, stateFlags & StyleState.hover, stateFlags & StyleState.focus, StyleState.normal }.Distinct().Where(s => s != StyleState.none).ToArray(); s_StatesCache.Add(stateFlags, states); } return(EditorResources.GetStyle(name, states)); }
internal static DrawingBrush GetBrushFromResource(string activityFullName) { string resourceKey = GetIconResourceKey(activityFullName); if (resourceKey == null) { return(null); } var resourceDictionary = EditorResources.GetIcons(); if (resourceDictionary != null && resourceDictionary.Contains(resourceKey)) { DrawingBrush drawingBrush = resourceDictionary[resourceKey] as DrawingBrush; return(drawingBrush); } return(null); }
void OnEnable() { // Load elements var root = new VisualElement { name = "root-container" }; var visualTreeAsset = (VisualTreeAsset)EditorResources.Load<UnityEngine.Object>("UXML/ShortcutManager/PromptWindow.uxml"); visualTreeAsset.CloneTree(root, null); rootVisualElement.Add(root); // Load styles if (EditorGUIUtility.isProSkin) root.AddToClassList("isProSkin"); root.AddStyleSheetPath("StyleSheets/ShortcutManager/PromptWindow.uss"); // Find elements m_HeaderTextElement = root.Q<TextElement>("header"); m_MessageTextElement = root.Q<TextElement>("message"); var labelAndTextField = root.Q("label-and-text-field"); m_LabelTextElement = labelAndTextField.Q<TextElement>(); m_TextField = labelAndTextField.Q<TextField>(); var buttons = root.Q("buttons"); m_SubmitButton = root.Q<Button>("submit"); var cancelButton = root.Q<Button>("cancel"); // Set localized text cancelButton.text = L10n.Tr("Cancel"); // Set up event handlers m_TextField.RegisterValueChangedCallback(OnTextFieldValueChanged); m_TextField.RegisterCallback<KeyDownEvent>(OnTextFieldKeyDown); m_SubmitButton.clickable.clicked += Submit; cancelButton.clickable.clicked += Close; // Flip submit and cancel buttons on macOS if (SystemInfo.operatingSystemFamily == OperatingSystemFamily.MacOSX) { var parent = m_SubmitButton.parent; parent.Remove(m_SubmitButton); parent.Add(m_SubmitButton); } // Mark last button with class buttons.Children().Last().AddToClassList("last"); }
static void ShowMessageBox(string message, MessageBoxImage icon, string stackTrace) { //determine an icon string iconName = icon == MessageBoxImage.Error ? "TextBoxErrorIcon" : icon == MessageBoxImage.Warning ? "WarningValidationIcon" : string.Empty; //set properties var dlg = new ErrorDialog() { ErrorDescription = message ?? "<null>", Icon = EditorResources.GetIcons()[iconName], StackTrace = stackTrace, StackTraceVisibility = string.IsNullOrEmpty(stackTrace) ? Visibility.Collapsed : Visibility.Visible, Context = null != ActiveDesignerView ? ActiveDesignerView.Context : null, Owner = ActiveDesignerView, }; //show error window dlg.Show(); }
internal static void UpdateSkinCache(int skinIndex) { // Don't cache the Game GUISkin styles if (GUIUtility.s_SkinMode == 0) { return; } if (s_CachedStyles[skinIndex] == null) { EditorResources.BuildCatalog(); s_CachedStyles[skinIndex] = new EditorStyles(); s_CachedStyles[skinIndex].InitSharedStyles(); } s_Current = s_CachedStyles[skinIndex]; EditorGUIUtility.s_FontIsBold = -1; EditorGUIUtility.SetBoldDefaultFont(false); }
//展示注入信息 private void ShowInjectInfo(InjectPlatForm currentPlatform) { EditorGUILayout.LabelField("Platform Info", GUIHelper.MakeHeader()); var infoXmlTextAsset = EditorResources.GetAsset <TextAsset>("InjectDll", "CodeInject"); XDocument xDoc = XDocument.Parse(infoXmlTextAsset.text); var infoRoot = xDoc.Root.Element(currentPlatform.ToString()); foreach (var infoElement in infoRoot.Elements()) { string attrbutes = infoElement.Element("injectAttr").Value; if (!string.IsNullOrEmpty(attrbutes)) { var dllEles = new List <XElement>(infoElement.Elements("dll")); foreach (var dllEle in dllEles) { EditorGUILayout.LabelField("Effect Dll:" + dllEle.Name.LocalName); } EditorGUILayout.LabelField("To Inject:" + attrbutes); } } }
protected override void OnEnable() { type = serializedObject.FindProperty("type"); minScreenPointsDistance = serializedObject.FindProperty("minScreenPointsDistance"); screenTransformThreshold = serializedObject.FindProperty("screenTransformThreshold"); OnTransformStart = serializedObject.FindProperty("OnTransformStart"); OnTransform = serializedObject.FindProperty("OnTransform"); OnTransformComplete = serializedObject.FindProperty("OnTransformComplete"); projection = serializedObject.FindProperty("projection"); projectionPlaneNormal = serializedObject.FindProperty("projectionPlaneNormal"); projectionProps = serializedObject.FindProperty("projectionProps"); xy = EditorResources.Load <Texture2D>("Icons/xy.png"); xz = EditorResources.Load <Texture2D>("Icons/xz.png"); yz = EditorResources.Load <Texture2D>("Icons/yz.png"); unknown = EditorResources.Load <Texture2D>("Icons/unknown.png"); selector = EditorResources.Load <Texture2D>("Icons/selector.png"); base.OnEnable(); }
private void SetupData() { m_SceneTemplateInfos = SceneTemplateUtils.GetSceneTemplateInfos(); LoadSessionPreferences(); m_DefaultThumbnail = EditorGUIUtility.IconContent("d_SceneAsset Icon").image as Texture2D; foreach (var builtinTemplateInfo in SceneTemplateUtils.builtinTemplateInfos) { if (builtinTemplateInfo.thumbnail == null) { builtinTemplateInfo.thumbnail = EditorResources.Load <Texture2D>(builtinTemplateInfo.thumbnailPath); Assert.IsNotNull(builtinTemplateInfo.thumbnail); } if (builtinTemplateInfo.badge == null && !string.IsNullOrEmpty(builtinTemplateInfo.badgePath)) { builtinTemplateInfo.badge = EditorResources.Load <Texture2D>(builtinTemplateInfo.badgePath); Assert.IsNotNull(builtinTemplateInfo.badge); } } }
public static void TriggerGeneration() { int successfulGenerators = 0; int failedGenerators = 0; foreach (var gen in EditorResources.FindAllAssetsOfType <GeneratorBase>()) { try { gen.Generate(); successfulGenerators++; } catch (Exception e) { Debug.LogException(e); failedGenerators++; } } if (successfulGenerators == 1) { Debug.Log("Successfully ran 1 generator."); } else if (successfulGenerators > 1) { Debug.Log("Successfully ran " + successfulGenerators + " generators."); } if (failedGenerators == 1) { Debug.LogError("1 generator failed to run."); } else if (failedGenerators > 1) { Debug.LogError(failedGenerators + " generators failed to run."); } AssetDatabase.Refresh(); AssetDatabase.SaveAssets(); }
/// <summary> /// Should be called at the start of the test. The argument is /// the name of the prefab to spawn, or the name of a gameobject /// in the current scene to load. This object should have a /// graphic renderer component attached to the root. /// /// This method will automatically populate the following fields: /// - renderer : with the reference to the renderer on the base of the prefab /// - oneGraphic : with a reference to one graphic that exists in the prefab, if any /// - firstGroup : the first group attached to the renderer /// - secondGroup : the second group attached to the renderer, if any /// </summary> protected void InitTest(string objectName) { GameObject obj = null; for (int i = 0; i < SceneManager.sceneCount; i++) { var scene = SceneManager.GetSceneAt(i); obj = scene.GetRootGameObjects(). Query(). FirstOrDefault(g => g.name == objectName); if (obj != null) { obj.SetActive(true); break; } } if (obj == null) { var prefab = EditorResources.Load <GameObject>(objectName); if (prefab == null) { throw new Exception("Could not find an object or prefab with the name " + objectName); } obj = UnityEngine.Object.Instantiate(prefab); } renderer = obj.GetComponent <LeapGraphicRenderer>(); oneGraphic = renderer.GetComponentInChildren <LeapGraphic>(includeInactive: true); firstGroup = renderer.groups[0]; secondGroup = renderer.groups.Count > 1 ? renderer.groups[1] : null; }
private void ShowFunction() { uiManager = target as UIManager; canvas = uiManager.canvas; EditorGUILayout.HelpBox("This is UIManager you can Manage all the UIInfo here", MessageType.None); if (GUILayout.Button("Open UIConst", GUILayout.Height(50), GUILayout.MaxWidth(200))) { Object obj = EditorResources.GetAsset <Object>("UIConst", "ResetCore", "UGUI") as Object; AssetDatabase.OpenAsset(obj); } EditorGUILayout.Space(); if (GUILayout.Button("PSD2UGUI", GUILayout.Height(50), GUILayout.MaxWidth(200))) { //PSD2UGUI.PsdFile2UGUI(); } EditorGUILayout.Space(); UIConst.uiPrefabPath = EditorGUILayout.TextField("UI Prefab Path", UIConst.uiPrefabPath, GUILayout.MaxWidth(300)); }
internal static Texture GetIconInActiveState(Texture icon) { if (icon != null) { string path = ""; bool isBuilding = IsBuiltinResource(icon); string iconText = isBuilding ? " icon" : " Icon"; string onText = isBuilding ? " on" : " On"; if (isBuilding) { path = EditorResources.GetAssetPath(icon); } else { path = AssetDatabase.GetAssetPath(icon); } string selectedIconPath = ""; if (path.Contains(iconText)) { selectedIconPath = path.Replace(iconText, onText + iconText); } else if (path.Contains("@")) { selectedIconPath = path.Replace("@", onText + "@"); } else if (path.Contains(".png")) { selectedIconPath = path.Replace(".png", onText + ".png"); } return(EditorResources.Load <Texture>(selectedIconPath, false)); } return(null); }
public static void RegisterMetadata(AttributeTableBuilder builder) { Type type = typeof(System.Activities.Statements.FlowSwitch <>); builder.AddCustomAttributes(type, new DesignerAttribute(typeof(FlowSwitchDesigner))); builder.AddCustomAttributes(type, type.GetProperty("Default"), BrowsableAttribute.No); builder.AddCustomAttributes(type, new ActivityDesignerOptionsAttribute { AllowDrillIn = false, OutlineViewIconProvider = (modelItem) => { if (modelItem != null) { ResourceDictionary icons = EditorResources.GetIcons(); if (icons.Contains("FlowSwitchIcon") && icons["FlowSwitchIcon"] is DrawingBrush) { return((DrawingBrush)icons["FlowSwitchIcon"]); } } return(null); } }); builder.AddCustomAttributes(type, new FeatureAttribute(typeof(FlowSwitchLabelFeature))); builder.AddCustomAttributes(type, new FeatureAttribute(typeof(FlowSwitchDefaultLinkFeature))); builder.AddCustomAttributes(type, type.GetProperty("Cases"), new ShowPropertyInOutlineViewAttribute() { CurrentPropertyVisible = false, ChildNodePrefix = "Case : " }); builder.AddCustomAttributes(type, type.GetProperty("Expression"), new HidePropertyInOutlineViewAttribute()); Type flowSwitchLinkType = typeof(FlowSwitchCaseLink <>); builder.AddCustomAttributes(flowSwitchLinkType, "Case", PropertyValueEditor.CreateEditorAttribute(typeof(FlowSwitchLinkCasePropertyEditor)), new EditorReuseAttribute(false)); }
internal static Texture GetIconInActiveState(Texture icon) { if (icon == null) { return(null); } Texture selectedIcon; var iconInstanceId = icon.GetInstanceID(); if (!s_ActiveIconPathLUT.TryGetValue(iconInstanceId, out selectedIcon)) { const string iconText = " icon"; const string onText = " on"; string selectedIconPath = string.Empty; string path = EditorResources.GetAssetPath(icon).ToLowerInvariant(); if (path.Contains(iconText)) { selectedIconPath = path.Replace(iconText, onText + iconText); } else if (path.Contains('@')) { selectedIconPath = path.Replace("@", onText + "@"); } else if (path.EndsWith(".png")) { selectedIconPath = path.Replace(".png", onText + ".png"); } selectedIcon = EditorResources.Load <Texture>(selectedIconPath, false); s_ActiveIconPathLUT[iconInstanceId] = selectedIcon; } return(selectedIcon); }
private void CheckPrefab() { BaseUI ui = target as BaseUI; string uiPrefabPath = UIConst.uiPrefabPath; if (!UIConst.UIPrefabNameDic.ContainsKey(ui.uiName)) { EditorGUILayout.HelpBox("There is no prefab name setted! Open the UIConst To Issue this problem.", MessageType.Error); if (GUILayout.Button("Open UIConst")) { Object obj = EditorResources.GetAsset <Object>("UIConst", "ResetCore", "UGUI") as Object; AssetDatabase.OpenAsset(obj); } return; } string prefabNameWithEx = UIConst.UIPrefabNameDic[ui.uiName]; string prefabName = Path.GetFileNameWithoutExtension(prefabNameWithEx); //检查是否是Prefab if (PrefabUtility.GetPrefabType(ui.gameObject) != PrefabType.PrefabInstance && PrefabUtility.GetPrefabType(ui.gameObject) != PrefabType.Prefab) { GameObject prefabAlreadyExist = EditorResources.GetAsset <GameObject>(prefabName, "Resources", uiPrefabPath) as GameObject; if (prefabAlreadyExist == null) { EditorGUILayout.HelpBox("Lose prefab! You should Create a Prefab", MessageType.Warning); if (GUILayout.Button("Create Prefab")) { string path = PathEx.Combine(PathConfig.assetResourcePath, uiPrefabPath, prefabNameWithEx).Replace("\\", "/"); string absolutePath = PathEx.Combine(PathConfig.resourcePath, uiPrefabPath, prefabNameWithEx); PathEx.MakeFileDirectoryExist(absolutePath); Debug.unityLogger.Log("Create a ui prefab : " + path); GameObject go = PrefabUtility.CreatePrefab(path, ui.gameObject); PrefabUtility.ConnectGameObjectToPrefab(ui.gameObject, go); AssetDatabase.Refresh(); } } else { EditorGUILayout.HelpBox("There is already a same name prefab there!", MessageType.Error); if (GUILayout.Button("Check Prefab")) { Debug.unityLogger.Log(EditorResources.GetFullPath(prefabName, "Resources", uiPrefabPath)); //Selection.activeObject = AssetDatabase.LoadAssetAtPath<GameObject>("Assets/Resources/Prefabs/Cube.prefab"); EditorGUIUtility.PingObject(prefabAlreadyExist); Selection.activeObject = prefabAlreadyExist; } } } else { Object prefabObj; string prefabAssetName; if (PrefabUtility.GetPrefabType(ui) == PrefabType.Prefab) { prefabObj = ui; prefabAssetName = ui.gameObject.name; Debug.Log(ui.gameObject.name); } else { prefabObj = PrefabUtility.GetPrefabParent(ui.gameObject); prefabAssetName = Path.GetFileNameWithoutExtension(AssetDatabase.GetAssetPath(prefabObj.GetInstanceID())); } //检查Prefab名与UIName类型是否匹配 if (prefabName != prefabAssetName) { EditorGUILayout.HelpBox("Your prefab name is not fit your UITypeName, Please reselect!\n" + "UIName = " + prefabName + " but \nPrefabName = " + prefabAssetName, MessageType.Error); UIConst.UIName?fitUIName = null; foreach (KeyValuePair <UIConst.UIName, string> kvp in UIConst.UIPrefabNameDic) { if (kvp.Value == prefabAssetName + ".prefab") { fitUIName = kvp.Key; } } if (fitUIName != null) { if (GUILayout.Button("Fix Issue")) { ui.uiName = (UIConst.UIName)fitUIName; } } } } }
private static void Replacement() { EditorApplication.projectWindowItemOnGUI -= Replacement; EditorApplication.hierarchyWindowItemOnGUI -= Replacement; bool force = SessionState.GetBool(forcedKey, false); SessionState.EraseBool(forcedKey); if (force) { EditorApplication.delayCall += () => { Type consoleWindowType = Type.GetType("UnityEditor.ConsoleWindow,UnityEditor"); if (consoleWindowType == null) { return; } var consoleWindows = Resources.FindObjectsOfTypeAll(consoleWindowType); if (consoleWindows == null) { return; } foreach (Object consoleWindow in consoleWindows) { ((EditorWindow)consoleWindow).Repaint(); } }; } Font font; switch ((MonospacedConsoleSettings.Font)EditorPrefs.GetInt(FontKey, 0)) { case MonospacedConsoleSettings.Font.JetbrainsMono: font = AssetDatabase.LoadAssetAtPath <Font>("Packages/com.vertx.monospaced-console/JetbrainsMono-Regular.ttf"); break; case MonospacedConsoleSettings.Font.Consola: font = EditorResources.Load <Font>("consola.ttf"); break; default: return; } switch ((State)EditorPrefs.GetInt(StateKey, (int)DefaultState)) { case State.LogsAndMessage: ReplaceFont("CN Message"); ReplaceLogs(); break; case State.MessageOnly: ReplaceFont("CN Message"); if (force) { ReplaceLogs(false); } break; default: if (force) { ReplaceFont("CN Message", false); ReplaceLogs(false); } return; } void ReplaceLogs(bool replace = true) { ReplaceFont("CN EntryInfo", replace); ReplaceFont("CN EntryWarn", replace); ReplaceFont("CN EntryError", replace); ReplaceFont("CN EntryInfoSmall", replace); ReplaceFont("CN EntryWarnSmall", replace); ReplaceFont("CN EntryErrorSmall", replace); } void ReplaceFont(string guiStyle, bool replace = true) { GUIStyle style = guiStyle; style.font = replace ? font : null; style.fontSize = 12; } }
private void Initialize() { animationClip = EditorResources.Load <AnimationClip>(Importer.assetPath); }
public override void OnInspectorGUI() { #if DATA_GENER UILocalization local = target as UILocalization; //base.OnInspectorGUI(); local.key = EditorGUILayout.TextField("Key", local.key); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Open Excel")) { EditorUtility.OpenWithDefaultApp(PathConfig.LanguageDataExcelPath); } if (GUILayout.Button("Open Const")) { UnityEngine.Object obj = EditorResources.GetAsset <UnityEngine.Object>("LanguageConst", "ResetCore", "Localization") as UnityEngine.Object; AssetDatabase.OpenAsset(obj); } EditorGUILayout.EndHorizontal(); if (!File.Exists(PathConfig.LanguageDataPath)) { EditorGUILayout.HelpBox("You have not exported the localization file, export please!", MessageType.Error); } if (GUILayout.Button("Export Localization")) { Source2Localization.ExportExcelFile(); } Array types = Enum.GetValues(typeof(LanguageConst.LanguageType)); if (local.gameObject.GetComponent <Text>() != null) { foreach (LanguageConst.LanguageType type in types) { GUILayout.Label(type.ToString()); string helpTxt = LanguageManager.GetWord(local.key, type); EditorGUILayout.HelpBox(helpTxt, MessageType.None); } } if (local.gameObject.GetComponent <Image>() != null) { string defSp = LanguageManager.GetWord(local.key, LanguageConst.defaultLanguage); if (!string.IsNullOrEmpty(defSp)) { local.gameObject.GetComponent <Image>().sprite = SpriteHelper.GetSpriteByFullName(defSp); } foreach (LanguageConst.LanguageType type in types) { GUILayout.Label(type.ToString()); string helpTxt = LanguageManager.GetWord(local.key, type); if (string.IsNullOrEmpty(helpTxt)) { continue; } GUILayout.Label(helpTxt); GUILayout.Label(SpriteHelper.GetSpriteByFullName(helpTxt).texture, GUILayout.Width(50), GUILayout.Height(50)); } } #else EditorGUILayout.HelpBox("You need import \"DATA_GENER\" module to use this function", MessageType.Error); #endif }
private void InitSharedStyles() { m_ColorPickerBox = GetStyle("ColorPickerBox"); m_ViewBg = GetStyle("TabWindowBackground"); m_InspectorBig = GetStyle("In BigTitle"); m_MiniLabel = GetStyle("MiniLabel"); m_LargeLabel = GetStyle("LargeLabel"); m_BoldLabel = GetStyle("BoldLabel"); m_MiniBoldLabel = GetStyle("MiniBoldLabel"); m_WordWrappedLabel = GetStyle("WordWrappedLabel"); m_WordWrappedMiniLabel = GetStyle("WordWrappedMiniLabel"); m_WhiteLabel = GetStyle("WhiteLabel"); m_WhiteMiniLabel = GetStyle("WhiteMiniLabel"); m_WhiteLargeLabel = GetStyle("WhiteLargeLabel"); m_WhiteBoldLabel = GetStyle("WhiteBoldLabel"); m_MiniTextField = GetStyle("MiniTextField"); m_RadioButton = GetStyle("Radio"); m_MiniButton = GetStyle("miniButton"); m_MiniButtonLeft = GetStyle("miniButtonLeft"); m_MiniButtonMid = GetStyle("miniButtonMid"); m_MiniButtonRight = GetStyle("miniButtonRight"); m_MiniPullDown = GetStyle("MiniPullDown"); m_Toolbar = GetStyle("toolbar"); m_ContentToolbar = GetStyle("contentToolbar"); m_ToolbarButton = GetStyle("toolbarbutton"); m_ToolbarButtonLeft = GetStyle("toolbarbuttonLeft"); m_ToolbarButtonRight = GetStyle("toolbarbuttonRight"); m_ToolbarPopup = GetStyle("toolbarPopup"); m_ToolbarPopupLeft = GetStyle("toolbarPopupLeft"); m_ToolbarPopupRight = GetStyle("toolbarPopupRight"); m_ToolbarDropDown = GetStyle("toolbarDropDown"); m_ToolbarDropDownLeft = GetStyle("toolbarDropDownLeft"); m_ToolbarDropDownRight = GetStyle("toolbarDropDownRight"); m_ToolbarDropDownToggle = GetStyle("toolbarDropDownToggle"); m_ToolbarDropDownToggleRight = GetStyle("toolbarDropDownToggleRight"); m_ToolbarCreateAddNewDropDown = GetStyle("ToolbarCreateAddNewDropDown"); m_ToolbarTextField = GetStyle("toolbarTextField"); m_ToolbarLabel = GetStyle("ToolbarLabel"); m_ToolbarSearchField = GetStyle("ToolbarSeachTextField"); m_ToolbarSearchFieldPopup = GetStyle("ToolbarSeachTextFieldPopup"); m_ToolbarSearchFieldCancelButton = GetStyle("ToolbarSeachCancelButton"); m_ToolbarSearchFieldCancelButtonEmpty = GetStyle("ToolbarSeachCancelButtonEmpty"); m_SearchField = GetStyle("SearchTextField"); m_SearchFieldCancelButton = GetStyle("SearchCancelButton"); m_SearchFieldCancelButtonEmpty = GetStyle("SearchCancelButtonEmpty"); m_HelpBox = GetStyle("HelpBox"); m_FrameBox = GetStyle("FrameBox"); m_AssetLabel = GetStyle("AssetLabel"); m_AssetLabelPartial = GetStyle("AssetLabel Partial"); m_AssetLabelIcon = GetStyle("AssetLabel Icon"); m_SelectionRect = GetStyle("selectionRect"); m_ToolbarSlider = GetStyle("ToolbarSlider"); m_MinMaxHorizontalSliderThumb = GetStyle("MinMaxHorizontalSliderThumb"); m_DropDownList = GetStyle("DropDownButton"); m_MinMaxStateDropdown = GetStyle("IN MinMaxStateDropdown"); m_BoldFont = EditorResources.GetBoldFont(); m_StandardFont = EditorResources.GetNormalFont(); m_MiniFont = EditorResources.GetSmallFont(); m_MiniBoldFont = EditorResources.GetBoldFont(); m_ProgressBarBack = GetStyle("ProgressBarBack"); m_ProgressBarBar = GetStyle("ProgressBarBar"); m_ProgressBarText = GetStyle("ProgressBarText"); m_FoldoutPreDrop = GetStyle("FoldoutPreDrop"); m_FoldoutHeader = GetStyle("FoldoutHeader"); m_FoldoutHeaderIcon = GetStyle("FoldoutHeaderIcon"); m_OptionsButtonStyle = GetStyle("PaneOptions"); m_InspectorTitlebar = GetStyle("IN Title"); m_InspectorTitlebarFlat = GetStyle("IN Title Flat"); m_InspectorTitlebarText = GetStyle("IN TitleText"); m_ToggleGroup = GetStyle("BoldToggle"); m_Tooltip = GetStyle("Tooltip"); m_NotificationText = GetStyle("NotificationText"); m_NotificationBackground = GetStyle("NotificationBackground"); m_ScrollViewAlt = GetStyle("ScrollViewAlt"); // Former LookLikeControls styles m_Popup = m_LayerMaskField = GetStyle("MiniPopup"); m_TextField = m_NumberField = GetStyle("TextField"); m_BoldTextField = GetStyle("BoldTextFIeld"); m_Label = GetStyle("ControlLabel"); m_ObjectField = GetStyle("ObjectField"); m_ObjectFieldThumb = GetStyle("ObjectFieldThumb"); m_ObjectFieldButton = GetStyle("ObjectFieldButton"); m_ObjectFieldMiniThumb = GetStyle("ObjectFieldMiniThumb"); m_Toggle = GetStyle("Toggle"); m_ToggleMixed = GetStyle("ToggleMixed"); m_ColorField = GetStyle("ColorField"); m_Foldout = GetStyle("Foldout"); m_FoldoutSelected = GUIStyle.none; m_IconButton = GetStyle("IconButton"); m_TextFieldDropDown = GetStyle("TextFieldDropDown"); m_TextFieldDropDownText = GetStyle("TextFieldDropDownText"); m_OverrideMargin = GetStyle("OverrideMargin"); m_LinkLabel = GetStyle("LinkLabel"); // Match selection color which works nicely for both light and dark skins m_TextArea = new GUIStyle(m_TextField) { wordWrap = true }; m_InspectorDefaultMargins = new GUIStyle { padding = new RectOffset( InspectorWindow.kInspectorPaddingLeft, InspectorWindow.kInspectorPaddingRight, InspectorWindow.kInspectorPaddingTop, 0) }; // For the full width margins, use padding from right side in both sides, // though adjust for overdraw by adding one in left side to get even margins. m_InspectorFullWidthMargins = new GUIStyle { padding = new RectOffset( InspectorWindow.kInspectorPaddingRight + 1, InspectorWindow.kInspectorPaddingRight, 0, 0) }; m_DefaultContentMargins = new GUIStyle { padding = new RectOffset(4, 4, 4, 4) }; // Derive centered grey mini label from base minilabel m_CenteredGreyMiniLabel = new GUIStyle(m_MiniLabel) { alignment = TextAnchor.MiddleCenter, normal = { textColor = Color.grey } }; }
private void Awake() { _logoTexture = _logoTexture ?? EditorResources.Load <Texture2D>("Assets/_AppCore/Sprites/Editor/settings.png"); }
public static void OpenNetConst() { AssetDatabase.OpenAsset(EditorResources.GetAsset <Object>("ServerConst", "ResetCore/NetPost/")); }
static void OpenEventConstFile() { Object obj = EditorResources.GetAsset <Object>("EventsConst", "ResetCore", "Core", "Event") as Object; AssetDatabase.OpenAsset(obj); }
public static bool ValidateBuildAll() { return(EditorResources.FindAllAssetsOfType <BuildDefinition>().Length > 0); }
static bool IsBuiltinResource(Texture icon) { return(AssetDatabase.GetAssetPath(icon) != EditorResources.GetAssetPath(icon)); }
private static T ConvertToPackageAsset <T>(T bundleAsset) where T : Object { var partialPath = EditorResources.GetAssetPath(bundleAsset); return(LoadResource <T>(partialPath)); }
public TypePropertyEditor() { this.InlineEditorTemplate = (DataTemplate)EditorResources.GetResources()["TypeBrowser_InlineEditorTemplate"]; }
public VersionPropertyValueEditor() { this.InlineEditorTemplate = EditorResources.GetResources()["VersionPropertyValueEditorTemplate"] as DataTemplate; }
public VBIdentifierNameEditor() { this.InlineEditorTemplate = (DataTemplate)EditorResources.GetResources()["VBIdentifierNameEditorTemplate"]; }