コード例 #1
0
ファイル: NodeType.cs プロジェクト: peperbol/OCDgame
    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;
    }
コード例 #2
0
ファイル: IngameDelay.cs プロジェクト: peperbol/OCDgame
 public void Setup(IngameDelayNode node, float delay)
 {
     this.node = node;
     this.delay = delay;
 }
コード例 #3
0
ファイル: SequenceEditor.cs プロジェクト: peperbol/OCDgame
    private float DrawIngameDelayNode(IngameDelayNode node, float x, float y)
    {
        float fieldwidth = NODEWIDTH - PADDING * 2;

        EditorGUI.LabelField(new Rect(x + PADDING, y, fieldwidth * LABELWIDTH, FIELDHEIGHT), "Seconds");
        node.Delay = EditorGUI.FloatField(new Rect(x + PADDING + fieldwidth * LABELWIDTH, y, fieldwidth - fieldwidth * LABELWIDTH, FIELDHEIGHT), node.Delay);
        y += FIELDHEIGHT + PADDING;

        node.FocusIngame = EditorGUI.Toggle(new Rect(x + PADDING, y, SMALLELEMENTWIDTH, FIELDHEIGHT), node.FocusIngame);
        EditorGUI.LabelField(new Rect(x + PADDING + SMALLELEMENTWIDTH, y, fieldwidth - SMALLELEMENTWIDTH, FIELDHEIGHT), "Focus stays ingame");
        y += FIELDHEIGHT + PADDING;

        node.TimeGoesOn = EditorGUI.Toggle(new Rect(x + PADDING, y, SMALLELEMENTWIDTH, FIELDHEIGHT), node.TimeGoesOn);
        EditorGUI.LabelField(new Rect(x + PADDING + SMALLELEMENTWIDTH, y, fieldwidth - SMALLELEMENTWIDTH, FIELDHEIGHT), "Timeclock goes on");
        y += FIELDHEIGHT + PADDING;

        return y;
    }