diff --git a/NEOSPlus/Logix/Slots/GetAllChildren.cs b/NEOSPlus/Logix/Slots/GetAllChildren.cs new file mode 100644 index 0000000..e0f2cc9 --- /dev/null +++ b/NEOSPlus/Logix/Slots/GetAllChildren.cs @@ -0,0 +1,27 @@ +using FrooxEngine; +using FrooxEngine.LogiX; +using System.Collections.Generic; + +namespace FrooxEngine.LogiX.Slots; + +[Category("LogiX/NeosPlus/Slots")] +[NodeName("Get All Children")] +public class GetAllChildren : LogixNode +{ + public readonly Input Instance; + + public readonly Output> FoundChildren; + + protected override void OnEvaluate() + { + Slot slot = Instance.Evaluate(); + if (slot != null) + { + FoundChildren.Value = slot.GetAllChildren(); + } + else + { + FoundChildren.Value = null; + } + } +} \ No newline at end of file diff --git a/NEOSPlus/Logix/Slots/GetAllParents.cs b/NEOSPlus/Logix/Slots/GetAllParents.cs new file mode 100644 index 0000000..918185e --- /dev/null +++ b/NEOSPlus/Logix/Slots/GetAllParents.cs @@ -0,0 +1,29 @@ +using FrooxEngine; +using FrooxEngine.LogiX; +using System.Collections.Generic; + +namespace FrooxEngine.LogiX.Slots; + +[Category("LogiX/NeosPlus/Slots")] +[NodeName("Get All Parents")] +public class GetAllParents : LogixNode +{ + public readonly Input Instance; + + public readonly Output> FoundParents; + + protected override void OnEvaluate() + { + Slot slot = Instance.Evaluate(); + if (slot != null) + { + List list = new List(); + slot.GetAllParents(list); + FoundParents.Value = list; + } + else + { + FoundParents.Value = null; + } + } +} \ No newline at end of file diff --git a/NEOSPlus/Logix/Slots/GetChildrenWithName.cs b/NEOSPlus/Logix/Slots/GetChildrenWithName.cs new file mode 100644 index 0000000..b35d65c --- /dev/null +++ b/NEOSPlus/Logix/Slots/GetChildrenWithName.cs @@ -0,0 +1,53 @@ +using FrooxEngine; +using FrooxEngine.LogiX; +using FrooxEngine.LogiX.WorldModel; +using System.Collections.Generic; + +namespace FrooxEngine.LogiX.Slots; + +[Category("LogiX/NeosPlus/Slots")] +[NodeName("Get Children With Name")] +public class GetChildrenWithName : LogixNode +{ + public readonly Input Instance; + + public readonly Input Name; + + public readonly Output> FoundChildren; + + private void InternalGetChildrenWithName(Slot s, List slots, string name) + { + if (s.Name == name) + { + slots.Add(s); + } + if (s.ChildrenCount <= 0) + { + return; + } + foreach (Slot child in s.Children) + { + InternalGetChildrenWithName(child, slots, name); + } + + } + + protected override void OnEvaluate() + { + Slot slot = Instance.Evaluate(); + string name = Name.Evaluate(); + if (slot != null && name != null) + { + List list = new List(); + foreach (Slot child in slot.Children) + { + InternalGetChildrenWithName(child, list, name); + } + FoundChildren.Value = list; + } + else + { + FoundChildren.Value = null; + } + } +} \ No newline at end of file diff --git a/NEOSPlus/Logix/Slots/GetChildrenWithTag.cs b/NEOSPlus/Logix/Slots/GetChildrenWithTag.cs index 3a8a2a1..7a585bc 100644 --- a/NEOSPlus/Logix/Slots/GetChildrenWithTag.cs +++ b/NEOSPlus/Logix/Slots/GetChildrenWithTag.cs @@ -2,6 +2,8 @@ using FrooxEngine.LogiX; using System.Collections.Generic; +namespace FrooxEngine.LogiX.Slots; + [Category("LogiX/NeosPlus/Slots")] [NodeName("Get Children With Tag")] public class GetChildrenWithTag : LogixNode diff --git a/NEOSPlus/Logix/Slots/GetParentsWithName.cs b/NEOSPlus/Logix/Slots/GetParentsWithName.cs new file mode 100644 index 0000000..f202b7d --- /dev/null +++ b/NEOSPlus/Logix/Slots/GetParentsWithName.cs @@ -0,0 +1,46 @@ +using FrooxEngine; +using FrooxEngine.LogiX; +using FrooxEngine.LogiX.WorldModel; +using System.Collections.Generic; + +namespace FrooxEngine.LogiX.Slots; + +[Category("LogiX/NeosPlus/Slots")] +[NodeName("Get Parents With Name")] +public class GetParentsWithName : LogixNode +{ + public readonly Input Instance; + + public readonly Input Name; + + public readonly Output> FoundParents; + + private void InternalGetParentsWithName(Slot s, List slots, string name) + { + if (s.Name == name) + { + slots.Add(s); + } + if (s.Parent == null) + { + return; + } + InternalGetParentsWithName(s.Parent, slots, name); + } + + protected override void OnEvaluate() + { + Slot slot = Instance.Evaluate(); + string name = Name.Evaluate(); + if (slot != null && name != null && slot.Parent != null) + { + List list = new List(); + InternalGetParentsWithName(slot.Parent, list, name); + FoundParents.Value = list; + } + else + { + FoundParents.Value = null; + } + } +} \ No newline at end of file diff --git a/NEOSPlus/Logix/Slots/GetParentsWithTag.cs b/NEOSPlus/Logix/Slots/GetParentsWithTag.cs new file mode 100644 index 0000000..3b3b09a --- /dev/null +++ b/NEOSPlus/Logix/Slots/GetParentsWithTag.cs @@ -0,0 +1,46 @@ +using FrooxEngine; +using FrooxEngine.LogiX; +using FrooxEngine.LogiX.WorldModel; +using System.Collections.Generic; + +namespace FrooxEngine.LogiX.Slots; + +[Category("LogiX/NeosPlus/Slots")] +[NodeName("Get Parents With Tag")] +public class GetParentsWithTag : LogixNode +{ + public readonly Input Instance; + + public readonly Input Tag; + + public readonly Output> FoundParents; + + private void InternalGetParentsWithTag(Slot s, List slots, string tag) + { + if (s.Tag == tag) + { + slots.Add(s); + } + if (s.Parent == null) + { + return; + } + InternalGetParentsWithTag(s.Parent, slots, tag); + } + + protected override void OnEvaluate() + { + Slot slot = Instance.Evaluate(); + string tag = Tag.Evaluate(); + if (slot != null && tag != null && slot.Parent != null) + { + List list = new List(); + InternalGetParentsWithTag(slot.Parent, list, tag); + FoundParents.Value = list; + } + else + { + FoundParents.Value = null; + } + } +} \ No newline at end of file diff --git a/NEOSPlus/NEOSPlus.csproj b/NEOSPlus/NEOSPlus.csproj index 2896afb..347c3c3 100644 --- a/NEOSPlus/NEOSPlus.csproj +++ b/NEOSPlus/NEOSPlus.csproj @@ -17,6 +17,7 @@ /mnt/LocalDisk/SteamLibrary/steamapps/common/NeosVR/ C:\Neos\app\ E:\Neos\app\ + G:\Neos\app\ E:\SteamLibrary/steamapps/common/NeosVR/