// Function is called in the OnClick event of the UI buttons in the inspector public void SelectTree(int id) { lSystem.AssignTree(id); // Fetches the tree grammars based on the ID selected if (id < 6) { angle = lSystem.SelectedPresetTree.angle; length = lSystem.SelectedPresetTree.length; } else { angle = lSystem.SelectedStocTree.angle; length = lSystem.SelectedStocTree.length; } nodeWriting = CheckWritingType(); currentString = LSystem.sentence; // Sentence is assiged to another variable GenerateTree(); }