Example #1
0
        public static void AddEquip(int id)
        {
            InventoryEquipData equipData = new InventoryEquipData();

            equipData.ID  = id;
            equipData.Num = 1;
            data.AddItem(equipData);
            InventoryDataMgr.Save();
        }
        public void SetEquip(InventoryEquipData data)
        {
            m_Data = data;
            if (m_Loader == null)
            {
                m_Loader = ResLoader.Allocate();
            }
            Texture2D texture = m_Loader.LoadSync("ItemIcon_100001") as Texture2D;
            Sprite    sprite  = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), Vector2.zero);

            m_ImgBg.sprite = sprite;

            GFrame.EventSystem.S.Send(EventID.OnRoleEquip);
        }
Example #3
0
 public static void RemoveEquip(InventoryEquipData equipData)
 {
     data.RemoveItem(equipData);
 }