Esempio n. 1
0
 public HUDElement Get(HUDElementType type, string key)
 {
     if (elements.ContainsKey(type) && elements[type].ContainsKey(key))
     {
         return(elements[type][key]);
     }
     return(null);
 }
Esempio n. 2
0
 public HUDElement GetFirst(HUDElementType type)
 {
     if (elements.ContainsKey(type) && elements[type].Count > 0)
     {
         foreach (KeyValuePair <string, HUDElement> pair in elements[type])
         {
             return(pair.Value);
         }
     }
     return(null);
 }
Esempio n. 3
0
 public void Add(HUDElementType type, string key, HUDElement value)
 {
     //Debug.Log("###### adding element: " + key);
     if (elements.ContainsKey(type))
     {
         if (!elements[type].ContainsKey(key))
         {
             elements[type].Add(key, value);
         }
         else
         {
             //Debug.LogWarning("Key " + key + " already exists, creating new");
             ((Component)value).name += " " + 1;
             Add(type, ((Component)value).name, value);
         }
     }
     else
     {
         elements.Add(type, new Dictionary <string, HUDElement>());
         elements[type].Add(key, value);
     }
 }