OneShotOneKill/Assets/Script/Table/Tables/table_unit.cs

39 lines
1.5 KiB
C#

using CodeStage.AntiCheat.ObscuredTypes;
using Newtonsoft.Json;
using System.Collections.Generic;
public class UnitTableData : TableDataBase
{
ObscuredInt _UnitID; public int n_UnitID { get { return _UnitID; } set { _UnitID = value; _UnitID.RandomizeCryptoKey(); } }
ObscuredFloat _DefaultAttack; public float f_DefaultAttack { get { return _DefaultAttack; } set { _DefaultAttack = value; _DefaultAttack.RandomizeCryptoKey(); } }
ObscuredInt _DefaultHp; public int n_DefaultHp { get { return _DefaultHp; } set { _DefaultHp = value; _DefaultHp.RandomizeCryptoKey(); } }
ObscuredFloat _AttackSpeed; public float f_AttackSpeed { get { return _AttackSpeed; } set { _AttackSpeed = value; _AttackSpeed.RandomizeCryptoKey(); } }
ObscuredInt _DefaultProjectileCount; public int n_DefaultProjectileCount { get { return _DefaultProjectileCount; } set { _DefaultProjectileCount = value; _DefaultProjectileCount.RandomizeCryptoKey(); } }
public string s_ProjectilePrefabs, s_UnitPrefabPath;
}
public class table_unit : table_base
{
public static table_unit Ins;
List<UnitTableData> tableDatas;
protected override void Awake()
{
Ins = this;
base.Awake();
}
protected override void Start()
{
tableDatas = JsonConvert.DeserializeObject<List<UnitTableData>>(json_last);
base.Start();
}
public List<UnitTableData> Get_DataList() { return tableDatas; }
public UnitTableData Get_Data(int id) { return tableDatas.Find(f=>f.n_UnitID == id); }
}