private void Reset() { m_linked = GetComponent <Dropdown>(); List <string> str = m_linked.options.Select(k => k.text).ToList(); m_canBePush = new NameToPush[str.Count]; for (int i = 0; i < str.Count; i++) { m_canBePush[i] = new NameToPush(str[i], str[i] + "↕"); } }
public void SetNameAndPushWith(string[] options, string[] cmds) { if (options.Length != cmds.Length) { throw new ArgumentException("Option and Cmd lenght must be the same."); } m_linked.ClearOptions(); m_linked.AddOptions(options.ToList()); m_canBePush = new NameToPush[options.Length]; for (int i = 0; i < options.Length; i++) { m_canBePush[i] = new NameToPush(options[i], cmds[i]); } }