Example #1
0
        private void RefreshValues()
        {
            dropdown.onValueChanged.RemoveListener(OnDropdownValueChanged);
            dropdown.ClearOptions();
            pfxIdValues.Clear();

            List <TMPro.TMP_Dropdown.OptionData> data = new List <TMPro.TMP_Dropdown.OptionData>();

            data.Add(new TMPro.TMP_Dropdown.OptionData("(none)"));
            pfxIdValues.Add(null);

            foreach (ParticleEffectListing listing in pfxSystem.ListAll())
            {
                data.Add(new TMPro.TMP_Dropdown.OptionData(listing.name));
                pfxIdValues.Add(listing.id);
            }

            dropdown.options = data;
            string pfxId = (string)editor.data;
            int    index = pfxIdValues.IndexOf(pfxId);

            if (index < 0)
            {
                dropdown.value = 0;
            }
            dropdown.onValueChanged.AddListener(OnDropdownValueChanged);
        }
Example #2
0
 public void Show()
 {
     if (!isSetup)
     {
         Setup();
         isSetup = true;
     }
     listing = particleEffectSystem.ListAll();
     RepopulateList();
     ui.particleLibrary.SetActive(true);
     particleEffectSystem.onParticleEffectChanged += OnParticleEffectChanged;
     particleEffectSystem.onParticleEffectRemoved += OnParticleEffectRemoved;
     ui.createButton.onClick.AddListener(AddNewParticleEffect);
     ui.trashButton.onClick.AddListener(RemoveSelectedParticleEffect);
     ui.copyButton.onClick.AddListener(CopySelectedParticleEffect);
     ui.actionButtonsContainer.SetActive(true);
 }
Example #3
0
    private void RepopulateList()
    {
        foreach (ScrollingListItemUI entry in entries.Values)
        {
            Destroy(entry.gameObject);
        }
        entries.Clear();

        List <ParticleEffectListing> list = particleEffectSystem.ListAll();

        foreach (ParticleEffectListing listing in list)
        {
            ScrollingListItemUI entry = Instantiate(ui.particlePickerItemTemplate, ui.particlePickerList.transform);
            entry.gameObject.SetActive(true);
            entry.textField.text = listing.name;
            // entry.Set(listing);
            entry.button.onClick.AddListener(() => OnParticleEffectClicked(listing.id));
            string name = listing.name;
            entries.Add(listing.id, entry);
        }
    }