This repository has been archived by the owner on Nov 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #150 from Nytra/MoreSlotCollections
added [Category("LogiX/NeosPlus/Slots")] [NodeName("Get All Children")] [Category("LogiX/NeosPlus/Slots")] [NodeName("Get All Parents")] [Category("LogiX/NeosPlus/Slots")] [NodeName("Get Children With Name")] [Category("LogiX/NeosPlus/Slots")] [NodeName("Get Children With Tag")] [Category("LogiX/NeosPlus/Slots")] [NodeName("Get Parents With Name")] [Category("LogiX/NeosPlus/Slots")] [NodeName("Get Parents With Tag")]
- Loading branch information
Showing
7 changed files
with
204 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Slot> Instance; | ||
|
||
public readonly Output<List<Slot>> FoundChildren; | ||
|
||
protected override void OnEvaluate() | ||
{ | ||
Slot slot = Instance.Evaluate(); | ||
if (slot != null) | ||
{ | ||
FoundChildren.Value = slot.GetAllChildren(); | ||
} | ||
else | ||
{ | ||
FoundChildren.Value = null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Slot> Instance; | ||
|
||
public readonly Output<List<Slot>> FoundParents; | ||
|
||
protected override void OnEvaluate() | ||
{ | ||
Slot slot = Instance.Evaluate(); | ||
if (slot != null) | ||
{ | ||
List<Slot> list = new List<Slot>(); | ||
slot.GetAllParents(list); | ||
FoundParents.Value = list; | ||
} | ||
else | ||
{ | ||
FoundParents.Value = null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Slot> Instance; | ||
|
||
public readonly Input<string> Name; | ||
|
||
public readonly Output<List<Slot>> FoundChildren; | ||
|
||
private void InternalGetChildrenWithName(Slot s, List<Slot> 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<Slot> list = new List<Slot>(); | ||
foreach (Slot child in slot.Children) | ||
{ | ||
InternalGetChildrenWithName(child, list, name); | ||
} | ||
FoundChildren.Value = list; | ||
} | ||
else | ||
{ | ||
FoundChildren.Value = null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Slot> Instance; | ||
|
||
public readonly Input<string> Name; | ||
|
||
public readonly Output<List<Slot>> FoundParents; | ||
|
||
private void InternalGetParentsWithName(Slot s, List<Slot> 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<Slot> list = new List<Slot>(); | ||
InternalGetParentsWithName(slot.Parent, list, name); | ||
FoundParents.Value = list; | ||
} | ||
else | ||
{ | ||
FoundParents.Value = null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Slot> Instance; | ||
|
||
public readonly Input<string> Tag; | ||
|
||
public readonly Output<List<Slot>> FoundParents; | ||
|
||
private void InternalGetParentsWithTag(Slot s, List<Slot> 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<Slot> list = new List<Slot>(); | ||
InternalGetParentsWithTag(slot.Parent, list, tag); | ||
FoundParents.Value = list; | ||
} | ||
else | ||
{ | ||
FoundParents.Value = null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters