Esempio n. 1
0
    // UI is updated with values from Preset Trees class
    private void AssignPUI()
    {
        axiomDisplay.text = SelectedPresetTree.axiom.ToString();

        generationDisplay.text = SelectedPresetTree.generations.ToString();
        genSlider.value        = genSlider.maxValue = SelectedPresetTree.generations; // Config values are set as max cap values for the sliders

        angleDisplay.text = SelectedPresetTree.angle.ToString();
        angleSlider.value = SelectedPresetTree.angle;

        lengthDisplay.text = SelectedPresetTree.length.ToString("f1");
        lenSlider.value    = lenSlider.maxValue = SelectedPresetTree.length;

        ruleCount  = SelectedPresetTree.rules.Count;
        Rule1.text = SelectedPresetTree.rules['F'];
        if (SelectedPresetTree.rules.Count > 1)         // If there is more than one rule count, then turns on Rule2 group
        {
            Rule2.text = SelectedPresetTree.rules['X'];
            Rule2Group.SetActive(true);
        }

        else
        {
            Rule2Group.SetActive(false);
        }

        Rule3Group.SetActive(false);
    }
Esempio n. 2
0
    // UI is updated with values from Stochastic Trees class
    private void AssignSUI()
    {
        axiomDisplay.text = SelectedStocTree.axiom.ToString();

        generationDisplay.text = SelectedStocTree.generations.ToString();
        genSlider.value        = genSlider.maxValue = SelectedStocTree.generations;

        angleDisplay.text = SelectedStocTree.angle.ToString();
        angleSlider.value = SelectedStocTree.angle;

        lengthDisplay.text = SelectedStocTree.length.ToString("f1");
        lenSlider.value    = lenSlider.maxValue = SelectedStocTree.length;

        ruleCount  = SelectedStocTree.Stocrules.Count;
        Rule1.text = SelectedStocTree.Stocrules['F'].subRule1;
        Rule3.text = SelectedStocTree.Stocrules['F'].subRule2;
        Rule2.text = SelectedStocTree.Stocrules['X'].subRule1;
        Rule2Group.SetActive(true);
        Rule3Group.SetActive(true);
    }