public RoleItem(GameObject go, EnumType.RoleListType listType, int index) { roleGo = go; nameText = UIUtil.GetText(roleGo, "name"); roleIcon = UIUtil.GetImage(roleGo, "icon"); UIUtil.SetUIOnClick(roleGo, OnClick); this.listType = listType; this.index = index; wuqi = UIUtil.GetGameObject(roleGo, "wuqiIcon"); fangju = UIUtil.GetGameObject(roleGo, "fangjuIcon"); toneImage = UIUtil.GetImage(roleGo, "tone/tone"); kuang0Image = UIUtil.GetImage(roleGo, "kuang0"); kuang1Image = UIUtil.GetImage(roleGo, "kuang1"); }
public void SellRole(int index, EnumType.RoleListType listType) { int price = 0; if (listType == EnumType.RoleListType.Fight) { price = fightRoles[index].GetPrice(); RemoveFightRole(index, EnumType.RoleUpdateType.RemoveFight); } else if (listType == EnumType.RoleListType.Pre) { preRoles[index].RemoveAllEquip(); price = preRoles[index].GetPrice(); RemoveRolePre(index); } price -= RoleShopModel.zhekou; SetMoney(price); }