// Start is called before the first frame update
    void Start()
    {
        creationHandler = GetComponentInParent <DMCreationHandler>();
        objectPlacementDropdown.onValueChanged.AddListener(delegate
        {
            OnDropdownUpdate();
        });

        OnDropdownUpdate();
    }
Example #2
0
    private void Start()
    {
        actionHandler    = FindObjectOfType <DMActionHandler>();
        creationHandler  = FindObjectOfType <DMCreationHandler>();
        selectionHandler = FindObjectOfType <DMSelectionHandler>();
        materialsHandler = FindObjectOfType <DMMaterialsHandler>();

        List <string> selectionNames = new List <string>();
        int           c = 1;

        foreach (var m in Enum.GetNames(typeof(Mode)))
        {
            selectionNames.Add("(" + c.ToString() + ") " + m);
            c++;
        }
        selectionModeDropdown.AddOptions(selectionNames);

        selectionModeDropdown.onValueChanged.AddListener(delegate
        {
            ChangeMode(selectionModeDropdown.value);
        });
    }