Exemplo n.º 1
0
        void ShowHeaders()
        {
            for (int i = 0; i < mappings.Count; i++)
            {
                InputMapping mapping = mappings[i];

                if (headers.Count > i)
                {
                    //Fill old header
                    headers[i].Fill(mapping.displayName, i);
                }
                else
                {
                    //New Header

                    //Spawn
                    KeyBindingHeader header = Instantiate(headerPrefab.gameObject).GetComponent <KeyBindingHeader>();
                    header.transform.SetParent(headerPrefab.transform.parent);
                    header.transform.localScale = Vector3.one;

                    //Listener
                    header.onClick.AddListener(OnHeaderClick);

                    //List
                    headers.Add(header);

                    //Fill with data
                    header.Fill(mapping.displayName, i);
                }
            }
        }
Exemplo n.º 2
0
 void OnHeaderClick(KeyBindingHeader header)
 {
     ShowMapping(header.Index);
 }