public void SetBagItemPos(UnityEngine.GameObject surface, UnityEngine.GameObject old) { Debug.LogWarning("setBagItemPos"); Monitor.Enter(KBEngineApp.app.entities); KBEngine.Avatar player = (KBEngine.Avatar)KBEngineApp.app.player(); UInt64 serialnum = itemsDic[old]; FrameBagIndex new_fbi = frameBagDic[surface]; player.setBagItemPos(serialnum, new_fbi.FrameIndex, new_fbi.BagIndex); 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; } } } KnapsakItem ksi = KnapSackInfo.inst.allKanpItems[frame][bagindex]; KnapSackInfo.inst.allKanpItems[frame].Remove(bagindex); ksi.bagFrameIndex = new_fbi.FrameIndex; ksi.bagItemIndex = new_fbi.BagIndex; KnapSackInfo.inst.allKanpItems[new_fbi.FrameIndex].Add(new_fbi.BagIndex, ksi); }
public void onBagItemHover(UnityEngine.GameObject go, bool state) { if (state) { FrameBagIndex fbi = frameBagDic[go.transform.parent.gameObject]; KnapsakItem ki = KnapSackInfo.inst.allKanpItems[fbi.FrameIndex][fbi.BagIndex]; Debug.LogWarning("on hover tableid is " + ki.tableId); game_ui_autopos.ShowTips(ki.name, ki.tableId, ki.tableId, 500, go.transform.position); } else { Debug.LogWarning("not hover"); game_ui_autopos.HideTips(); } }