50 lines
1.1 KiB
C#
50 lines
1.1 KiB
C#
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
using static XPlugin.Data.JsonLiteDB.JsonLiteDB;
|
||
|
||
public class BulletInfo
|
||
{
|
||
public int ID;
|
||
|
||
public string Name;
|
||
|
||
public string Name_CN;
|
||
|
||
public int[] Damage;
|
||
|
||
public BulletInfo(TableReader table)
|
||
{
|
||
ID = table["ID"].OptInt();
|
||
Name = table["Name"].OptString();
|
||
Name_CN = table["Name_CN"].OptString();
|
||
string damage = table["Damage"].OptString();
|
||
Damage = ParseStringToIntArray(damage);
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
int[] ParseStringToIntArray(string input)
|
||
{
|
||
if (input == "")
|
||
{
|
||
return null;
|
||
}
|
||
|
||
// ȥ<><C8A5><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD>ţ<EFBFBD><C5A3><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6>ŷָ<C5B7><D6B8>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
string[] elements = input.Replace("(", "").Replace(")", "").Split(',');
|
||
int[] intArray = new int[elements.Length];
|
||
|
||
for (int i = 0; i < elements.Length; i++)
|
||
{
|
||
// <20><>ÿ<EFBFBD><C3BF>Ԫ<EFBFBD>ؽ<EFBFBD><D8BD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
intArray[i] = int.Parse(elements[i]);
|
||
}
|
||
|
||
return intArray;
|
||
}
|
||
|
||
}
|