//private GameManager _manager; //public GameManager GCManager //{ // get // { // return _manager ?? (_manager = uFrameUtility.GCManager); // } //} public static void DrawTitleBar(string subTitle) { //GUI.Label(); ElementDesignerStyles.DoTilebar(subTitle); EditorGUILayout.Space(); }
public object GetImage(string name) { if (Textures.ContainsKey(name)) { return(Textures[name]); } return(ElementDesignerStyles.GetSkinTexture(name)); }
// TODO DRAWER Add tooltip parameter | Change the way it is done and separate icon from icon public void DrawLabelWithIcon(Rect rect, string label, string iconName, object style, DrawingAlignment alignment = DrawingAlignment.MiddleLeft) { var s = (GUIStyle)style; s.alignment = ((TextAnchor)(int)alignment); //GUI.Label(rect, label, s); GUI.Label(rect, new GUIContent(label, ElementDesignerStyles.GetSkinTexture(iconName)), s); }
public Vector2 CalculateImageSize(string imageName) { var image = ElementDesignerStyles.GetSkinTexture(imageName); if (image != null) { return(new Vector2(image.width, image.height)); } return(Vector2.zero); }
public static GUIStyle WithAllStates(this GUIStyle style, string textureName, Color textColor) { var state = new GUIStyleState() { background = !string.IsNullOrEmpty(textureName) ? ElementDesignerStyles.GetSkinTexture(textureName) : null, textColor = textColor }; style.normal = style.active = style.hover = style.focused = style.onNormal = style.onActive = style.onHover = style.onFocused = state; return(style); }
public static GUIStyle WithHoveredState(this GUIStyle style, string textureName, Color textColor) { var state = new GUIStyleState() { background = !string.IsNullOrEmpty(textureName) ? ElementDesignerStyles.GetSkinTexture(textureName) : null, textColor = textColor }; style.hover = style.onHover = state; return(style); }
protected override object ConstructIcon(string name, Color tint = default(Color)) { Texture2D texture = ElementDesignerStyles.GetSkinTexture(name); if (tint != default(Color)) { texture = texture.Tint(tint); } return(texture); }
protected override object ConstructIcon(string iconName, Color color = new Color()) { var texture = ElementDesignerStyles.GetSkinTexture(iconName); if (texture == null) { texture = ElementDesignerStyles.GetSkinTexture("CommandIcon"); } //if (color != default(Color)) texture = texture.Tint(color); return(texture); }
static uFrameEditorSceneManager() { // Init //SetSearchFilter(string searchFilter, SearchableEditorWindow.SearchMode searchMode, bool setAll) //texture = Resources.Load("Controller.png") as Texture2D; //AssetDatabase.LoadAssetAtPath("Assets/Images/Testicon.png", typeof(Texture2D)) as Texture2D; textureViewSI = ElementDesignerStyles.GetSkinTexture("ViewSingleInstance"); textureViewMI = ElementDesignerStyles.GetSkinTexture("ViewMultiInstance"); EditorApplication.update += RefreshSceneObjects; EditorApplication.hierarchyWindowItemOnGUI += HierarchyItemCB; }
public void QueryForItems(List <WelcomeWindowToolbarItem> items) { items.Add(new WelcomeWindowToolbarItem() { ActionTitle = "uFrame", Action = () => Application.OpenURL("http://invertgamestudios.com"), Header = ElementDesignerStyles.GetSkinTexture("splashscreen_main"), ActionArea = new Rect(3, 3, 792, 359) }); items.Add(new WelcomeWindowToolbarItem() { ActionTitle = "Graph Designer", Action = () => ElementsDesigner.Init(), Header = ElementDesignerStyles.GetSkinTexture("splashscreen_1"), ActionArea = new Rect(4, 290, 199, 65) }); items.Add(new WelcomeWindowToolbarItem() { ActionTitle = "Documentation", Action = () => uFrameHelp.ShowWindow(), Header = ElementDesignerStyles.GetSkinTexture("splashscreen_3"), ActionArea = new Rect(12, 293, 315, 63) }); items.Add(new WelcomeWindowToolbarItem() { ActionTitle = "Wiki", Action = () => Application.OpenURL("https://www.penflip.com/bartlomiejwolk/uframe-documentation"), Header = ElementDesignerStyles.GetSkinTexture("splashscreen_5"), ActionArea = new Rect(592, 281, 191, 76) }); items.Add(new WelcomeWindowToolbarItem() { ActionTitle = "Community", Action = () => Application.OpenURL("http://invertgamestudios.com/members/slackinvite"), Header = ElementDesignerStyles.GetSkinTexture("splashscreen_4"), ActionArea = new Rect(453, 295, 322, 61) }); items.Add(new WelcomeWindowToolbarItem() { ActionTitle = "Examples", Action = () => SetupDefaultProject(), Header = ElementDesignerStyles.GetSkinTexture("splashscreen_2"), ActionArea = new Rect(459, 294, 325, 63) }); }
protected override object ConstructHeaderImage(bool expanded, Color color = default(Color), string iconName = null) { Texture2D texture = ElementDesignerStyles.GetSkinTexture(string.IsNullOrEmpty(iconName) ? "Header3" : iconName); if (expanded) { texture = texture.CutTextureBottomBorder(35); } if (color != default(Color)) { texture = texture.Tint(color); } return(texture); }
protected override object ConstructTexture(ConnectorSide side, ConnectorDirection direction, bool connected, Color tint = default(Color)) { string iconBase = null; if (direction == ConnectorDirection.Input && connected) { iconBase = _filledInputIconCode; } if (direction == ConnectorDirection.Input && !connected) { iconBase = _emptyInputIconCode; } if (direction == ConnectorDirection.Output && connected) { iconBase = _filledOutputIconCode; } if (direction == ConnectorDirection.Output && !connected) { iconBase = _emptyOutputIconCode; } if (direction == ConnectorDirection.TwoWay && connected) { iconBase = _emptyTwoWayIconCode; } if (direction == ConnectorDirection.TwoWay && !connected) { iconBase = _filledTwoWayIconCode; } var baseTexture = ElementDesignerStyles.GetSkinTexture(iconBase); if (tint != default(Color)) { baseTexture = baseTexture.Tint(tint); } switch (side) { default: return(baseTexture); } return(null); }
public void OnSceneGUI() { Handles.BeginGUI(); var padding = 10f; var titleContent = new GUIContent(target.name); var subTitleContent = new GUIContent(target.GetType().Name); var titleSize = ElementDesignerStyles.ViewBarTitleStyle.CalcSize(titleContent); var subTitleSize = ElementDesignerStyles.ViewBarSubTitleStyle.CalcSize(subTitleContent); var maxTextWidth = Mathf.Max(titleSize.x, subTitleSize.x); var barWidth = (padding * 4f) + maxTextWidth + (36 * 1); var rect = new Rect(15f, 15f, barWidth, 48f); ElementDesignerStyles.DrawExpandableBox(rect, ElementDesignerStyles.SceneViewBar, ""); GUILayout.BeginArea(rect); GUILayout.BeginHorizontal(); GUILayout.Space(padding); if (GUILayout.Button(new GUIContent("", "View " + subTitleContent.text + " in Element Designer"), ElementDesignerStyles.EyeBall)) { //uFrameEditorSceneManager.NavigateBack(target as ViewBase); } GUILayout.Space(padding); GUILayout.BeginVertical(); GUILayout.Space(6f); GUILayout.Label(titleContent, ElementDesignerStyles.ViewBarTitleStyle, GUILayout.Width(maxTextWidth)); GUILayout.Label(subTitleContent, ElementDesignerStyles.ViewBarSubTitleStyle, GUILayout.Width(maxTextWidth)); GUILayout.EndVertical(); //GUILayout.Space(padding); //if (GUILayout.Button(new GUIContent("", "Move to the previous " + subTitleContent.text), ElementDesignerStyles.NavigatePreviousStyle)) //{ // uFrameEditorSceneManager.NavigatePrevious(); //} //if (GUILayout.Button(new GUIContent("","Move to the next " + subTitleContent.text), ElementDesignerStyles.NavigateNextStyle)) //{ // uFrameEditorSceneManager.NavigateNext(); //} //GUILayout.Space(padding); GUILayout.EndHorizontal(); GUILayout.EndArea(); Handles.EndGUI(); }
public Texture GetImage(string url) { Texture texture; if (ImageCache.TryGetValue(url, out texture)) { return(texture ?? ElementDesignerStyles.GetSkinTexture("LoadingImage")); } ImageCache.Add(url, null); DownloadImage(url); if (ImageCache.TryGetValue(url, out texture)) { return(texture ?? ElementDesignerStyles.GetSkinTexture("LoadingImage")); } else { return(ElementDesignerStyles.GetSkinTexture("LoadingImage")); } //return ElementDesignerStyles.ArrowDownTexture; }