Exemple #1
0
    // Start is called before the first frame update
    void Start()
    {
        BulkSpawnPresetMode.ClearOptions();
        string[] smChoices = Enum.GetNames(typeof(BulkSpawnPreset));
        foreach (string sm in smChoices)
        {
            Dropdown.OptionData newVal = new Dropdown.OptionData();
            newVal.text = UI_MapItemTile.AddNewlinesAfterCapitals(sm, ' ');
            BulkSpawnPresetMode.options.Add(newVal);
        }
        BulkSpawnPresetMode.onValueChanged.AddListener(delegate { CurrentSpawnPreset = (BulkSpawnPreset)BulkSpawnPresetMode.value; updateItemCount(); });
        BulkSpawnPresetMode.value = 0;
        BulkSpawnPresetMode.RefreshShownValue();

        SpawnDir.ClearOptions();
        smChoices = new string[4] {
            "South-east ↘", "South-west ↙", "North-west ↖", "North-east ↗"
        };
        foreach (string sm in smChoices)
        {
            Dropdown.OptionData newVal = new Dropdown.OptionData();
            newVal.text = sm;
            SpawnDir.options.Add(newVal);
        }
        SpawnDir.onValueChanged.AddListener(delegate { CurrentSpawnDirection = (SpawnDirection)SpawnDir.value; });
        SpawnDir.value = 0;
        SpawnDir.RefreshShownValue();

        ItemMultiplier.onValueChanged.AddListener(delegate { updateItemCount(); });
        updateItemCount();
    }
    // Start is called before the first frame update
    void Start()
    {
        MatchMode.ClearOptions();
        string[] smChoices = Enum.GetNames(typeof(FindAndReplaceOptions));
        foreach (string sm in smChoices)
        {
            Dropdown.OptionData newVal = new Dropdown.OptionData();
            newVal.text = UI_MapItemTile.AddNewlinesAfterCapitals(sm, ' ');
            MatchMode.options.Add(newVal);
        }
        MatchMode.onValueChanged.AddListener(delegate { CurrentOption = (FindAndReplaceOptions)MatchMode.value; });
        MatchMode.value = 0;
        MatchMode.RefreshShownValue();

        SearchWindow.OnNewItemSelected    += updateItem;
        SearchWindow.OnReturnSearchWindow += updateItemVals;
        ResetAll();
    }