-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Nodes: FindGrabbableFromSlot.cs AvatarRootSlot.cs CreateEmptySlot.cs #17
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Binding
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using FrooxEngine;
using ProtoFlux.Core;
using ProtoFlux.Runtimes.Execution;
using ProtoFlux.Users.Avatar;
[Category(new string[] { "ProtoFlux/Runtimes/Execution/Nodes/Obsidian/Avatar" })]
public class FindGrabbableFromSlotBinding : FrooxEngine.ProtoFlux.Runtimes.Execution.ValueFunctionNode<ExecutionContext, IGrabbable>
{
public readonly SyncRef<INodeObjectOutput<Slot>> Slot;
public override Type NodeType => typeof(FindGrabbableFromSlot);
public FindGrabbableFromSlot TypedNodeInstance { get; private set; }
public override INode NodeInstance => TypedNodeInstance;
public override int NodeInputCount => base.NodeInputCount + 1;
public override N Instantiate<N>()
{
if (TypedNodeInstance != null)
{
throw new InvalidOperationException("Node has already been instantiated");
}
FindGrabbableFromSlot findGrabbableFromSlotInstance = (TypedNodeInstance = new FindGrabbableFromSlot());
return findGrabbableFromSlotInstance as N;
}
protected override void AssociateInstanceInternal(INode node)
{
if (node is FindGrabbableFromSlot typedNodeInstance)
{
TypedNodeInstance = typedNodeInstance;
return;
}
throw new ArgumentException("Node instance is not of type " + typeof(FindGrabbableFromSlot));
}
public override void ClearInstance()
{
TypedNodeInstance = null;
}
protected override ISyncRef GetInputInternal(ref int index)
{
ISyncRef inputInternal = base.GetInputInternal(ref index);
if (inputInternal != null)
{
return inputInternal;
}
if (index == 0)
{
return Slot;
}
index -= 1;
return null;
}
}
ProtoFlux/Slots/CreateEmptySlot.cs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using System;
using FrooxEngine;
using FrooxEngine.ProtoFlux;
using FrooxEngine.ProtoFlux.Runtimes.Execution;
using ProtoFlux.Core;
using ProtoFlux.Users.Avatar;
[Category(new string[] { "ProtoFlux/Runtimes/Execution/Nodes/Obsidian/Slots" })]
public class CreateEmptySlotBinding : ActionBreakableFlowNode<FrooxEngineContext>
{
public readonly SyncRef<INodeObjectOutput<Slot>> Parent;
public readonly SyncRef<INodeObjectOutput<string>> Name;
public readonly SyncRef<INodeObjectOutput<string>> Tag;
public readonly SyncRef<INodeValueOutput<bool>> Persistent;
public readonly SyncRef<INodeValueOutput<bool>> Active;
public readonly SyncRef<INodeObjectInput<Slot>> Slot;
public override Type NodeType => typeof(CreateEmptySlot);
public CreateEmptySlot TypedNodeInstance { get; private set; }
public override INode NodeInstance => TypedNodeInstance;
public override int NodeInputCount => base.NodeInputCount + 5;
public override int NodeOutputCount => base.NodeOutputCount + 1;
public override N Instantiate<N>()
{
if (TypedNodeInstance != null)
{
throw new InvalidOperationException("Node has already been instantiated");
}
TypedNodeInstance = new CreateEmptySlot();
return TypedNodeInstance as N;
}
protected override void AssociateInstanceInternal(INode node)
{
if (node is CreateEmptySlot typedNodeInstance)
{
TypedNodeInstance = typedNodeInstance;
return;
}
throw new ArgumentException("Node instance is not of type " + typeof(CreateEmptySlot));
}
public override void ClearInstance()
{
TypedNodeInstance = null;
}
protected override ISyncRef GetInputInternal(ref int index)
{
ISyncRef inputInternal = base.GetInputInternal(ref index);
if (inputInternal != null)
{
return inputInternal;
}
switch (index)
{
case 0:
return Parent;
case 1:
return Name;
case 2:
return Tag;
case 3:
return Persistent;
case 4:
return Active;
default:
index -= 5;
return null;
}
}
protected override ISyncRef GetOutputInternal(ref int index)
{
ISyncRef outputInternal = base.GetOutputInternal(ref index);
if (outputInternal != null)
{
return outputInternal;
}
if (index == 0)
{
return Slot;
}
index -= 1;
return null;
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using System;
using FrooxEngine;
using ProtoFlux.Core;
using ProtoFlux.Runtimes.Execution;
using ProtoFlux.Users.Avatar;
[Category(new string[] { "ProtoFlux/Runtimes/Execution/Nodes/Obsidian/Avatar" })]
public class AvatarRootSlotBinding : ObjectFunctionNode<ExecutionContext, Slot>
{
public readonly SyncRef<INodeObjectOutput<User>> User;
public override Type NodeType => typeof(AvatarRootSlot);
public AvatarRootSlot TypedNodeInstance { get; private set; }
public override INode NodeInstance => TypedNodeInstance;
public override int NodeInputCount => base.NodeInputCount + 1;
public override N Instantiate<N>()
{
if (TypedNodeInstance != null)
{
throw new InvalidOperationException("Node has already been instantiated");
}
TypedNodeInstance = new AvatarRootSlot();
return TypedNodeInstance as N;
}
protected override void AssociateInstanceInternal(INode node)
{
if (node is AvatarRootSlot typedNodeInstance)
{
TypedNodeInstance = typedNodeInstance;
return;
}
throw new ArgumentException("Node instance is not of type " + typeof(AvatarRootSlot));
}
public override void ClearInstance()
{
TypedNodeInstance = null;
}
protected override ISyncRef GetInputInternal(ref int index)
{
if (index == 0)
{
return User;
}
index -= 1;
return base.GetInputInternal(ref index);
}
}
Will test Nodes Later today then if they all work will merge. |
dont use bindings now since the new binding generator and can you fix the merge conflicts so i can merge this |
Don't know if it works or not but good luck.
You need to make bindings because I don't know how.