mirror of
https://github.com/DCFApixels/DragonECS-Unity.git
synced 2025-09-19 02:24:35 +08:00
Compare commits
No commits in common. "c08be8e8837885de1ad9084cf429da20ebebb1d2" and "8418c81e3481ed65942070a3a5566d6fa007199d" have entirely different histories.
c08be8e883
...
8418c81e34
@ -1,6 +1,5 @@
|
|||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
using DCFApixels.DragonECS.Unity.Internal;
|
using DCFApixels.DragonECS.Unity.Internal;
|
||||||
using System.Reflection;
|
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
@ -91,17 +90,6 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
ent = monitor.Entity;
|
ent = monitor.Entity;
|
||||||
isValide = true;
|
isValide = true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach (var beh in go.GetComponents<MonoBehaviour>())
|
|
||||||
{
|
|
||||||
if(TryFindEntlong(beh, out ent))
|
|
||||||
{
|
|
||||||
isValide = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -115,16 +103,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
ent = monitor.Entity;
|
ent = monitor.Entity;
|
||||||
isValide = true;
|
isValide = true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (TryFindEntlong(dragged, out ent))
|
|
||||||
{
|
|
||||||
isValide = true;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (isValide)
|
if (isValide)
|
||||||
{
|
{
|
||||||
@ -145,34 +124,6 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
//Event.current.Use();
|
//Event.current.Use();
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool TryFindEntlong(Object uniObj, out entlong ent)
|
|
||||||
{
|
|
||||||
var fields = uniObj.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
|
|
||||||
foreach (var field in fields)
|
|
||||||
{
|
|
||||||
if(field.FieldType == typeof(entlong))
|
|
||||||
{
|
|
||||||
ent = (entlong)field.GetValue(uniObj);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var iterator = new SerializedObject(uniObj).GetIterator();
|
|
||||||
iterator.NextVisible(true);
|
|
||||||
while (iterator.Next(true))
|
|
||||||
{
|
|
||||||
if (iterator.propertyType == SerializedPropertyType.Integer &&
|
|
||||||
iterator.propertyPath.Contains(nameof(entlong)))
|
|
||||||
{
|
|
||||||
var l = iterator.longValue;
|
|
||||||
ent = *(entlong*)&l;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ent = entlong.NULL;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
|
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
|
||||||
{
|
{
|
||||||
const float UNITY_HEIGHT_CONSTANT = 18f;
|
const float UNITY_HEIGHT_CONSTANT = 18f;
|
||||||
|
@ -277,7 +277,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
public static LabelWidthScope SetLabelWidth(float value) => new LabelWidthScope(value);
|
public static LabelWidthScope SetLabelWidth(float value) => new LabelWidthScope(value);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
//private static readonly BindingFlags fieldFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
|
private static readonly BindingFlags fieldFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
|
||||||
|
|
||||||
internal readonly static Color GrayColor = new Color32(100, 100, 100, 255);
|
internal readonly static Color GrayColor = new Color32(100, 100, 100, 255);
|
||||||
internal readonly static Color GreenColor = new Color32(75, 255, 0, 255);
|
internal readonly static Color GreenColor = new Color32(75, 255, 0, 255);
|
||||||
|
Loading…
Reference in New Issue
Block a user