コード例 #1
0
 private void Start()
 {
     if (uiCharacterHotkey == null)
     {
         uiCharacterHotkey = GetComponent <UICharacterHotkey>();
     }
 }
コード例 #2
0
 private void InitCaches()
 {
     if (cacheUICharacterHotkeys == null)
     {
         CacheCharacterHotkeySelectionManager.DeselectSelectedUI();
         CacheCharacterHotkeySelectionManager.Clear();
         int j = 0;
         cacheUICharacterHotkeys = new Dictionary <string, List <UICharacterHotkey> >();
         for (int i = 0; i < uiCharacterHotkeys.Length; ++i)
         {
             UICharacterHotkeyPair uiCharacterHotkey = uiCharacterHotkeys[i];
             string            id = uiCharacterHotkey.hotkeyId;
             UICharacterHotkey ui = uiCharacterHotkey.ui;
             if (!string.IsNullOrEmpty(id) && ui != null)
             {
                 CharacterHotkey characterHotkey = new CharacterHotkey();
                 characterHotkey.hotkeyId = id;
                 characterHotkey.type     = HotkeyType.None;
                 characterHotkey.dataId   = 0;
                 ui.Setup(this, characterHotkey, -1);
                 if (!cacheUICharacterHotkeys.ContainsKey(id))
                 {
                     cacheUICharacterHotkeys.Add(id, new List <UICharacterHotkey>());
                 }
                 cacheUICharacterHotkeys[id].Add(ui);
                 CacheCharacterHotkeySelectionManager.Add(ui);
                 // Select first UI
                 if (j == 0)
                 {
                     ui.OnClickSelect();
                 }
                 ++j;
             }
         }
     }
 }
コード例 #3
0
 public void SetupForHotkey(UICharacterHotkey uiCharacterHotkey)
 {
     sourceLocation         = SourceLocation.Hotkey;
     this.uiCharacterHotkey = uiCharacterHotkey;
 }
コード例 #4
0
 public void Setup(UICharacterHotkey uiCharacterHotkey)
 {
     this.uiCharacterHotkey = uiCharacterHotkey;
 }