mirror of
https://github.com/DCFApixels/DragonECS-Unity.git
synced 2025-09-18 01:54:35 +08:00
cleanup
This commit is contained in:
parent
7ffeac0fc8
commit
330834b07b
@ -192,7 +192,6 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
optionButton.yMax += HeadIconsRect.height;
|
optionButton.yMax += HeadIconsRect.height;
|
||||||
optionButton.xMin = optionButton.xMax - 64;
|
optionButton.xMin = optionButton.xMax - 64;
|
||||||
optionButton.center += Vector2.up * Padding * 1f;
|
optionButton.center += Vector2.up * Padding * 1f;
|
||||||
//EditorGUI.DrawRect(optionButton, Color.black);
|
|
||||||
if (EcsGUI.HitTest(optionButton) && Event.current.type == EventType.MouseUp)
|
if (EcsGUI.HitTest(optionButton) && Event.current.type == EventType.MouseUp)
|
||||||
{
|
{
|
||||||
componentProperty.isExpanded = !componentProperty.isExpanded;
|
componentProperty.isExpanded = !componentProperty.isExpanded;
|
||||||
@ -209,7 +208,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
if (UnityEditorUtility.TryGetScriptAsset(componentType, out MonoScript script))
|
if (UnityEditorUtility.TryGetScriptAsset(componentType, out MonoScript script))
|
||||||
{
|
{
|
||||||
optionButton = HeadIconsRect.MoveTo(optionButton.center - (Vector2.right * optionButton.width));
|
optionButton = HeadIconsRect.MoveTo(optionButton.center - (Vector2.right * optionButton.width));
|
||||||
EcsGUI.ScriptAssetButton(optionButton).Execute(script);
|
EcsGUI.ScriptAssetButton(optionButton, script);
|
||||||
}
|
}
|
||||||
//Description icon
|
//Description icon
|
||||||
if (string.IsNullOrEmpty(description) == false)
|
if (string.IsNullOrEmpty(description) == false)
|
||||||
|
@ -181,7 +181,6 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
optionButton.yMax += HeadIconsRect.height;
|
optionButton.yMax += HeadIconsRect.height;
|
||||||
optionButton.xMin = optionButton.xMax - 64;
|
optionButton.xMin = optionButton.xMax - 64;
|
||||||
optionButton.center += Vector2.up * padding * 2f;
|
optionButton.center += Vector2.up * padding * 2f;
|
||||||
//EditorGUI.DrawRect(optionButton, Color.black);
|
|
||||||
if (EcsGUI.HitTest(optionButton) && Event.current.type == EventType.MouseUp)
|
if (EcsGUI.HitTest(optionButton) && Event.current.type == EventType.MouseUp)
|
||||||
{
|
{
|
||||||
componentProperty.isExpanded = !componentProperty.isExpanded;
|
componentProperty.isExpanded = !componentProperty.isExpanded;
|
||||||
@ -202,7 +201,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
if (UnityEditorUtility.TryGetScriptAsset(componentType, out MonoScript script))
|
if (UnityEditorUtility.TryGetScriptAsset(componentType, out MonoScript script))
|
||||||
{
|
{
|
||||||
optionButton = HeadIconsRect.MoveTo(optionButton.center - (Vector2.right * optionButton.width));
|
optionButton = HeadIconsRect.MoveTo(optionButton.center - (Vector2.right * optionButton.width));
|
||||||
EcsGUI.ScriptAssetButton(optionButton).Execute(script);
|
EcsGUI.ScriptAssetButton(optionButton, script);
|
||||||
}
|
}
|
||||||
//Description icon
|
//Description icon
|
||||||
if (string.IsNullOrEmpty(description) == false)
|
if (string.IsNullOrEmpty(description) == false)
|
||||||
|
@ -250,7 +250,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static ScriptAssetButtonCommand ScriptAssetButton(Rect position)
|
public static ScriptAssetButtonCommand ScriptAssetButton(Rect position, MonoScript script)
|
||||||
{
|
{
|
||||||
var current = Event.current;
|
var current = Event.current;
|
||||||
|
|
||||||
@ -265,13 +265,11 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
{
|
{
|
||||||
if (current.type == EventType.MouseUp)
|
if (current.type == EventType.MouseUp)
|
||||||
{
|
{
|
||||||
//EditorGUIUtility.PingObject(script);
|
EditorGUIUtility.PingObject(script);
|
||||||
return new ScriptAssetButtonCommand(ScriptAssetButtonCommand.Command.OneClick);
|
|
||||||
}
|
}
|
||||||
else if (current.type == EventType.MouseDown && current.clickCount >= 2)
|
else if (current.type == EventType.MouseDown && current.clickCount >= 2)
|
||||||
{
|
{
|
||||||
//AssetDatabase.OpenAsset(script);
|
AssetDatabase.OpenAsset(script);
|
||||||
return new ScriptAssetButtonCommand(ScriptAssetButtonCommand.Command.DoubleClick);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return default;
|
return default;
|
||||||
@ -627,7 +625,6 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
optionButton.yMax += HeadIconsRect.height;
|
optionButton.yMax += HeadIconsRect.height;
|
||||||
optionButton.xMin = optionButton.xMax - 64;
|
optionButton.xMin = optionButton.xMax - 64;
|
||||||
optionButton.center += Vector2.up * padding * 2f;
|
optionButton.center += Vector2.up * padding * 2f;
|
||||||
//EditorGUI.DrawRect(optionButton, Color.black);
|
|
||||||
if (HitTest(optionButton) && Event.current.type == EventType.MouseUp)
|
if (HitTest(optionButton) && Event.current.type == EventType.MouseUp)
|
||||||
{
|
{
|
||||||
ref bool isExpanded = ref expandMatrix.Down();
|
ref bool isExpanded = ref expandMatrix.Down();
|
||||||
@ -649,7 +646,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
if (UnityEditorUtility.TryGetScriptAsset(componentType, out MonoScript script))
|
if (UnityEditorUtility.TryGetScriptAsset(componentType, out MonoScript script))
|
||||||
{
|
{
|
||||||
optionButton = HeadIconsRect.MoveTo(optionButton.center - (Vector2.right * optionButton.width));
|
optionButton = HeadIconsRect.MoveTo(optionButton.center - (Vector2.right * optionButton.width));
|
||||||
ScriptAssetButton(optionButton).Execute(script);
|
ScriptAssetButton(optionButton, script);
|
||||||
}
|
}
|
||||||
//Description icon
|
//Description icon
|
||||||
if (string.IsNullOrEmpty(meta.Description.Text) == false)
|
if (string.IsNullOrEmpty(meta.Description.Text) == false)
|
||||||
|
Loading…
Reference in New Issue
Block a user