private static bool _LoadDataBase(string tablePath, ref Dictionary <int, GrenadeInfo> Info)
    {
        Info.Clear();
        TextAsset datas = Resources.Load <TextAsset>(tablePath);

        if (datas != null)
        {
            string[] lines = datas.text.Split('\n');
            for (int i = 1; i < lines.Length - 1; i++)
            {
                string[]    grenadeInfo = lines[i].Split(',');
                GrenadeInfo data        = new GrenadeInfo();
                data.SetID(int.Parse(grenadeInfo[0]));
                data.SetType(int.Parse(grenadeInfo[1]));
                data.SetTitle(grenadeInfo[2]);
                data.SetDamage(float.Parse(grenadeInfo[3]));
                data.SetTimer(float.Parse(grenadeInfo[4]));
                data.SetRange(float.Parse(grenadeInfo[5]));
                data.SetMaxCount(int.Parse(grenadeInfo[6]));
                Info.Add(data.ID, data);
            }
            return(true);
        }
        return(false);
    }
示例#2
0
 public void CopyTo(GrenadeInfo other)
 {
     other.SetID(this.ID);
     other.SetType(this.Type);
     other.SetTitle(this.Title);
     other.SetDamage(this.Damage);
     other.SetTimer(this.Timer);
     other.SetRange(this.Range);
     other.SetMaxCount(this.MaxCount);
     other.Force = this.Force;
 }