private void UpdatePlayerShortCutList(RemoteTable shortCutList) { RemoteTable shortCut = shortCutList["shortCut"] as RemoteTable; int c = shortCut.Count; RemoteTable _items = shortCutList["shortCut"] as RemoteTable; for (int i = 0; i < 8; i++) { int _index = i + 1; if (_items.ContainsKey(_index)) { int _type = _items[_index]["type"]; int _itemId = _items[_index]["itemId"]; SHORTCUTITEM _sctype = SHORTCUTITEM.NONE; if (_type == 2) { _sctype = SHORTCUTITEM.SKILL; } else if (_type == 1) { _sctype = SHORTCUTITEM.ITEM; } else { _sctype = SHORTCUTITEM.NONE; } ButtonBarView.GetInstance().SetShortCut(i, _sctype, _itemId, false); } } //shortCutList["shortCut"][0]["index"] }
public void OnDrop(GameObject go, GameObject draggedObject) { if (CursorManager.GetInstance().GetDraggingDataType() == DrawDataType.SKILL) { DraggignSkill _skill = CursorManager.GetInstance().getDraggingData() as DraggignSkill; if (null == _skill) { return; } int oldItemId = itemId; SHORTCUTITEM oldItemType = itemType; ButtonBarView.GetInstance().SetShortCut(index, SHORTCUTITEM.SKILL, (int)_skill.skillIndex, true); if (_skill.shorCutIndex >= 0) { if (oldItemType == SHORTCUTITEM.SKILL) { ButtonBarView.GetInstance().SetShortCut(_skill.shorCutIndex, SHORTCUTITEM.SKILL, (int)oldItemId, true); } else { ButtonBarView.GetInstance().SetShortCut(_skill.shorCutIndex, SHORTCUTITEM.NONE, (int)oldItemId, true); cdValue = 0; mark.fillAmount = 1f; } } } CursorManager.GetInstance().ClearDragCursor(); }
public void OnShortCutChange(int _index, SHORTCUTITEM _type, int _itemId) { if (_type == SHORTCUTITEM.ITEM) { RemoteCallLogic.GetInstance().CallGS("OnShortCutChange", _index + 1, 1, _itemId); } else if (_type == SHORTCUTITEM.SKILL) { RemoteCallLogic.GetInstance().CallGS("OnShortCutChange", _index + 1, 2, _itemId); } else { RemoteCallLogic.GetInstance().CallGS("OnShortCutChange", _index + 1, 0, 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); } }