初始化仓库
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
//------------------------------------------------------------
|
||||
// Game Framework
|
||||
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
|
||||
// Homepage: https://gameframework.cn/
|
||||
// Feedback: mailto:ellan@gameframework.cn
|
||||
//------------------------------------------------------------
|
||||
|
||||
using GameFramework;
|
||||
|
||||
namespace StarForce
|
||||
{
|
||||
public static class AssetUtility
|
||||
{
|
||||
public static string GetConfigAsset(string assetName, bool fromBytes)
|
||||
{
|
||||
return Utility.Text.Format("Assets/GameMain/Configs/{0}.{1}", assetName, fromBytes ? "bytes" : "txt");
|
||||
}
|
||||
|
||||
public static string GetDataTableAsset(string assetName, bool fromBytes)
|
||||
{
|
||||
return Utility.Text.Format("Assets/GameMain/DataTables/{0}.{1}", assetName, fromBytes ? "bytes" : "txt");
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
public static string GetFontAsset(string assetName)
|
||||
{
|
||||
return Utility.Text.Format("Assets/GameMain/Fonts/{0}.ttf", assetName);
|
||||
}
|
||||
|
||||
public static string GetTMPFontAsset(string assetName)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
public static string GetMusicAsset(string assetName)
|
||||
{
|
||||
return Utility.Text.Format("Assets/GameMain/Music/{0}.mp3", assetName);
|
||||
}
|
||||
|
||||
public static string GetSoundAsset(string assetName)
|
||||
{
|
||||
return Utility.Text.Format("Assets/GameMain/Sounds/{0}.wav", assetName);
|
||||
}
|
||||
|
||||
public static string GetEntityAsset(string assetName)
|
||||
{
|
||||
return Utility.Text.Format("Assets/GameMain/Entities/{0}.prefab", assetName);
|
||||
}
|
||||
|
||||
public static string GetUIFormAsset(string assetName)
|
||||
{
|
||||
return Utility.Text.Format("Assets/GameMain/UI/UIForms/{0}.prefab", assetName);
|
||||
}
|
||||
|
||||
public static string GetUISoundAsset(string assetName)
|
||||
{
|
||||
return Utility.Text.Format("Assets/GameMain/UI/UISounds/{0}.wav", assetName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ec33154bafd23a84a8f6a414f5b25ae2
|
||||
timeCreated: 1528026163
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,52 @@
|
||||
//------------------------------------------------------------
|
||||
// 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 StarForce
|
||||
{
|
||||
/// <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)");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 894291f7d20e5dc4bb7264dec378b1ce
|
||||
timeCreated: 1528026163
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,24 @@
|
||||
//------------------------------------------------------------
|
||||
// Game Framework
|
||||
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
|
||||
// Homepage: https://gameframework.cn/
|
||||
// Feedback: mailto:ellan@gameframework.cn
|
||||
//------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
|
||||
namespace StarForce
|
||||
{
|
||||
public static class WebUtility
|
||||
{
|
||||
public static string EscapeString(string stringToEscape)
|
||||
{
|
||||
return Uri.EscapeDataString(stringToEscape);
|
||||
}
|
||||
|
||||
public static string UnescapeString(string stringToUnescape)
|
||||
{
|
||||
return Uri.UnescapeDataString(stringToUnescape);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bbf9721704b3fd240b878d887bf58800
|
||||
timeCreated: 1528026163
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user