Commit 42b09321 authored by Tibaos's avatar Tibaos
Browse files

initialisieren

parents
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
# Autogenerated VS/MD solution and project files
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
# Unity3D generated meta files
*.pidb.meta
# Unity3D Generated File On Crash Reports
sysinfo.txt
fileFormatVersion: 2
guid: 07fc0ab1b839d8142a8068078ac5b382
folderAsset: yes
timeCreated: 1490623427
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: fb2628b331e58da4d8fe50b1c455db18
timeCreated: 1490623442
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 113c1b862703c0145a546301a45f4909
folderAsset: yes
timeCreated: 1490623415
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class InputSystem : MonoBehaviour {
public LSystemGenerator generator;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if(Input.GetMouseButtonDown(0))
{
generator.makeSentence();
}
}
}
fileFormatVersion: 2
guid: ec6fb17361e79ae48808cc0f20bea19a
timeCreated: 1490620880
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LSystemGenerator : MonoBehaviour {
string m_sentence;
Rule m_testTree = new Rule();
public int m_maxGeneration;
// Use this for initialization
void Start () {
m_testTree.setAxiom('A');
Dictionary<char, string> temp_rules = new Dictionary<char, string>();
temp_rules.Add('A', "AB");
temp_rules.Add('B', "A");
m_testTree.setDictionary(temp_rules);
}
// Update is called once per frame
void Update () {
}
public void makeSentence()
{
m_sentence = "" + m_testTree.getAxiom();
string next_Sentence = "";
string temp;
for (int j = 0; j < m_maxGeneration; j++)
{
next_Sentence = "";
for (int i = 0; i < m_sentence.Length; i++)
{
char current = m_sentence[i];
if (m_testTree.getDictionary().TryGetValue(current, out temp))
{
next_Sentence += m_testTree.getDictionary()[current];
}
else
{
next_Sentence += "" + current;
}
}
m_sentence = next_Sentence;
}
public void makeTree()
{
}
Debug.Log(m_sentence);
}
}
fileFormatVersion: 2
guid: d14b42126f82fb74980e2795d10ca708
timeCreated: 1490371960
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Rule{
Dictionary<char, string> m_rules = new Dictionary<char, string>();
char m_axiom;
public char getAxiom()
{
if (m_axiom != null)
{
return m_axiom;
}
else
{
return 'A';
}
}
public void setAxiom(char p_axiom)
{
m_axiom = p_axiom;
}
public Dictionary<char, string> getDictionary()
{
return m_rules;
}
public void setDictionary(Dictionary<char, string> p_rules)
{
m_rules = p_rules;
}
}
fileFormatVersion: 2
guid: c33c01d10c84c6846a352536ace69624
timeCreated: 1490619483
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment