feat(scripting): add mono csharp runtime foundation

This commit is contained in:
2026-03-27 13:07:39 +08:00
parent 134a80b334
commit b06932724c
33 changed files with 4227 additions and 18 deletions

View File

@@ -0,0 +1,45 @@
using XCEngine;
namespace Gameplay
{
public sealed class HierarchyProbe : MonoBehaviour
{
public GameObject ReparentTarget;
public string ObservedParentName = string.Empty;
public string ObservedFirstChildName = string.Empty;
public string ReparentedChildParentName = string.Empty;
public bool ParentLookupSucceeded;
public bool ChildLookupSucceeded;
public int ObservedChildCount;
public void Start()
{
Transform currentParent = transform.parent;
ParentLookupSucceeded = currentParent != null;
if (currentParent != null)
{
ObservedParentName = currentParent.gameObject.name;
}
ObservedChildCount = transform.childCount;
Transform firstChild = transform.GetChild(0);
ChildLookupSucceeded = firstChild != null;
if (firstChild != null)
{
ObservedFirstChildName = firstChild.gameObject.name;
if (ReparentTarget != null)
{
firstChild.SetParent(ReparentTarget.transform, true);
Transform newParent = firstChild.parent;
if (newParent != null)
{
ReparentedChildParentName = newParent.gameObject.name;
}
}
}
}
}
}