Exemple #1
0
    private void UpdateGeneratorType(GameObject genName)
    {
        switch (previousGeneratorType)
        {
        case 0:
            ScrollViewDT.SetActive(false);
            break;

        case 1:
            ScrollViewBT.SetActive(false);
            break;

        case 2:
            ScrollViewCA.SetActive(false);
            break;

        case 3:
            ScrollViewSG.SetActive(false);
            break;

        default:
            generatorType = 0;
            ScrollViewDT.SetActive(false);
            UpdateGeneratorType(genName);
            break;
        }

        switch (generatorType)
        {
        case 0:
            genName.GetComponent <Text>().text = "Delaunay triangulation";
            ScrollViewDT.SetActive(true);
            break;

        case 1:
            genName.GetComponent <Text>().text = "Binary tree";
            ScrollViewBT.SetActive(true);
            break;

        case 2:
            genName.GetComponent <Text>().text = "Cellular automaton";
            ScrollViewCA.SetActive(true);
            break;

        case 3:
            genName.GetComponent <Text>().text = "Simple generator";
            ScrollViewSG.SetActive(true);
            break;

        default:
            generatorType = 0;
            genName.GetComponent <Text>().text = "Delaunay triangulation";
            ScrollViewDT.SetActive(true);
            UpdateGeneratorType(genName);
            break;
        }
    }
Exemple #2
0
    public void SetupUI()
    {
        ScrollViewDT = GameObject.Find("ScrollViewDT");
        ScrollViewBT = GameObject.Find("ScrollViewBT");
        ScrollViewCA = GameObject.Find("ScrollViewCA");
        ScrollViewSG = GameObject.Find("ScrollViewSG");
        ScrollViewDT.SetActive(true);
        ScrollViewBT.SetActive(false);
        ScrollViewCA.SetActive(false);
        ScrollViewSG.SetActive(false);

        AdvSettings = GameObject.Find("AdvSettings");
        AdvSettings.SetActive(false);

        generatorType = 0;
    }