예제 #1
0
    void OnEnable()
    {
        existingCollections = NeatController.GetExistingCollections();
        existingTrees       = TreeInputAgent.GetExistingTrees();

        // No collections on disc so cannot load
        if (existingCollections.Length == 0)
        {
            populationName.gameObject.SetActive(false);


            treeCount.SetRange(0, MaxCharacterCount);
            treeCount.Value        = treeCount.Max;
            treeCount.Interactable = false;

            neuralCount.SetRange(0, MaxCharacterCount);
            neuralCount.Value        = 0;
            neuralCount.Interactable = false;

            existingCollections = new string[] { "AiArena" };
        }
        else
        {
            populationName.gameObject.SetActive(true);
            treeCount.Interactable   = true;
            neuralCount.Interactable = true;

            // Update displayed options
            populationName.ClearOptions();

            List <Dropdown.OptionData> options = new List <Dropdown.OptionData>();
            foreach (string collection in existingCollections)
            {
                options.Add(new Dropdown.OptionData(collection));
            }
            populationName.AddOptions(options);
        }


        if (existingTrees.Length == 0)
        {
            existingTrees = new string[] { "Null" };
        }

        // Update displayed options
        treeName.ClearOptions();

        List <Dropdown.OptionData> treeOptions = new List <Dropdown.OptionData>();

        foreach (string collection in existingTrees)
        {
            treeOptions.Add(new Dropdown.OptionData(collection));
        }
        treeName.AddOptions(treeOptions);


        populationName.value = 0;
        treeName.value       = 0;
    }
예제 #2
0
    void OnEnable()
    {
        existingCollections = NeatController.GetExistingCollections();

        // No collections on disc so cannot load
        if (existingCollections.Length == 0)
        {
            newPopulationToggle.interactable = false;
        }
        else
        {
            newPopulationToggle.interactable = true;
        }
    }