parent
f001034025
commit
3df1b48fea
@ -1,10 +1,28 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CMSGame
|
||||
{
|
||||
public static class NodeExtension
|
||||
{
|
||||
public static T GetUniqueNode<T>(this Node node, string uniqueName) where T : Node
|
||||
public static T GetAutoloadNode<T>(this Node parent, string autoloadName) where T : Node
|
||||
{
|
||||
return node.GetNode<T>($"%{uniqueName}");
|
||||
return parent.GetNode<T>($"/root/{autoloadName}");
|
||||
}
|
||||
|
||||
public static void GetAutoloadNode<T>(this Node parent, ref T node, string autoloadName) where T : Node
|
||||
{
|
||||
node = parent.GetAutoloadNode<T>(autoloadName);
|
||||
}
|
||||
|
||||
public static T GetUniqueNode<T>(this Node parent, string uniqueName) where T : Node
|
||||
{
|
||||
return parent.GetNode<T>($"%{uniqueName}");
|
||||
}
|
||||
|
||||
public static void GetUniqueNode<T>(this Node parent, ref T node, string uniqueName) where T : Node
|
||||
{
|
||||
node = parent.GetUniqueNode<T>(uniqueName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue