Skip to content

Commit

Permalink
Added more crap
Browse files Browse the repository at this point in the history
Don't know if it works or not but good luck.
  • Loading branch information
LeCloutPanda committed Apr 3, 2024
1 parent 945c7aa commit d1f20e6
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 2 deletions.
19 changes: 19 additions & 0 deletions ProtoFlux/Interaction/FindGrabbableFromSlot.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using FrooxEngine;
using ProtoFlux.Core;
using ProtoFlux.Runtimes.Execution;

namespace ProtoFlux.Users.Avatar
{
[ContinuouslyChanging]
[NodeCategory("ProtoFlux/Obsidian/Avatar")]
public class FindGrabbableFromSlot : ObjectFunctionNode<ExecutionContext, IGrabbable>
{
public readonly ObjectInput<Slot> Slot;

protected override IGrabbable Compute(ExecutionContext context)
{
Slot slot = Slot.Evaluate(context);
return slot == null ? null : slot.GetComponentInParents<Grabbable>();
}
}
}
33 changes: 33 additions & 0 deletions ProtoFlux/Slots/CreateEmptySlot.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using FrooxEngine;
using FrooxEngine.ProtoFlux;
using ProtoFlux.Core;
using ProtoFlux.Runtimes.Execution;

namespace ProtoFlux.Users.Avatar
{
[ContinuouslyChanging]
[NodeCategory("ProtoFlux/Obsidian/Slots")]
public class CreateEmptySlot : ActionBreakableFlowNode<FrooxEngineContext>
{
public readonly ObjectInput<Slot> Parent;
public readonly ObjectInput<string> Name;
public readonly ObjectInput<string> Tag;
public readonly ValueInput<bool> Persistent;
public readonly ValueInput<bool> Active;

public readonly ObjectOutput<Slot> Slot;

protected override bool Do(FrooxEngineContext context)
{
Slot slot = context.LocalUser.LocalUserSpace.AddSlot();
slot.Parent = Parent.Evaluate(context);
slot.Name = Name.Evaluate(context);
slot.Tag = Tag.Evaluate(context);
slot.PersistentSelf = Persistent.Evaluate(context);
slot.ActiveSelf = Active.Evaluate(context);

Slot.Write(slot, context);
return true;
}
}
}
24 changes: 24 additions & 0 deletions ProtoFlux/Users/Avatar/AvatarRootSlot.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.Collections.Generic;
using FrooxEngine;
using FrooxEngine.CommonAvatar;
using ProtoFlux.Core;
using ProtoFlux.Runtimes.Execution;

namespace ProtoFlux.Users.Avatar
{
[ContinuouslyChanging]
[NodeCategory("ProtoFlux/Obsidian/Avatar")]
public class AvatarRootSlot : ObjectFunctionNode<ExecutionContext, Slot>
{
public readonly ObjectInput<User> User;

protected override Slot Compute(ExecutionContext context)
{
User user = User.Evaluate(context);
Slot slot = user.Root.Slot;
List<AvatarRoot> list = new List<AvatarRoot>();
slot.GetFirstDirectComponentsInChildren(list);
return user == null || list.Count == 0 ? null : list[0].Slot;
}
}
}
4 changes: 2 additions & 2 deletions ProtoFlux/Users/Status/IsUserInSeatedMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
using ProtoFlux.Core;
using ProtoFlux.Runtimes.Execution;

namespace FrooxEngine.ProtoFlux.Locomotion
namespace FrooxEngine.ProtoFlux.Status
{
[ContinuouslyChanging]
[NodeCategory("ProtoFlux/Obsidian/Locomotion")]
[NodeCategory("ProtoFlux/Obsidian/Status")]
public class IsUserInSeatedModeNode : ValueFunctionNode<ExecutionContext, bool>
{
public readonly ObjectInput<User> User;
Expand Down

0 comments on commit d1f20e6

Please sign in to comment.