/// <summary> /// 弾情報を読み込む /// </summary> protected Dictionary <string, Dictionary <string, ToolBox.Bullet> > ReadBullet(TextReader reader) { var dic = new Dictionary <string, Dictionary <string, ToolBox.Bullet> >(); string line = ""; string[] split; int i = 0; string category, name, caption, atlasName, path; GameObject instance; ToolBox.LauncherPerformance per; while ((line = reader.ReadLine()) != null) { i = 0; split = line.Split(','); //名前ID name = split[i]; i++; //カテゴリー category = split[i]; i++; //説明文 caption = split[i]; i++; //改行チェック caption = caption.Replace("[改行]", "\n"); //アトラス名 atlasName = split[i]; i++; //インスタンス path = split[i]; i++; instance = (GameObject)Instantiate(Resources.Load(path)); if (instance != null) { instance.transform.parent = transform; instance.name = name; instance.SetActive(false); //性能 per = new ToolBox.LauncherPerformance(); per.SetReadString(split, i); //カテゴリー登録の確認 if (!dic.ContainsKey(category)) { Debug.Log("追加 : " + category); dic.Add(category, new Dictionary <string, ToolBox.Bullet>()); } //追加 dic[category].Add(name, new ToolBox.Bullet(category, name, caption, atlasName, instance, per)); } } return(dic); }
/// <summary> /// 性能を表示する。フラグは単位を表示するか /// </summary> public void SetPerformance(ToolBox.LauncherPerformance p, bool flagTani) { if (flagTani) { barrel.text = p.barrel + "m"; caliber.text = p.caliber + "m"; velocity.text = p.velocity + "m/s"; damage.text = p.damage.ToString(); reloadSpeed.text = p.reloadSpeed + "s"; } else { barrel.text = p.barrel.ToString(); caliber.text = p.caliber.ToString(); velocity.text = p.velocity.ToString(); damage.text = p.damage.ToString(); reloadSpeed.text = p.reloadSpeed.ToString(); } }