public void Refreash()
        {
            ShortCutData data = ShortCutDataManager.Instance.datas[index];

            if (null == icon)
            {
                return;
            }
            if (data.type == SHORTCUTITEM.SKILL)
            {
                icon.atlas      = UIAtlasManager.GetInstance().GetUIAtlas("SkillAtlas");
                icon.spriteName = "" + itemId;
            }
            else if (data.type == SHORTCUTITEM.ITEM)
            {
                icon.atlas      = null;
                icon.spriteName = "";
            }
            else
            {
                if (icon.atlas != null)
                {
                    icon.atlas      = null;
                    icon.spriteName = "";
                }
            }
        }
 private ShortCutDataManager()
 {
     datas = new ShortCutData[Count];
     for (int i = 0; i < Count; i++)
     {
         datas[i] = new ShortCutData();
     }
 }
Exemple #3
0
        public void SetShortCut(int index, SHORTCUTITEM type, int id, bool save = true)
        {
            if (index < 0 && index > 7)
            {
                return;
            }
            ShortCutData data = ShortCutDataManager.Instance.datas[index];

            data.id   = id;
            data.type = type;
            ShortcutItem item = shortcuts[index];

            item.Refreash();
            if (save)
            {
                //OnShortCutChange(index,type,id);
            }
        }