Modelowanie_Wirtualnych_Swi.../Assets/Scripts/Turtle3D.cs
2021-05-07 21:53:42 +02:00

18 lines
824 B
C#

using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEngine;
using ConsoleLSystem;
using System;
public class Turtle3D : TurtleLSystem {
public GameObject Petal;
protected override void initLiteralInterpretation(){
turtleInterpretation = new Dictionary<string, Func<float[], Tuple<GameObject, Matrix4x4>>>();
turtleInterpretation.Add("+", (float[] args) => new Tuple<GameObject, Matrix4x4>(null, Matrix4x4.Rotate(Quaternion.AngleAxis(args[0], Vector3.back))));
turtleInterpretation.Add("-", (float[] args) => new Tuple<GameObject, Matrix4x4>(null, Matrix4x4.Rotate(Quaternion.AngleAxis(args[0], Vector3.up))));
turtleInterpretation.Add("X", (float[] args) => new Tuple<GameObject, Matrix4x4>(Petal, Matrix4x4.identity));
}
}