mirror of
https://github.com/DCFApixels/DragonECS-Unity.git
synced 2026-04-21 20:15:56 +08:00
fix icons
This commit is contained in:
parent
cd578c7096
commit
7ac04c71b6
@ -390,19 +390,10 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region small elems
|
#region small elems
|
||||||
public static void DrawTextureSoftColor(Rect position, Texture texture)
|
|
||||||
{
|
|
||||||
DrawTex(position, texture, GUI.color * 0.5f);
|
|
||||||
}
|
|
||||||
public static void DrawTexture(Rect position, Texture texture)
|
public static void DrawTexture(Rect position, Texture texture)
|
||||||
{
|
{
|
||||||
DrawTex(position, texture, GUI.color);
|
DrawTex(position, texture, GUI.color);
|
||||||
}
|
}
|
||||||
public static void DrawRectSoftColor(Rect position, Color color)
|
|
||||||
{
|
|
||||||
Texture texture = UnityEditorUtility.GetWhiteTexture();
|
|
||||||
DrawTex(position, texture, GUI.color * color * 0.5f);
|
|
||||||
}
|
|
||||||
public static void DrawRect(Rect position, Color color)
|
public static void DrawRect(Rect position, Color color)
|
||||||
{
|
{
|
||||||
Texture texture = UnityEditorUtility.GetWhiteTexture();
|
Texture texture = UnityEditorUtility.GetWhiteTexture();
|
||||||
@ -410,13 +401,17 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
}
|
}
|
||||||
private static void DrawTex(Rect position, Texture texture, Color color)
|
private static void DrawTex(Rect position, Texture texture, Color color)
|
||||||
{
|
{
|
||||||
GUI.DrawTexture(position, texture, ScaleMode.ScaleAndCrop, true);
|
//GUI.DrawTexture(position, texture, ScaleMode.StretchToFill, true, 0, color, 0, 0);
|
||||||
|
using (SetColor(color))
|
||||||
if (Event.current.type == EventType.Repaint)
|
|
||||||
{
|
{
|
||||||
//Graphics.DrawTexture(position, texture, new Rect(0f, 0f, 1f, 1f), 0, 0, 0, 0, GUI.color * color, null);
|
GUI.DrawTexture(position, texture, ScaleMode.StretchToFill);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if (Event.current.type == EventType.Repaint)
|
||||||
|
//{
|
||||||
|
// Graphics.DrawTexture(position, texture, new Rect(0f, 0f, 1f, 1f), 0, 0, 0, 0, GUI.color * color, null);
|
||||||
|
//}
|
||||||
|
|
||||||
//var x = GUIClip.visibleRect;
|
//var x = GUIClip.visibleRect;
|
||||||
//Rect visibleRect = new Rect(0, 0, scrollViewWidth, scrollViewHeight); // свой прямоугольник обрезки
|
//Rect visibleRect = new Rect(0, 0, scrollViewWidth, scrollViewHeight); // свой прямоугольник обрезки
|
||||||
//GUI.BeginClip(visibleRect);
|
//GUI.BeginClip(visibleRect);
|
||||||
@ -436,7 +431,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
using (SetColor(GUI.enabled ? GUI.color : GUI.color * new Color(1f, 1f, 1f, 0.4f)))
|
using (SetColor(GUI.enabled ? GUI.color : GUI.color * new Color(1f, 1f, 1f, 0.4f)))
|
||||||
{
|
{
|
||||||
GUI.Label(position, UnityEditorUtility.GetLabel(string.Empty, tooltip));
|
GUI.Label(position, UnityEditorUtility.GetLabel(string.Empty, tooltip));
|
||||||
DrawTextureSoftColor(RectUtility.AddPadding(position, iconPadding), icon);
|
DrawTexture(RectUtility.AddPadding(position, iconPadding), icon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static (bool, bool) IconButtonGeneric(Rect position)
|
public static (bool, bool) IconButtonGeneric(Rect position)
|
||||||
@ -691,7 +686,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
w.a = 0.6f;
|
w.a = 0.6f;
|
||||||
Color b = Color.black;
|
Color b = Color.black;
|
||||||
b.a = 0.55f;
|
b.a = 0.55f;
|
||||||
DrawRectSoftColor(position, w);
|
DrawRect(position, w);
|
||||||
|
|
||||||
var (idRect, genWorldRect) = RectUtility.HorizontalSliceLerp(position, 0.4f);
|
var (idRect, genWorldRect) = RectUtility.HorizontalSliceLerp(position, 0.4f);
|
||||||
var (genRect, worldRect) = RectUtility.HorizontalSliceLerp(genWorldRect, 0.5f);
|
var (genRect, worldRect) = RectUtility.HorizontalSliceLerp(genWorldRect, 0.5f);
|
||||||
@ -699,9 +694,9 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
idRect = RectUtility.AddPadding(idRect, 2, 1, 0, 0);
|
idRect = RectUtility.AddPadding(idRect, 2, 1, 0, 0);
|
||||||
genRect = RectUtility.AddPadding(genRect, 1, 1, 0, 0);
|
genRect = RectUtility.AddPadding(genRect, 1, 1, 0, 0);
|
||||||
worldRect = RectUtility.AddPadding(worldRect, 1, 2, 0, 0);
|
worldRect = RectUtility.AddPadding(worldRect, 1, 2, 0, 0);
|
||||||
DrawRectSoftColor(idRect, b);
|
DrawRect(idRect, b);
|
||||||
DrawRectSoftColor(genRect, b);
|
DrawRect(genRect, b);
|
||||||
DrawRectSoftColor(worldRect, b);
|
DrawRect(worldRect, b);
|
||||||
|
|
||||||
GUIStyle style = UnityEditorUtility.GetInputFieldCenterAnhor();
|
GUIStyle style = UnityEditorUtility.GetInputFieldCenterAnhor();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user