mirror of
https://github.com/DCFApixels/DragonECS-Unity.git
synced 2025-09-18 01:54:35 +08:00
update
This commit is contained in:
parent
d6190b455b
commit
b782851697
@ -65,10 +65,27 @@ namespace DCFApixels.DragonECS
|
|||||||
|
|
||||||
#region Editor
|
#region Editor
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
|
[ContextMenu("Autoset")]
|
||||||
internal void Autoset_Editor()
|
internal void Autoset_Editor()
|
||||||
{
|
{
|
||||||
_connect = GetComponentInChildren<EcsEntityConnect>();
|
foreach (var connect in GetComponentsInChildren<EcsEntityConnect>())
|
||||||
|
{
|
||||||
|
if (connect.GetComponentInParent<AutoEntityCreator>() == this)
|
||||||
|
{
|
||||||
|
_connect = connect;
|
||||||
AutoResolveWorldProviderDependensy();
|
AutoResolveWorldProviderDependensy();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
[ContextMenu("Autoset Cascade")]
|
||||||
|
internal void AutosetCascade_Editor()
|
||||||
|
{
|
||||||
|
foreach (var target in GetComponentsInChildren<AutoEntityCreator>())
|
||||||
|
{
|
||||||
|
target.Autoset_Editor();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using static UnityEngine.GraphicsBuffer;
|
||||||
|
|
||||||
namespace DCFApixels.DragonECS
|
namespace DCFApixels.DragonECS
|
||||||
{
|
{
|
||||||
@ -105,10 +107,57 @@ namespace DCFApixels.DragonECS
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Editor
|
#region Editor
|
||||||
internal void SetTemplates_Editor(MonoEntityTemplate[] tempaltes)
|
#if UNITY_EDITOR
|
||||||
|
[ContextMenu("Autoset")]
|
||||||
|
internal void Autoset_Editor()
|
||||||
{
|
{
|
||||||
_monoTemplates = tempaltes;
|
Autoset(this);
|
||||||
}
|
}
|
||||||
|
[ContextMenu("Autoset Cascade")]
|
||||||
|
internal void AutosetCascade_Editor()
|
||||||
|
{
|
||||||
|
foreach (var item in GetComponentsInChildren<EcsEntityConnect>())
|
||||||
|
{
|
||||||
|
Autoset(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
[ContextMenu("Unlink Entity")]
|
||||||
|
internal void UnlinkEntity_Editor()
|
||||||
|
{
|
||||||
|
ConnectWith(entlong.NULL);
|
||||||
|
}
|
||||||
|
[ContextMenu("Delete Entity")]
|
||||||
|
internal void DeleteEntity_Editor()
|
||||||
|
{
|
||||||
|
if (_entity.TryUnpack(out int id, out EcsWorld world))
|
||||||
|
{
|
||||||
|
world.DelEntity(id);
|
||||||
|
}
|
||||||
|
UnlinkEntity_Editor();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void Autoset(EcsEntityConnect target)
|
||||||
|
{
|
||||||
|
var result = target.MonoTemplates.Where(o => o != null).Union(GetTemplatesFor(target.transform));
|
||||||
|
|
||||||
|
target._monoTemplates = result.ToArray();
|
||||||
|
EditorUtility.SetDirty(target);
|
||||||
|
}
|
||||||
|
private static IEnumerable<MonoEntityTemplate> GetTemplatesFor(Transform parent)
|
||||||
|
{
|
||||||
|
IEnumerable<MonoEntityTemplate> result = parent.GetComponents<MonoEntityTemplate>();
|
||||||
|
for (int i = 0; i < parent.childCount; i++)
|
||||||
|
{
|
||||||
|
var child = parent.GetChild(i);
|
||||||
|
if (child.TryGetComponent<EcsEntityConnect>(out _))
|
||||||
|
{
|
||||||
|
return Enumerable.Empty<MonoEntityTemplate>();
|
||||||
|
}
|
||||||
|
result = result.Concat(GetTemplatesFor(child));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,4 +1,5 @@
|
|||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
|
using DCFApixels.DragonECS.Unity.Internal;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
@ -8,6 +9,8 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
[CanEditMultipleObjects]
|
[CanEditMultipleObjects]
|
||||||
public class AutoEntityCreatorEditor : Editor
|
public class AutoEntityCreatorEditor : Editor
|
||||||
{
|
{
|
||||||
|
private AutoEntityCreator Target => (AutoEntityCreator)target;
|
||||||
|
|
||||||
public override void OnInspectorGUI()
|
public override void OnInspectorGUI()
|
||||||
{
|
{
|
||||||
EditorGUI.BeginChangeCheck();
|
EditorGUI.BeginChangeCheck();
|
||||||
@ -21,15 +24,32 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
{
|
{
|
||||||
serializedObject.ApplyModifiedProperties();
|
serializedObject.ApplyModifiedProperties();
|
||||||
}
|
}
|
||||||
|
DrawControlButtons();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (GUILayout.Button("Autoset"))
|
private void DrawControlButtons()
|
||||||
{
|
{
|
||||||
foreach (var tr in targets)
|
float height = EcsGUI.EntityBarHeight;
|
||||||
|
Rect rect = GUILayoutUtility.GetRect(EditorGUIUtility.currentViewWidth, height);
|
||||||
|
EditorGUI.DrawRect(rect, new Color(0f, 0f, 0f, 0.1f));
|
||||||
|
rect = RectUtility.AddPadding(rect, 2f, 0f);
|
||||||
|
var (left, autosetCascadeRect) = RectUtility.HorizontalSliceRight(rect, height);
|
||||||
|
var (_, autosetRect) = RectUtility.HorizontalSliceRight(left, height);
|
||||||
|
|
||||||
|
if (EcsGUI.AutosetCascadeButton(autosetCascadeRect))
|
||||||
{
|
{
|
||||||
AutoEntityCreator creator = (AutoEntityCreator)tr;
|
foreach (AutoEntityCreator target in targets)
|
||||||
creator.Autoset_Editor();
|
{
|
||||||
EditorUtility.SetDirty(creator);
|
target.AutosetCascade_Editor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (EcsGUI.AutosetButton(autosetRect))
|
||||||
|
{
|
||||||
|
foreach (AutoEntityCreator target in targets)
|
||||||
|
{
|
||||||
|
target.Autoset_Editor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
|
using Codice.CM.Client.Differences;
|
||||||
using DCFApixels.DragonECS.Unity.Internal;
|
using DCFApixels.DragonECS.Unity.Internal;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
@ -36,7 +35,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
|
|
||||||
DrawTemplates();
|
DrawTemplates();
|
||||||
|
|
||||||
DrawButtons();
|
DrawControlButtons(targets);
|
||||||
DrawComponents(targets);
|
DrawComponents(targets);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,27 +43,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
{
|
{
|
||||||
bool isConnected = Target.Entity.TryUnpack(out int id, out short gen, out EcsWorld world);
|
bool isConnected = Target.Entity.TryUnpack(out int id, out short gen, out EcsWorld world);
|
||||||
EcsGUI.EntityStatus status = IsMultipleTargets ? EcsGUI.EntityStatus.Undefined : isConnected ? EcsGUI.EntityStatus.Alive : EcsGUI.EntityStatus.NotAlive;
|
EcsGUI.EntityStatus status = IsMultipleTargets ? EcsGUI.EntityStatus.Undefined : isConnected ? EcsGUI.EntityStatus.Alive : EcsGUI.EntityStatus.NotAlive;
|
||||||
|
EcsGUI.Layout.EntityBar(status, id, gen, world.id);
|
||||||
float width = EditorGUIUtility.currentViewWidth;
|
|
||||||
float height = EditorGUIUtility.singleLineHeight;
|
|
||||||
Rect rect = GUILayoutUtility.GetRect(width, height + 3f);
|
|
||||||
var (left, delEntityButtonRect) = RectUtility.HorizontalSliceRight(rect, height + 3);
|
|
||||||
var (entityRect, unlinkButtonRect) = RectUtility.HorizontalSliceRight(left, height + 3);
|
|
||||||
|
|
||||||
using (new EditorGUI.DisabledScope(status != EcsGUI.EntityStatus.Alive))
|
|
||||||
{
|
|
||||||
if (EcsGUI.UnlinkButton(unlinkButtonRect))
|
|
||||||
{
|
|
||||||
Target.ConnectWith(entlong.NULL);
|
|
||||||
}
|
|
||||||
if (EcsGUI.DelEntityButton(delEntityButtonRect))
|
|
||||||
{
|
|
||||||
world.DelEntity(id);
|
|
||||||
Target.ConnectWith(entlong.NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EcsGUI.DrawEntity(entityRect, status, id, gen, world.id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawTemplates()
|
private void DrawTemplates()
|
||||||
@ -82,43 +61,47 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Autoset(EcsEntityConnect target)
|
private void DrawControlButtons(EcsEntityConnect[] targets)
|
||||||
{
|
{
|
||||||
var result = target.MonoTemplates.Where(o => o != null).Union(GetTemplatesFor(target.transform));
|
float height = EcsGUI.EntityBarHeight;
|
||||||
|
Rect rect = GUILayoutUtility.GetRect(EditorGUIUtility.currentViewWidth, height);
|
||||||
target.SetTemplates_Editor(result.ToArray());
|
EditorGUI.DrawRect(rect, new Color(0f, 0f, 0f, 0.1f));
|
||||||
EditorUtility.SetDirty(target);
|
rect = RectUtility.AddPadding(rect, 2f, 0f);
|
||||||
}
|
var (_, buttonRect) = RectUtility.HorizontalSliceRight(rect, height);
|
||||||
private IEnumerable<MonoEntityTemplate> GetTemplatesFor(Transform parent)
|
if (EcsGUI.AutosetCascadeButton(buttonRect))
|
||||||
{
|
{
|
||||||
IEnumerable<MonoEntityTemplate> result = parent.GetComponents<MonoEntityTemplate>();
|
foreach (var target in targets)
|
||||||
for (int i = 0; i < parent.childCount; i++)
|
|
||||||
{
|
{
|
||||||
var child = parent.GetChild(i);
|
target.AutosetCascade_Editor();
|
||||||
if (child.TryGetComponent<EcsEntityConnect>(out _))
|
}
|
||||||
{
|
}
|
||||||
return Enumerable.Empty<MonoEntityTemplate>();
|
buttonRect = RectUtility.Move(buttonRect , - height, 0);
|
||||||
}
|
if (EcsGUI.AutosetButton(buttonRect))
|
||||||
result = result.Concat(GetTemplatesFor(child));
|
{
|
||||||
}
|
foreach (var target in targets)
|
||||||
return result;
|
{
|
||||||
}
|
target.Autoset_Editor();
|
||||||
|
}
|
||||||
private void DrawButtons()
|
}
|
||||||
{
|
using (new EditorGUI.DisabledScope(!Application.isPlaying))
|
||||||
GUILayout.BeginHorizontal();
|
{
|
||||||
if (GUILayout.Button("Autoset"))
|
buttonRect = RectUtility.Move(buttonRect, -height, 0);
|
||||||
{
|
if (EcsGUI.DelEntityButton(buttonRect))
|
||||||
Autoset(Target);
|
{
|
||||||
}
|
foreach (var target in targets)
|
||||||
if (GUILayout.Button("Autoset Cascade"))
|
{
|
||||||
{
|
target.DeleteEntity_Editor();
|
||||||
foreach (var item in Target.GetComponentsInChildren<EcsEntityConnect>())
|
}
|
||||||
{
|
}
|
||||||
Autoset(item);
|
buttonRect = RectUtility.Move(buttonRect, -height, 0);
|
||||||
|
if (EcsGUI.UnlinkButton(buttonRect))
|
||||||
|
{
|
||||||
|
foreach (var target in targets)
|
||||||
|
{
|
||||||
|
target.UnlinkEntity_Editor();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GUILayout.EndHorizontal();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawComponents(EcsEntityConnect[] targets)
|
private void DrawComponents(EcsEntityConnect[] targets)
|
||||||
|
@ -30,6 +30,8 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
private static readonly Rect RemoveButtonRect = new Rect(0f, 0f, 19f, 19f);
|
private static readonly Rect RemoveButtonRect = new Rect(0f, 0f, 19f, 19f);
|
||||||
private static readonly Rect TooltipIconRect = new Rect(0f, 0f, 19f, 19f);
|
private static readonly Rect TooltipIconRect = new Rect(0f, 0f, 19f, 19f);
|
||||||
|
|
||||||
|
public static float EntityBarHeight => EditorGUIUtility.singleLineHeight + 3f;
|
||||||
|
|
||||||
private static bool IsShowHidden
|
private static bool IsShowHidden
|
||||||
{
|
{
|
||||||
get { return DebugMonitorPrefs.instance.IsShowHidden; }
|
get { return DebugMonitorPrefs.instance.IsShowHidden; }
|
||||||
@ -111,7 +113,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
//
|
//
|
||||||
// return result;
|
// return result;
|
||||||
//}
|
//}
|
||||||
public static (bool, bool) IconButton(Rect position)
|
public static (bool, bool) IconButtonGeneric(Rect position)
|
||||||
{
|
{
|
||||||
Color dc = GUI.color;
|
Color dc = GUI.color;
|
||||||
GUI.color = Color.clear; //Хак чтобы сделать реакцию от курсора мыши без лага
|
GUI.color = Color.clear; //Хак чтобы сделать реакцию от курсора мыши без лага
|
||||||
@ -121,42 +123,46 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
var current = Event.current;
|
var current = Event.current;
|
||||||
return (GUI.enabled && HitTest(position, current), result);
|
return (GUI.enabled && HitTest(position, current), result);
|
||||||
}
|
}
|
||||||
public static bool SingleIconButton(Rect position, Texture icon)
|
public static bool IconButton(Rect position, Texture icon, float iconPadding, string description)
|
||||||
{
|
{
|
||||||
var (hover, click) = IconButton(position);
|
//var (hover, click) = IconButton(position);
|
||||||
Color color = GUI.color;
|
//Color color = GUI.color;
|
||||||
float enableMultiplier = GUI.enabled ? 1f : 0.72f;
|
//float enableMultiplier = GUI.enabled ? 1f : 0.72f;
|
||||||
|
//
|
||||||
|
//if (hover)
|
||||||
|
//{
|
||||||
|
// if (Event.current.type == EventType.Repaint)
|
||||||
|
// {
|
||||||
|
// GUI.color = Color.white * 2.2f * enableMultiplier;
|
||||||
|
// EditorStyles.helpBox.Draw(position, hover, false, false, false);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// Rect rect = RectUtility.AddPadding(position, -1f);
|
||||||
|
// GUI.color = Color.white * enableMultiplier;
|
||||||
|
// GUI.DrawTexture(rect, icon);
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// if (Event.current.type == EventType.Repaint)
|
||||||
|
// {
|
||||||
|
// GUI.color = Color.white * 1.7f * enableMultiplier;
|
||||||
|
// EditorStyles.helpBox.Draw(position, hover, false, false, false);
|
||||||
|
// }
|
||||||
|
// GUI.color = Color.white * enableMultiplier;
|
||||||
|
// GUI.DrawTexture(position, icon);
|
||||||
|
//}
|
||||||
|
//GUI.color = color;
|
||||||
|
//return click;
|
||||||
|
|
||||||
if (hover)
|
bool result = GUI.Button(position, UnityEditorUtility.GetLabel(string.Empty));
|
||||||
{
|
GUI.Label(RectUtility.AddPadding(position, iconPadding), UnityEditorUtility.GetLabel(icon, description));
|
||||||
if (Event.current.type == EventType.Repaint)
|
return result;
|
||||||
{
|
|
||||||
GUI.color = Color.white * 2.2f * enableMultiplier;
|
|
||||||
EditorStyles.helpBox.Draw(position, hover, false, false, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
Rect rect = RectUtility.AddPadding(position, -1f);
|
|
||||||
GUI.color = Color.white * enableMultiplier;
|
|
||||||
GUI.DrawTexture(rect, icon);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (Event.current.type == EventType.Repaint)
|
|
||||||
{
|
|
||||||
GUI.color = Color.white * 1.7f * enableMultiplier;
|
|
||||||
EditorStyles.helpBox.Draw(position, hover, false, false, false);
|
|
||||||
}
|
|
||||||
GUI.color = Color.white * enableMultiplier;
|
|
||||||
GUI.DrawTexture(position, icon);
|
|
||||||
}
|
|
||||||
GUI.color = color;
|
|
||||||
return click;
|
|
||||||
}
|
}
|
||||||
public static void DescriptionIcon(Rect position, string description)
|
public static void DescriptionIcon(Rect position, string description)
|
||||||
{
|
{
|
||||||
using (new ColorScope(new Color(1f, 1f, 1f, 0.8f)))
|
using (new ColorScope(new Color(1f, 1f, 1f, 0.8f)))
|
||||||
{
|
{
|
||||||
GUIContent descriptionLabel = UnityEditorUtility.GetLabel(EditorGUIUtility.IconContent("d__Help@2x").image, description);
|
GUIContent descriptionLabel = UnityEditorUtility.GetLabel(EditorGUIUtility.IconContent("d__Help").image, description);
|
||||||
GUI.Label(position, descriptionLabel, EditorStyles.boldLabel);
|
GUI.Label(position, descriptionLabel, EditorStyles.boldLabel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -164,7 +170,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
{
|
{
|
||||||
using (new ColorScope(new Color(1f, 1f, 1f, 0.8f)))
|
using (new ColorScope(new Color(1f, 1f, 1f, 0.8f)))
|
||||||
{
|
{
|
||||||
var (hover, click) = IconButton(position);
|
var (hover, click) = IconButtonGeneric(position);
|
||||||
if (hover)
|
if (hover)
|
||||||
{
|
{
|
||||||
Rect rect = RectUtility.AddPadding(position, -4f);
|
Rect rect = RectUtility.AddPadding(position, -4f);
|
||||||
@ -172,20 +178,30 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GUI.DrawTexture(position, EditorGUIUtility.IconContent("d_winbtn_win_close@2x").image);
|
GUI.DrawTexture(position, EditorGUIUtility.IconContent("d_winbtn_win_close").image);
|
||||||
}
|
}
|
||||||
return click;
|
return click;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public static bool AutosetCascadeButton(Rect position)
|
||||||
|
{
|
||||||
|
return IconButton(position, EditorGUIUtility.IconContent("d_winbtn_win_max@2x").image, 1f, "Autoset Cascade");
|
||||||
|
}
|
||||||
|
public static bool AutosetButton(Rect position)
|
||||||
|
{
|
||||||
|
return IconButton(position, EditorGUIUtility.IconContent("d_winbtn_win_restore@2x").image, 1f, "Autoset");
|
||||||
|
}
|
||||||
public static bool UnlinkButton(Rect position)
|
public static bool UnlinkButton(Rect position)
|
||||||
{
|
{
|
||||||
return SingleIconButton(position, EditorGUIUtility.IconContent("d_Unlinked@2x").image);
|
bool result = GUI.Button(position, UnityEditorUtility.GetLabel(string.Empty));
|
||||||
|
GUI.Label(RectUtility.Move(position, 0, -1f), UnityEditorUtility.GetLabel(EditorGUIUtility.IconContent("d_Unlinked").image, "Unlink Entity"));
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
public static bool DelEntityButton(Rect position)
|
public static bool DelEntityButton(Rect position)
|
||||||
{
|
{
|
||||||
return SingleIconButton(position, EditorGUIUtility.IconContent("d_winbtn_win_close@2x").image);
|
return IconButton(position, EditorGUIUtility.IconContent("d_winbtn_win_close").image, 0f, "Delete Entity");
|
||||||
}
|
}
|
||||||
public static void DrawEntity(Rect position, EntityStatus status, int id, short gen, short world)
|
public static void EntityBar(Rect position, EntityStatus status, int id, short gen, short world)
|
||||||
{
|
{
|
||||||
var (entityInfoRect, statusRect) = RectUtility.VerticalSliceBottom(position, 3f);
|
var (entityInfoRect, statusRect) = RectUtility.VerticalSliceBottom(position, 3f);
|
||||||
|
|
||||||
@ -258,11 +274,11 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
|
|
||||||
public static class Layout
|
public static class Layout
|
||||||
{
|
{
|
||||||
public static void DrawEntity(EntityStatus status, int id, short gen, short world)
|
public static void EntityBar(EntityStatus status, int id, short gen, short world)
|
||||||
{
|
{
|
||||||
float width = EditorGUIUtility.currentViewWidth;
|
float width = EditorGUIUtility.currentViewWidth;
|
||||||
float height = EditorGUIUtility.singleLineHeight;
|
float height = EntityBarHeight;
|
||||||
EcsGUI.DrawEntity(GUILayoutUtility.GetRect(width, height + 3f), status, id, gen, world);
|
EcsGUI.EntityBar(GUILayoutUtility.GetRect(width, height), status, id, gen, world);
|
||||||
}
|
}
|
||||||
public static bool AddComponentButtons()
|
public static bool AddComponentButtons()
|
||||||
{
|
{
|
||||||
|
@ -50,9 +50,9 @@ namespace DCFApixels.DragonECS.Unity.Internal
|
|||||||
{
|
{
|
||||||
return AddPadding(rect, verticalHorizontal, verticalHorizontal, verticalHorizontal, verticalHorizontal);
|
return AddPadding(rect, verticalHorizontal, verticalHorizontal, verticalHorizontal, verticalHorizontal);
|
||||||
}
|
}
|
||||||
public static Rect AddPadding(Rect rect, float vertical, float horizontal)
|
public static Rect AddPadding(Rect rect, float horizontal, float vertical)
|
||||||
{
|
{
|
||||||
return AddPadding(rect, vertical, vertical, horizontal, horizontal);
|
return AddPadding(rect, horizontal, horizontal, vertical, vertical);
|
||||||
}
|
}
|
||||||
public static Rect AddPadding(Rect rect, float left, float right, float top, float bottom)
|
public static Rect AddPadding(Rect rect, float left, float right, float top, float bottom)
|
||||||
{
|
{
|
||||||
@ -62,5 +62,14 @@ namespace DCFApixels.DragonECS.Unity.Internal
|
|||||||
rect.yMax -= bottom;
|
rect.yMax -= bottom;
|
||||||
return rect;
|
return rect;
|
||||||
}
|
}
|
||||||
|
public static Rect Move(Rect rect, Vector2 addVector)
|
||||||
|
{
|
||||||
|
rect.center += addVector;
|
||||||
|
return rect;
|
||||||
|
}
|
||||||
|
public static Rect Move(Rect rect, float addX, float addY)
|
||||||
|
{
|
||||||
|
return Move(rect, new Vector2(addX, addY));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user