116 lines
3.2 KiB
C#
116 lines
3.2 KiB
C#
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Reflection;
|
|
using Newtonsoft.Json.Linq;
|
|
using UnityEngine;
|
|
|
|
namespace NBF
|
|
{
|
|
public partial class ConfigAssets
|
|
{
|
|
public List<GameBaits> GameBaitsArr;
|
|
public List<GameFeeders> GameFeedersArr;
|
|
public List<GameFishAccepts> GameFishAcceptsArr;
|
|
public List<GameFish> GameFishArr;
|
|
public List<GameFloats> GameFloatsArr;
|
|
public List<GameHooks> GameHooksArr;
|
|
public List<GameLeaders> GameLeadersArr;
|
|
public List<GameLines> GameLinesArr;
|
|
public List<GameLures> GameLuresArr;
|
|
public List<GameReels> GameReelsArr;
|
|
public List<GameRings> GameRingsArr;
|
|
public List<GameRods> GameRodsArr;
|
|
public List<GameWeights> GameWeightsArr;
|
|
|
|
public void Parse(JToken[] arr, Type type)
|
|
{
|
|
var tableNameAttribute = type.GetCustomAttribute<TableNameAttribute>();
|
|
if (tableNameAttribute == null) return;
|
|
if (type == typeof(GameBaits))
|
|
{
|
|
GameBaitsArr = ParseLine<GameBaits>(arr, tableNameAttribute);
|
|
}
|
|
|
|
if (type == typeof(GameFeeders))
|
|
{
|
|
GameFeedersArr = ParseLine<GameFeeders>(arr, tableNameAttribute);
|
|
}
|
|
|
|
if (type == typeof(GameFishAccepts))
|
|
{
|
|
GameFishAcceptsArr = ParseLine<GameFishAccepts>(arr, tableNameAttribute);
|
|
}
|
|
|
|
if (type == typeof(GameFish))
|
|
{
|
|
GameFishArr = ParseLine<GameFish>(arr, tableNameAttribute);
|
|
}
|
|
|
|
if (type == typeof(GameFloats))
|
|
{
|
|
GameFloatsArr = ParseLine<GameFloats>(arr, tableNameAttribute);
|
|
}
|
|
|
|
if (type == typeof(GameHooks))
|
|
{
|
|
GameHooksArr = ParseLine<GameHooks>(arr, tableNameAttribute);
|
|
}
|
|
|
|
if (type == typeof(GameLeaders))
|
|
{
|
|
GameLeadersArr = ParseLine<GameLeaders>(arr, tableNameAttribute);
|
|
}
|
|
|
|
if (type == typeof(GameLines))
|
|
{
|
|
GameLinesArr = ParseLine<GameLines>(arr, tableNameAttribute);
|
|
}
|
|
|
|
if (type == typeof(GameLures))
|
|
{
|
|
GameLuresArr = ParseLine<GameLures>(arr, tableNameAttribute);
|
|
}
|
|
|
|
if (type == typeof(GameReels))
|
|
{
|
|
GameReelsArr = ParseLine<GameReels>(arr, tableNameAttribute);
|
|
}
|
|
|
|
if (type == typeof(GameRings))
|
|
{
|
|
GameRingsArr = ParseLine<GameRings>(arr, tableNameAttribute);
|
|
}
|
|
|
|
if (type == typeof(GameRods))
|
|
{
|
|
GameRodsArr = ParseLine<GameRods>(arr, tableNameAttribute);
|
|
}
|
|
|
|
if (type == typeof(GameWeights))
|
|
{
|
|
GameWeightsArr = ParseLine<GameWeights>(arr, tableNameAttribute);
|
|
}
|
|
|
|
}
|
|
|
|
public void AssociationContexts()
|
|
{
|
|
new ConfigContext<GameBaits>().Association(GameBaitsArr);
|
|
new ConfigContext<GameFeeders>().Association(GameFeedersArr);
|
|
new ConfigContext<GameFishAccepts>().Association(GameFishAcceptsArr);
|
|
new ConfigContext<GameFish>().Association(GameFishArr);
|
|
new ConfigContext<GameFloats>().Association(GameFloatsArr);
|
|
new ConfigContext<GameHooks>().Association(GameHooksArr);
|
|
new ConfigContext<GameLeaders>().Association(GameLeadersArr);
|
|
new ConfigContext<GameLines>().Association(GameLinesArr);
|
|
new ConfigContext<GameLures>().Association(GameLuresArr);
|
|
new ConfigContext<GameReels>().Association(GameReelsArr);
|
|
new ConfigContext<GameRings>().Association(GameRingsArr);
|
|
new ConfigContext<GameRods>().Association(GameRodsArr);
|
|
new ConfigContext<GameWeights>().Association(GameWeightsArr);
|
|
}
|
|
}
|
|
}
|