public void SetInfo(ShipPropsType type, int amount) { if (this.icon != null) { this.icon.SetSprite(((int) type) + string.Empty); } this.nameTM.text = Localization.Localize(type.ToString()); this.nameTM.Commit(); if (type != ShipPropsType.Range) { if (amount > 0) { this.amountTM.text = "+" + amount; } else { this.amountTM.text = string.Empty + amount; } } else { this.amountTM.text = Localization.Localize("Range" + amount); } this.amountTM.Commit(); }
public void SetInfo(ShipPropsType type, float amount, [Optional, DefaultParameterValue(false)] bool effected) { this.icon.SetSprite(((int) type) + string.Empty); this.nameTM.text = Localization.Localize(type.ToString()); this.nameTM.Commit(); if (type == ShipPropsType.Speed) { this.amountTM.text = amount.ToString("0.0"); } else if (type == ShipPropsType.Range) { this.amountTM.text = Localization.Localize("Range" + ((int) amount)); } else { this.amountTM.text = ((int) amount) + string.Empty; } if (effected) { this.amountTM.color = this.effectedColor; } this.amountTM.Commit(); }
public static string getShipProptypestring(ShipPropsType type) { switch(type) { case ShipPropsType.AircraftAtk: return "轰炸"; case ShipPropsType.AirDef: return "防空"; case ShipPropsType.Antisub: return "反潜"; case ShipPropsType.Atk: return "火力"; case ShipPropsType.Capacity: return "搭载"; case ShipPropsType.Def: return "装甲"; case ShipPropsType.Hit: return "命中"; case ShipPropsType.Hp: return "耐久"; case ShipPropsType.Luck: return "幸运"; case ShipPropsType.Miss: return "回避"; case ShipPropsType.Radar: return "索敌"; case ShipPropsType.Range: return "射程"; case ShipPropsType.Speed: return "速度"; case ShipPropsType.Torpedo: return "雷装"; default: return "未知"; } }
internal static string getShipProptypeval(ShipPropsType shipPropsType, int val) { if(shipPropsType == ShipPropsType.Range) { switch(val) { default: case 0: return "无"; case 1: return "短"; case 2: return "中"; case 3: return "长"; case 4: return "超长"; } } { return val.ToString(); } }
protected void UpdateAllProps() { this.propsContainer.RemoveAllItems(); ShipPropsType[] typeArray = new ShipPropsType[] { ShipPropsType.Hp, ShipPropsType.Atk, ShipPropsType.Capacity, ShipPropsType.Def, ShipPropsType.Torpedo, ShipPropsType.Luck, ShipPropsType.Miss, ShipPropsType.AirDef, ShipPropsType.Range, ShipPropsType.Radar, ShipPropsType.Antisub, ShipPropsType.Speed }; ShipBattleProps battleProps = this.userShip.battleProps; ShipBattleProps battlePropsMax = this.userShip.battlePropsMax; List<float> list3 = new List<float>(); list3.Add((float) battlePropsMax.hp); list3.Add((float) battleProps.atk); list3.Add((float) this.userShip.ship.capacity); list3.Add((float) battleProps.def); list3.Add((float) battleProps.torpedo); list3.Add((float) battleProps.luck); list3.Add((float) battleProps.miss); list3.Add((float) battleProps.airDef); list3.Add((float) battleProps.range); list3.Add((float) battleProps.radar); list3.Add((float) battleProps.antisub); list3.Add(battleProps.speed); List<float> list = list3; List<GameObject> items = new List<GameObject>(); for (int i = 0; i < 12; i++) { GameObject item = GameObjectUtil.InstantiateItemAsChildOf(this.propsItemPrefab, this.propsParent); bool effected = false; if (this.equipEffectedProps.ContainsKey(typeArray[i])) { effected = true; } item.GetComponent<ShipPropsItemInfo>().SetInfo(typeArray[i], list[i], effected); items.Add(item); } this.propsContainer.SetItems(items); }