P0-02 补齐数据表:组件、敌人、波次、节点、事件、商店商品
- 组件:
- 底座:Assets\GameMain\DataTables\BaseComp.txt
- 轴承:Assets\GameMain\DataTables\BearingComp.txt
- 枪口:Assets\GameMain\DataTables\MuzzleComp.txt
- 敌人:Assets\GameMain\DataTables\Enemy.txt
- 波次:
- 关卡:Assets\GameMain\DataTables\Level.txt
- 关卡阶段(波次):Assets\GameMain\DataTables\LevelPhase.txt
- 波次条目(波次出怪规则):Assets\GameMain\DataTables\LevelSpawnEntry.txt
- 事件:Assets\GameMain\DataTables\Event.txt
- 商店:Assets\GameMain\DataTables\ShopPrice.txt
This commit is contained in:
@@ -23,7 +23,8 @@ namespace GeometryTD.CustomUtility
|
||||
|
||||
public static string GetDictionaryAsset(string assetName, bool fromBytes)
|
||||
{
|
||||
return Utility.Text.Format("Assets/GameMain/Localization/{0}/Dictionaries/{1}.{2}", GameEntry.Localization.Language, assetName, fromBytes ? "bytes" : "xml");
|
||||
return Utility.Text.Format("Assets/GameMain/Localization/{0}/Dictionaries/{1}.{2}",
|
||||
GameEntry.Localization.Language, assetName, fromBytes ? "bytes" : "xml");
|
||||
}
|
||||
|
||||
public static string GetFontAsset(string assetName)
|
||||
@@ -35,7 +36,7 @@ namespace GeometryTD.CustomUtility
|
||||
{
|
||||
return Utility.Text.Format("Assets/GameMain/Fonts/{0}.asset", assetName);
|
||||
}
|
||||
|
||||
|
||||
public static string GetSceneAsset(string assetName)
|
||||
{
|
||||
return Utility.Text.Format("Assets/GameMain/Scenes/{0}.unity", assetName);
|
||||
@@ -65,5 +66,10 @@ namespace GeometryTD.CustomUtility
|
||||
{
|
||||
return Utility.Text.Format("Assets/GameMain/UI/UISounds/{0}.wav", assetName);
|
||||
}
|
||||
|
||||
public static string GetLevelMapAsset(string assetName)
|
||||
{
|
||||
return Utility.Text.Format("Assets/GameMain/LevelMap/Level{0}.prefab", assetName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace GeometryTD.CustomUtility
|
||||
{
|
||||
/// <summary>
|
||||
/// Newtonsoft.Json 函数集辅助器。
|
||||
/// </summary>
|
||||
public class JsonNetUtility : GameFramework.Utility.Json.IJsonHelper
|
||||
{
|
||||
public string ToJson(object obj)
|
||||
{
|
||||
return JsonConvert.SerializeObject(obj);
|
||||
}
|
||||
|
||||
public T ToObject<T>(string json)
|
||||
{
|
||||
return JsonConvert.DeserializeObject<T>(json);
|
||||
}
|
||||
|
||||
public object ToObject(Type objectType, string json)
|
||||
{
|
||||
return JsonConvert.DeserializeObject(json, objectType);
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-3
@@ -1,8 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 894291f7d20e5dc4bb7264dec378b1ce
|
||||
timeCreated: 1528026163
|
||||
licenseType: Pro
|
||||
guid: a64f8e5b71575bd43802e0761393bc50
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
@@ -1,52 +0,0 @@
|
||||
//------------------------------------------------------------
|
||||
// Game Framework
|
||||
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
|
||||
// Homepage: https://gameframework.cn/
|
||||
// Feedback: mailto:ellan@gameframework.cn
|
||||
//------------------------------------------------------------
|
||||
|
||||
using GameFramework;
|
||||
using LitJson;
|
||||
using System;
|
||||
|
||||
namespace GeometryTD.CustomUtility
|
||||
{
|
||||
/// <summary>
|
||||
/// LitJSON 函数集辅助器。
|
||||
/// </summary>
|
||||
internal class LitJsonHelper : Utility.Json.IJsonHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// 将对象序列化为 JSON 字符串。
|
||||
/// </summary>
|
||||
/// <param name="obj">要序列化的对象。</param>
|
||||
/// <returns>序列化后的 JSON 字符串。</returns>
|
||||
public string ToJson(object obj)
|
||||
{
|
||||
return JsonMapper.ToJson(obj);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将 JSON 字符串反序列化为对象。
|
||||
/// </summary>
|
||||
/// <typeparam name="T">对象类型。</typeparam>
|
||||
/// <param name="json">要反序列化的 JSON 字符串。</param>
|
||||
/// <returns>反序列化后的对象。</returns>
|
||||
public T ToObject<T>(string json)
|
||||
{
|
||||
return JsonMapper.ToObject<T>(json);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将 JSON 字符串反序列化为对象。
|
||||
/// </summary>
|
||||
/// <param name="objectType">对象类型。</param>
|
||||
/// <param name="json">要反序列化的 JSON 字符串。</param>
|
||||
/// <returns>反序列化后的对象。</returns>
|
||||
public object ToObject(Type objectType, string json)
|
||||
{
|
||||
// TODO: 可反射为 ToObject<T>(string json)
|
||||
throw new NotSupportedException("ToObject(Type objectType, string json)");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user