} // end IsFull public EquipPack(string username, int roleindex, string packType, string roleType, ICharacterCenter center) { this.username = username; this.roleindex = roleindex; this.packType = packType; this.roleType = roleType; this.center = center; idList = new string[ConstConfig.GRID_COUNT]; #region ******** 初始化背包信息 ******** Dictionary <int, string[]> idDict; SqliteManager.GetPackInfoWithID(username, roleindex, packType, out idDict); for (int i = 0; i < ConstConfig.GRID_COUNT; i++) { if (!idDict.ContainsKey(i)) { idList[i] = "0"; continue; } // end if idList[i] = idDict[i][0]; if (Configs.itemConfig.GetItemType(idList[i]) != packType) { idList[i] = "0"; } // end if } // end for #endregion #region ******** 初始化装备穿戴信息 ******** Dictionary <string, string> initWear; SqliteManager.GetWearInfoWithID(username, roleindex, out initWear); wearDict = new Dictionary <string, IEquipInfo>(); for (int i = 0; i < ConstConfig.EquipTypeList.Length; i++) { string type = ConstConfig.EquipTypeList[i]; if (initWear.ContainsKey(type)) { wearDict[type] = Configs.itemConfig.GetItemInfo(initWear[type]) as IEquipInfo; } else { wearDict[type] = null; } // end if } // end for #endregion } // end Pack
} // end InitialSwitchRole private void OnSwitchRole(int index) { if (!ChechExitID(index)) { createIndex = index; SceneManager.uiPanelFMS.PerformTransition(new UICreateRolePanel()); return; } // end if if (selectedindex == index) { return; } // end if roleindex = index; selectedindex = index; t_roleName.text = roleDict[index][0]; Dictionary <string, string> wearDict; SqliteManager.GetWearInfoWithID(GameManager.playerInfo.username, roleindex, out wearDict); display.SetDisplayGo(new DisplayRole(roleDict[index][1], wearDict)); } // end OnSwitchRole