private static void initColor() { for (int i = 0, len = ViewConstant.teamColorStrs.Length; i < len; i++) { ViewConstant.teamColors.Add(new List <Color>()); for (int j = 0, len2 = ViewConstant.teamColorStrs[i].Length; j < len2; j++) { ViewConstant.teamColors[i].Add(MaterialUtils.stringToColor(ViewConstant.teamColorStrs[i][j])); } } }
private void initShipCongfig() { //数据源 Dictionary <string, object> shipData = (Dictionary <string, object>)DataManager.inst.body [_id]; _shipHue = shipData.ContainsKey("hue") ? Convert.ToSingle(shipData ["hue"]) : 0; _shipSaturation = shipData.ContainsKey("saturation") ? Convert.ToSingle(shipData ["saturation"]) : 0; _shipValue = shipData.ContainsKey("value") ? Convert.ToSingle(shipData ["value"]) : 0; _passAColor = MaterialUtils.stringToColor(shipData.ContainsKey("passA") ? (string)shipData ["passA"] : "FFFFFF"); _passBColor = MaterialUtils.stringToColor(shipData.ContainsKey("passB") ? (string)shipData ["passB"] : "FFFFFF"); _passCColor = MaterialUtils.stringToColor(shipData.ContainsKey("passC") ? (string)shipData ["passC"] : "FFFFFF"); }
public void initData(Dictionary <string, object> dic) { //if(TestConfig.isEnglish) // this.info = (string)dic ["infoEn"]; //else this.info = (string)dic ["info"]; this.lightningScale = dic.ContainsKey("lightning")?(float)dic ["lightning"]:0f; this.scale = (float)dic ["time"]; this.color = dic.ContainsKey("color")?MaterialUtils.stringToColor((string)dic ["color"]):Color.yellow; this.timeMin = (int)(scale * RadioConfig.RADIO_TIME_MIN); this.voice = dic.ContainsKey("voice")?(string)dic ["voice"]:null; this.voiceIDo = dic.ContainsKey("voiceIDo")?(string)dic ["voiceIDo"]:this.voice; this.voiceDoMe = dic.ContainsKey("voiceDoMe")?(string)dic ["voiceDoMe"]:this.voice; this.voiceAllyDo = dic.ContainsKey("voiceAllyDo")?(string)dic ["voiceAllyDo"]:this.voice; this.voiceEnermyDo = dic.ContainsKey("voiceEnermyDo")?(string)dic ["voiceEnermyDo"]:this.voice; }