Example #1
0
    public void EquipItem(Byte index, UnityEngine.GameObject ego)
    {
        Monitor.Enter(KBEngineApp.app.entities);
        KBEngine.Avatar player    = (KBEngine.Avatar)KBEngineApp.app.player();
        UInt64          serialnum = itemsDic[ego];

        player.EquipItem(serialnum, index);
        Monitor.Exit(KBEngineApp.app.entities);
        Byte   frame    = 0;
        UInt16 bagindex = 0;

        foreach (var v in KnapSackInfo.inst.allKanpItems)
        {
            foreach (var mv in v.Value)
            {
                if (mv.Value.serialnum == serialnum)
                {
                    frame    = v.Key;
                    bagindex = mv.Key;
                }
            }
        }
        KnapSackInfo.inst.allKanpItems[frame].Remove(bagindex);
    }