コード例 #1
0
 BuilderInstruction getRndInstruction(BuilderInstruction previous)
 {
     foreach (var key in linkOptions.Keys)
     {
         if (key.equals(previous))
         {
             var options = linkOptions[key];
             return(options[Random.Range(0, options.Count)]);
         }
     }
     throw new System.Exception("Could not find instruction");
 }
コード例 #2
0
    void BuildFistula()
    {
        var seg         = SpawnSegment(firstSegment, transform.position, firstSegmentFlipped);
        var instruction = new BuilderInstruction(seg);

        for (int i = 1; i < segmentsDeep; i++)
        {
            instruction = getRndInstruction(instruction);
            seg         = SpawnSegment(instruction.segment, seg.Bottom, instruction.flipped);
            seg.SpawnDirt(1);
        }
        bottom.transform.position = seg.Bottom;
    }
コード例 #3
0
 public bool equals(BuilderInstruction other) => other.segment.SegmentID == segment.SegmentID && other.flipped == flipped;