public void DropBagItem(UnityEngine.GameObject dropGameObject) { Monitor.Enter(KBEngineApp.app.entities); KBEngine.Avatar player = (KBEngine.Avatar)KBEngineApp.app.player(); UInt64 serialnum = itemsDic[dropGameObject]; player.DropBagItem(serialnum); 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); }