Search Unity

how to add strings from a list (subject to change) to another list that updates

Discussion in 'Scripting' started by BeautifulFish, Jul 28, 2015.

  1. BeautifulFish

    BeautifulFish

    Joined:
    Sep 25, 2014
    Posts:
    55
    Hi,

    I'm creating a trigger manager for animations and audio cues, with the ability to also trigger functions from objects.

    My functions are displayed in a popup like: Choose GameObject > Drop down list of classes > drop down list of functions in class.

    The problem however is that there is a list of functions to be executed, (I've attached a picture that explains it best)

    My first instinct was to just add all the function names (strings) into an array or list. But then, when I was changing the function in the GUI, the previous function name was still in the array.. So for example, if I chose hello world first, then decided I wanted to run goodbye world, when triggered, it runs both functions.

    If it were just one method i'd just clear it each time when a new one is selected, but with a list of methods subject to change, i'm unsure how to manage that information.

    I understand this seems confusing because of how i've worded it but i'm trying to figure out how to add strings from a list (subject to change) to another list that updates


    I'd really appreciate some help!
    Thanks!
     

    Attached Files: