public void SetPlayerData(PlayerData playerData) { _playerData = playerData; transferTitleText.text = Localization.Get("ui.activate_profession_view.activate_profession_title"); costResourcesTitleText.text = Localization.Get("ui.activate_profession_view.cost_resources_title"); transferText.text = Localization.Get("ui.activate_profession_view.transfer"); cancelText.text = Localization.Get("ui.activate_profession_view.cancel"); int transferTaskContidionCount = _playerData.transferTaskConditionIDList.Count; for (int i = 0; i < transferTaskContidionCount; i++) { TaskConditionData taskConditionData = TaskConditionData.GetTaskConditionData(_playerData.transferTaskConditionIDList[i]); Text transferConditionText = GameObject.Instantiate <Text>(transferConditionTextPrefab); transferConditionText.text = TaskUtil.GetTaskConditionDescriptionWithColor(taskConditionData); transferConditionText.transform.SetParent(transferConditionsRoot, false); transferConditionText.gameObject.SetActive(true); } transferConditionTextPrefab.gameObject.SetActive(false); List <GameResData> transferCostResourcesList = _playerData.transferCostList; int transferCostResourceCount = transferCostResourcesList.Count; commonItemIconPrefab.gameObject.SetActive(true); for (int i = 0; i < transferCostResourceCount; i++) { GameResData gameResData = transferCostResourcesList[i]; if (gameResData.type == BaseResType.Item) { int universalId = ItemData.GetItemDataByID(gameResData.id).universal_id; if (universalId != 0) { CommonItemIcon itemOrigin = CreateItemIcon(gameResData, true); CommonItemIcon itemGeneral = CreateItemIcon(new GameResData(BaseResType.Item, universalId, gameResData.count, gameResData.star), true); Toggle originToggle = itemOrigin.GetComponentInChildren <Toggle>(); generalMeterialGroup.AddToggle((uint)gameResData.id, originToggle); generalMeterialGroup.AddToggle((uint)gameResData.id, itemGeneral.GetComponentInChildren <Toggle>()); generalMeterialGroup.OnClickToggle(originToggle); } else { CreateItemIcon(gameResData, false); } } else { CreateItemIcon(gameResData, false); } } commonItemIconPrefab.gameObject.SetActive(false); }