public static Node ToNode(this NodeType type) { Node toReturn = null; switch (type) { case NodeType.End: toReturn = new Node(); break; case NodeType.OneOptionMessage: toReturn = new OneOptionMessageNode(); break; case NodeType.TwoOptionMessage: toReturn = new TwoOptionMessageNode(); break; case NodeType.FourOptionMessage: toReturn = new FourOptionMessageNode(); break; case NodeType.TextboxMessage: toReturn = new Node(); break; case NodeType.Action: toReturn = new ActionNode(); break; case NodeType.StartSequence: toReturn = new StartSequenceNode(); break; case NodeType.TimeLeap: toReturn = new TimeLeapNode(); break; case NodeType.IngameDelay: toReturn = new IngameDelayNode(); break; } return toReturn; }
private float DrawStartSequenceNode(StartSequenceNode node, float x, float y) { float fieldwidth = NODEWIDTH - PADDING * 2; EditorGUI.LabelField(new Rect(x + PADDING, y, fieldwidth * LABELWIDTH, FIELDHEIGHT), "Name"); node.SequenceName = EditorGUI.TextField(new Rect(x + PADDING + fieldwidth * LABELWIDTH, y, fieldwidth - fieldwidth * LABELWIDTH, FIELDHEIGHT), node.SequenceName); y += FIELDHEIGHT + PADDING; return y; }