DragonECS-Unity/src/Editor/SOWrappers/RefEditorWrapper.cs

34 lines
697 B
C#
Raw Normal View History

2024-03-03 22:46:26 +08:00
#if UNITY_EDITOR
using System;
using UnityEngine;
namespace DCFApixels.DragonECS.Unity.Editors
{
[Serializable]
internal class RefEditorWrapper : WrapperBase<RefEditorWrapper>
{
[SerializeReference]
public object data;
2024-03-04 03:00:45 +08:00
2024-03-03 22:46:26 +08:00
public override object Data
{
get { return data; }
}
public static RefEditorWrapper Take(object data)
{
var result = Take();
result.data = data;
2024-03-04 03:00:45 +08:00
result.SO.Update();
2024-03-03 22:46:26 +08:00
return result;
}
}
}
2024-03-04 03:00:45 +08:00
[Serializable]
public class EmptyDummy
{
public static readonly EmptyDummy Instance = new EmptyDummy();
private EmptyDummy() { }
}
2024-03-03 22:46:26 +08:00
#endif