コード例 #1
0
        private void WritePushJumpStack(NodeInputExecPin pin)
        {
            if (!pinsJumpedTo.Contains(pin))
            {
                pinsJumpedTo.Add(pin);
            }

            builder.AppendLine($"{JumpStackVarName}.Push({GetExecPinStateId(pin)});");
        }
コード例 #2
0
        private void WriteGotoOutputPinIfNecessary(NodeOutputExecPin pin, NodeInputExecPin fromPin)
        {
            int fromId = GetExecPinStateId(fromPin);
            int nextId = fromId + 1;

            if (pin.OutgoingPin == null)
            {
                if (nextId != jumpStackStateId)
                {
                    WriteGotoJumpStack();
                }
            }
            else
            {
                int toId = GetExecPinStateId(pin.OutgoingPin);

                // Only write the goto if the next state is not
                // the state we want to go to.
                if (nextId != toId)
                {
                    WriteGotoInputPin(pin.OutgoingPin);
                }
            }
        }
コード例 #3
0
 private int GetExecPinStateId(NodeInputExecPin pin)
 {
     return(nodeStateIds[pin.Node][pin.Node.InputExecPins.IndexOf(pin)]);
 }
コード例 #4
0
 private void WriteGotoInputPin(NodeInputExecPin pin)
 {
     builder.AppendLine($"goto State{GetExecPinStateId(pin)};");
 }