添加 SepCore.Runtime 和 SepCore.Base 程序集
- 暂时将 Entity 全部归进 Runtime 程序集里 - 调整部分 UI 的 UseCase/RawData/Context 之间的关系,让 RawData 更接近业务原始数据,Context 更接近 UI 直接可读的数据 - 调整其他程序集的引用关系
This commit is contained in:
parent
d5893ac52b
commit
91f70dd783
|
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"name": "SepCore.Base",
|
||||||
|
"rootNamespace": "SepCore.Base",
|
||||||
|
"references": [
|
||||||
|
"GUID:363c5eb08ff8e6a439b85e37b8c20d96"
|
||||||
|
],
|
||||||
|
"includePlatforms": [],
|
||||||
|
"excludePlatforms": [],
|
||||||
|
"allowUnsafeCode": false,
|
||||||
|
"overrideReferences": false,
|
||||||
|
"precompiledReferences": [],
|
||||||
|
"autoReferenced": true,
|
||||||
|
"defineConstraints": [],
|
||||||
|
"versionDefines": [],
|
||||||
|
"noEngineReferences": false
|
||||||
|
}
|
||||||
|
|
@ -14,12 +14,6 @@ namespace CustomUtility
|
||||||
return Text.Format("Assets/GameMain/DataTables/{0}.{1}", assetName, fromBytes ? "bytes" : "txt");
|
return Text.Format("Assets/GameMain/DataTables/{0}.{1}", assetName, fromBytes ? "bytes" : "txt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetDictionaryAsset(string assetName, bool fromBytes)
|
|
||||||
{
|
|
||||||
return Text.Format("Assets/GameMain/Localization/{0}/Dictionaries/{1}.{2}",
|
|
||||||
GameEntry.Localization.Language, assetName, fromBytes ? "bytes" : "xml");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetFontAsset(string assetName)
|
public static string GetFontAsset(string assetName)
|
||||||
{
|
{
|
||||||
return Text.Format("Assets/GameMain/Fonts/{0}.ttf", assetName);
|
return Text.Format("Assets/GameMain/Fonts/{0}.ttf", assetName);
|
||||||
|
|
|
||||||
|
|
@ -1,79 +0,0 @@
|
||||||
using SepCore.Definition;
|
|
||||||
using GameFramework.Debugger;
|
|
||||||
using GameFramework.Localization;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityGameFramework.Runtime;
|
|
||||||
|
|
||||||
namespace SepCore.Editor
|
|
||||||
{
|
|
||||||
public class ChangeLanguageDebuggerWindow : IDebuggerWindow
|
|
||||||
{
|
|
||||||
private Vector2 m_ScrollPosition = Vector2.zero;
|
|
||||||
private bool m_NeedRestart = false;
|
|
||||||
|
|
||||||
public void Initialize(params object[] args)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Shutdown()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnEnter()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnLeave()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnUpdate(float elapseSeconds, float realElapseSeconds)
|
|
||||||
{
|
|
||||||
if (m_NeedRestart)
|
|
||||||
{
|
|
||||||
m_NeedRestart = false;
|
|
||||||
UnityGameFramework.Runtime.GameEntry.Shutdown(ShutdownType.Restart);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnDraw()
|
|
||||||
{
|
|
||||||
m_ScrollPosition = GUILayout.BeginScrollView(m_ScrollPosition);
|
|
||||||
{
|
|
||||||
DrawSectionChangeLanguage();
|
|
||||||
}
|
|
||||||
GUILayout.EndScrollView();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawSectionChangeLanguage()
|
|
||||||
{
|
|
||||||
GUILayout.Label("<b>Change Language</b>");
|
|
||||||
GUILayout.BeginHorizontal("box");
|
|
||||||
{
|
|
||||||
if (GUILayout.Button("Chinese Simplified", GUILayout.Height(30)))
|
|
||||||
{
|
|
||||||
GameEntry.Localization.Language = Language.ChineseSimplified;
|
|
||||||
SaveLanguage();
|
|
||||||
}
|
|
||||||
if (GUILayout.Button("Chinese Traditional", GUILayout.Height(30)))
|
|
||||||
{
|
|
||||||
GameEntry.Localization.Language = Language.ChineseTraditional;
|
|
||||||
SaveLanguage();
|
|
||||||
}
|
|
||||||
if (GUILayout.Button("English", GUILayout.Height(30)))
|
|
||||||
{
|
|
||||||
GameEntry.Localization.Language = Language.English;
|
|
||||||
SaveLanguage();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GUILayout.EndHorizontal();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SaveLanguage()
|
|
||||||
{
|
|
||||||
GameEntry.Setting.SetString(Constant.Setting.Language, GameEntry.Localization.Language.ToString());
|
|
||||||
GameEntry.Setting.Save();
|
|
||||||
m_NeedRestart = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 278a7992e66d1ea4081597614f912f3d
|
|
||||||
timeCreated: 1528026148
|
|
||||||
licenseType: Pro
|
|
||||||
MonoImporter:
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -2,11 +2,12 @@
|
||||||
"name": "SepCore.Editor",
|
"name": "SepCore.Editor",
|
||||||
"rootNamespace": "SepCore.Editor",
|
"rootNamespace": "SepCore.Editor",
|
||||||
"references": [
|
"references": [
|
||||||
"GUID:47a82ffa13c291447ab895cd0bc251cd",
|
|
||||||
"GUID:363c5eb08ff8e6a439b85e37b8c20d96",
|
|
||||||
"GUID:a2d8a19598eca814496b089021d08d60",
|
"GUID:a2d8a19598eca814496b089021d08d60",
|
||||||
"GUID:6f6ea874d7669044095abb01ec4c2f8d",
|
"GUID:363c5eb08ff8e6a439b85e37b8c20d96",
|
||||||
"GUID:0e1d182005e0ae647ab3fa40f5492dbb"
|
"GUID:47a82ffa13c291447ab895cd0bc251cd",
|
||||||
|
"GUID:436e23dbdc31e7d4fb5c3f804548b2df",
|
||||||
|
"GUID:0e1d182005e0ae647ab3fa40f5492dbb",
|
||||||
|
"GUID:6f6ea874d7669044095abb01ec4c2f8d"
|
||||||
],
|
],
|
||||||
"includePlatforms": [
|
"includePlatforms": [
|
||||||
"Editor"
|
"Editor"
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
using CustomUtility;
|
||||||
|
using SepCore.DataTable;
|
||||||
using SepCore.Definition;
|
using SepCore.Definition;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
|
@ -7,19 +9,46 @@ namespace SepCore.UI
|
||||||
{
|
{
|
||||||
public string Title;
|
public string Title;
|
||||||
public ItemRarity Rarity;
|
public ItemRarity Rarity;
|
||||||
public string Type;
|
|
||||||
public Sprite Icon;
|
public Sprite Icon;
|
||||||
|
public ItemType ItemType;
|
||||||
public string Description;
|
public string Description;
|
||||||
public int Price;
|
public int Price;
|
||||||
|
|
||||||
|
public GoodsItemContext()
|
||||||
|
{
|
||||||
|
Title = string.Empty;
|
||||||
|
Description = string.Empty;
|
||||||
|
Rarity = ItemRarity.White;
|
||||||
|
Price = 0;
|
||||||
|
Icon = null;
|
||||||
|
ItemType = ItemType.None;
|
||||||
|
}
|
||||||
|
|
||||||
public GoodsItemContext(GoodsItemRawData rawData)
|
public GoodsItemContext(GoodsItemRawData rawData)
|
||||||
{
|
{
|
||||||
Title = rawData.Title;
|
|
||||||
Description = rawData.Description;
|
|
||||||
Price = rawData.Price;
|
Price = rawData.Price;
|
||||||
Rarity = rawData.Rarity;
|
Rarity = rawData.Rarity;
|
||||||
Type = rawData.Type;
|
ItemType = rawData.ItemType;
|
||||||
Icon = rawData.Icon;
|
if (ItemType == ItemType.None)
|
||||||
|
{
|
||||||
|
Description = string.Empty;
|
||||||
|
Icon = null;
|
||||||
|
Title = string.Empty;
|
||||||
|
}
|
||||||
|
else if (ItemType == ItemType.Weapon)
|
||||||
|
{
|
||||||
|
var weapon = (DRWeapon)rawData.DataRow;
|
||||||
|
Title = weapon.Title;
|
||||||
|
Description = ItemDescUtility.CreateWeaponDescription(weapon);
|
||||||
|
GameEntry.SpriteCache.GetSprite(weapon.IconAssetName, sprite => Icon = sprite);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var prop = (DRProp)rawData.DataRow;
|
||||||
|
Title = prop.Title;
|
||||||
|
Description = ItemDescUtility.CreatePropDescription(prop.Modifiers);
|
||||||
|
GameEntry.SpriteCache.GetSprite(prop.IconAssetName, sprite => Icon = sprite);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
using CustomUtility;
|
||||||
|
using Entity.EntityData;
|
||||||
|
using Entity.Weapon;
|
||||||
using SepCore.Definition;
|
using SepCore.Definition;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
|
@ -8,11 +13,50 @@ namespace SepCore.UI
|
||||||
public int Index;
|
public int Index;
|
||||||
public string IconAssetName;
|
public string IconAssetName;
|
||||||
public string Title;
|
public string Title;
|
||||||
public string TypeText;
|
public ItemType ItemType;
|
||||||
public ItemRarity Rarity;
|
public ItemRarity Rarity;
|
||||||
public string Description;
|
public string Description;
|
||||||
public int Price;
|
public int Price;
|
||||||
public bool IsWeapon;
|
|
||||||
public Vector3 TargetPos;
|
public Vector3 TargetPos;
|
||||||
|
|
||||||
|
public DisplayItemInfoContext()
|
||||||
|
{
|
||||||
|
Index = -1;
|
||||||
|
IconAssetName = string.Empty;
|
||||||
|
Title = string.Empty;
|
||||||
|
ItemType = ItemType.None;
|
||||||
|
Rarity = ItemRarity.White;
|
||||||
|
Description = string.Empty;
|
||||||
|
Price = 0;
|
||||||
|
TargetPos = Vector3.zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DisplayItemInfoContext(DisplayItemInfoRawData rawData)
|
||||||
|
{
|
||||||
|
Index = rawData.Index;
|
||||||
|
ItemType = rawData.ItemType;
|
||||||
|
Rarity = rawData.Rarity;
|
||||||
|
Price = rawData.Price;
|
||||||
|
TargetPos = rawData.TargetPos;
|
||||||
|
if (ItemType == ItemType.None)
|
||||||
|
{
|
||||||
|
IconAssetName = string.Empty;
|
||||||
|
Title = string.Empty;
|
||||||
|
}
|
||||||
|
else if (ItemType == ItemType.Weapon)
|
||||||
|
{
|
||||||
|
var data = (WeaponData)rawData.Data;
|
||||||
|
IconAssetName = data.IconAssetName;
|
||||||
|
Title = data.Title;
|
||||||
|
Description = ItemDescUtility.CreateWeaponDescription(data);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var data = (PropItem)rawData.Data;
|
||||||
|
IconAssetName = data.IconAssetName;
|
||||||
|
Title = data.Title;
|
||||||
|
Description = ItemDescUtility.CreatePropDescription(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,18 +43,7 @@ namespace SepCore.UI
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new DisplayItemInfoContext
|
return new DisplayItemInfoContext(rawData);
|
||||||
{
|
|
||||||
Index = rawData.Index,
|
|
||||||
IconAssetName = rawData.IconAssetName,
|
|
||||||
Title = rawData.Title,
|
|
||||||
Rarity = rawData.Rarity,
|
|
||||||
TypeText = rawData.TypeText,
|
|
||||||
Description = rawData.Description,
|
|
||||||
Price = rawData.Price,
|
|
||||||
IsWeapon = rawData.IsWeapon,
|
|
||||||
TargetPos = rawData.TargetPos
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async UniTask<int?> OpenUIAsync(object userData = null, float timeout = 30f)
|
public override async UniTask<int?> OpenUIAsync(object userData = null, float timeout = 30f)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
using System;
|
||||||
using SepCore.Event;
|
using SepCore.Event;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
@ -32,6 +33,7 @@ namespace SepCore.UI
|
||||||
[SerializeField] private float _screenEdgePadding = 0f;
|
[SerializeField] private float _screenEdgePadding = 0f;
|
||||||
|
|
||||||
private DisplayItemInfoContext _context;
|
private DisplayItemInfoContext _context;
|
||||||
|
|
||||||
private Vector3 _targetPos;
|
private Vector3 _targetPos;
|
||||||
|
|
||||||
public void RefreshUI(DisplayItemInfoContext context)
|
public void RefreshUI(DisplayItemInfoContext context)
|
||||||
|
|
@ -53,13 +55,13 @@ namespace SepCore.UI
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_itemTitle != null) _itemTitle.text = _context.Title ?? string.Empty;
|
if (_itemTitle != null) _itemTitle.text = _context.Title ?? string.Empty;
|
||||||
if (_itemTypeText != null) _itemTypeText.text = _context.TypeText ?? string.Empty;
|
if (_itemTypeText != null) _itemTypeText.text = BuildTypeText(_context.ItemType) ?? string.Empty;
|
||||||
if (_itemDescription != null) _itemDescription.text = _context.Description ?? string.Empty;
|
if (_itemDescription != null) _itemDescription.text = _context.Description ?? string.Empty;
|
||||||
if (_itemPrice != null) _itemPrice.text = $"{_context.Price} <sprite name=\"coin\" index=0>";
|
if (_itemPrice != null) _itemPrice.text = $"{_context.Price} <sprite name=\"coin\" index=0>";
|
||||||
|
|
||||||
if (_recycleButton != null)
|
if (_recycleButton != null)
|
||||||
{
|
{
|
||||||
_recycleButton.gameObject.SetActive(_context.IsWeapon);
|
_recycleButton.gameObject.SetActive(_context.ItemType == ItemType.Weapon);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_iconArea != null)
|
if (_iconArea != null)
|
||||||
|
|
@ -193,7 +195,7 @@ namespace SepCore.UI
|
||||||
|
|
||||||
public void OnRecycleButtonClick()
|
public void OnRecycleButtonClick()
|
||||||
{
|
{
|
||||||
if (_context == null || !_context.IsWeapon) return;
|
if (_context == null || _context.ItemType != ItemType.Weapon) return;
|
||||||
GameEntry.Event.Fire(this, ShopWeaponRecycleEventArgs.Create(_context.Index, _context.Price));
|
GameEntry.Event.Fire(this, ShopWeaponRecycleEventArgs.Create(_context.Index, _context.Price));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -201,5 +203,16 @@ namespace SepCore.UI
|
||||||
{
|
{
|
||||||
GameEntry.Event.Fire(this, DisplayItemInfoHideEventArgs.Create(true));
|
GameEntry.Event.Fire(this, DisplayItemInfoHideEventArgs.Create(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string BuildTypeText(ItemType type)
|
||||||
|
{
|
||||||
|
return type switch
|
||||||
|
{
|
||||||
|
ItemType.None => "error",
|
||||||
|
ItemType.Weapon => "武器",
|
||||||
|
ItemType.Prop => "道具",
|
||||||
|
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null)
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -374,18 +374,14 @@ namespace SepCore.UI
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var weaponData = weapon.WeaponData;
|
|
||||||
rawData = new DisplayItemInfoRawData
|
rawData = new DisplayItemInfoRawData
|
||||||
{
|
{
|
||||||
TargetPos = targetPos,
|
TargetPos = targetPos,
|
||||||
Index = index,
|
Index = index,
|
||||||
IconAssetName = weaponData.IconAssetName,
|
Data = weapon.WeaponData,
|
||||||
Title = weaponData.Title,
|
Rarity = weapon.WeaponData.Rarity,
|
||||||
Rarity = weaponData.Rarity,
|
ItemType = ItemType.Weapon,
|
||||||
TypeText = "武器",
|
Price = Mathf.FloorToInt(weapon.WeaponData.Price * Context.WeaponRecycleRate),
|
||||||
Description = ItemDescUtility.CreateWeaponDescription(weaponData),
|
|
||||||
Price = Mathf.FloorToInt(weaponData.Price * Context.WeaponRecycleRate),
|
|
||||||
IsWeapon = true
|
|
||||||
};
|
};
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -417,13 +413,10 @@ namespace SepCore.UI
|
||||||
{
|
{
|
||||||
TargetPos = targetPos,
|
TargetPos = targetPos,
|
||||||
Index = index,
|
Index = index,
|
||||||
IconAssetName = propItem.IconAssetName,
|
Data = propItem,
|
||||||
Title = propItem.Title,
|
|
||||||
Rarity = propItem.Rarity,
|
Rarity = propItem.Rarity,
|
||||||
TypeText = "道具",
|
ItemType = ItemType.Prop,
|
||||||
Description = ItemDescUtility.CreatePropDescription(propItem),
|
Price = 0
|
||||||
Price = 0,
|
|
||||||
IsWeapon = false
|
|
||||||
};
|
};
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
@ -22,7 +23,13 @@ namespace SepCore.UI
|
||||||
{
|
{
|
||||||
_iconArea.OnInit(data.Icon, data.Rarity);
|
_iconArea.OnInit(data.Icon, data.Rarity);
|
||||||
_titleText.text = data.Title;
|
_titleText.text = data.Title;
|
||||||
_typeText.text = data.Type;
|
_typeText.text = data.ItemType switch
|
||||||
|
{
|
||||||
|
ItemType.None => "error",
|
||||||
|
ItemType.Weapon => "武器",
|
||||||
|
ItemType.Prop => "道具",
|
||||||
|
_ => throw new ArgumentOutOfRangeException()
|
||||||
|
};
|
||||||
_descriptionText.text = data.Description;
|
_descriptionText.text = data.Description;
|
||||||
_costText.text = $"{data.Price} <sprite name=\"coin\" index=0>";
|
_costText.text = $"{data.Price} <sprite name=\"coin\" index=0>";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,10 @@
|
||||||
"rootNamespace": "SepCore.UI",
|
"rootNamespace": "SepCore.UI",
|
||||||
"references": [
|
"references": [
|
||||||
"GUID:6055be8ebefd69e48b49212b09b47b2f",
|
"GUID:6055be8ebefd69e48b49212b09b47b2f",
|
||||||
"GUID:47a82ffa13c291447ab895cd0bc251cd",
|
"GUID:f51ebe6a0ceec4240a699833d6309b23",
|
||||||
"GUID:363c5eb08ff8e6a439b85e37b8c20d96",
|
"GUID:363c5eb08ff8e6a439b85e37b8c20d96",
|
||||||
"GUID:f51ebe6a0ceec4240a699833d6309b23"
|
"GUID:47a82ffa13c291447ab895cd0bc251cd",
|
||||||
|
"GUID:436e23dbdc31e7d4fb5c3f804548b2df"
|
||||||
],
|
],
|
||||||
"includePlatforms": [],
|
"includePlatforms": [],
|
||||||
"excludePlatforms": [],
|
"excludePlatforms": [],
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 77816bb3deec31c4ba8881acdd951fea
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -92,9 +92,6 @@ namespace Procedure
|
||||||
LoadDataTable(dataTableName);
|
LoadDataTable(dataTableName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Preload dictionaries
|
|
||||||
LoadDictionary("Default");
|
|
||||||
|
|
||||||
// Preload fonts
|
// Preload fonts
|
||||||
LoadFont("MainFont");
|
LoadFont("MainFont");
|
||||||
LoadTMPFont("MainTMPFont");
|
LoadTMPFont("MainTMPFont");
|
||||||
|
|
@ -114,45 +111,40 @@ namespace Procedure
|
||||||
GameEntry.DataTable.LoadDataTable(dataTableName, dataTableAssetName, this);
|
GameEntry.DataTable.LoadDataTable(dataTableName, dataTableAssetName, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LoadDictionary(string dictionaryName)
|
|
||||||
{
|
|
||||||
string dictionaryAssetName = AssetUtility.GetDictionaryAsset(dictionaryName, false);
|
|
||||||
_loadedFlag.Add(dictionaryAssetName, false);
|
|
||||||
GameEntry.Localization.ReadData(dictionaryAssetName, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LoadFont(string fontName)
|
private void LoadFont(string fontName)
|
||||||
{
|
{
|
||||||
_loadedFlag.Add(Utility.Text.Format("Font.{0}", fontName), false);
|
_loadedFlag.Add(Utility.Text.Format("Font.{0}", fontName), false);
|
||||||
GameEntry.Resource.LoadAsset(AssetUtility.GetFontAsset(fontName), Constant.AssetPriority.FontAsset, new LoadAssetCallbacks(
|
GameEntry.Resource.LoadAsset(AssetUtility.GetFontAsset(fontName), Constant.AssetPriority.FontAsset,
|
||||||
(assetName, asset, duration, userData) =>
|
new LoadAssetCallbacks(
|
||||||
{
|
(assetName, asset, duration, userData) =>
|
||||||
_loadedFlag[Utility.Text.Format("Font.{0}", fontName)] = true;
|
{
|
||||||
UGuiForm.SetMainFont((Font)asset);
|
_loadedFlag[Utility.Text.Format("Font.{0}", fontName)] = true;
|
||||||
Log.Info("Load font '{0}' OK.", fontName);
|
UGuiForm.SetMainFont((Font)asset);
|
||||||
},
|
Log.Info("Load font '{0}' OK.", fontName);
|
||||||
|
},
|
||||||
(assetName, status, errorMessage, userData) =>
|
(assetName, status, errorMessage, userData) =>
|
||||||
{
|
{
|
||||||
Log.Error("Can not load font '{0}' from '{1}' with error message '{2}'.", fontName, assetName, errorMessage);
|
Log.Error("Can not load font '{0}' from '{1}' with error message '{2}'.", fontName, assetName,
|
||||||
}));
|
errorMessage);
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LoadTMPFont(string fontName)
|
private void LoadTMPFont(string fontName)
|
||||||
{
|
{
|
||||||
_loadedFlag.Add(Utility.Text.Format("Font.{0}", fontName), false);
|
_loadedFlag.Add(Utility.Text.Format("Font.{0}", fontName), false);
|
||||||
GameEntry.Resource.LoadAsset(AssetUtility.GetTMPFontAsset(fontName), Constant.AssetPriority.FontAsset, new LoadAssetCallbacks(
|
GameEntry.Resource.LoadAsset(AssetUtility.GetTMPFontAsset(fontName), Constant.AssetPriority.FontAsset,
|
||||||
(assetName, asset, duration, userData) =>
|
new LoadAssetCallbacks(
|
||||||
{
|
(assetName, asset, duration, userData) =>
|
||||||
_loadedFlag[Utility.Text.Format("Font.{0}", fontName)] = true;
|
{
|
||||||
UGuiForm.SetMainTMPFont((TMP_FontAsset)asset);
|
_loadedFlag[Utility.Text.Format("Font.{0}", fontName)] = true;
|
||||||
Log.Info("Load font '{0}' OK.", fontName);
|
UGuiForm.SetMainTMPFont((TMP_FontAsset)asset);
|
||||||
},
|
Log.Info("Load font '{0}' OK.", fontName);
|
||||||
|
},
|
||||||
(assetName, status, errorMessage, userData) =>
|
(assetName, status, errorMessage, userData) =>
|
||||||
{
|
{
|
||||||
Log.Error("Can not load font '{0}' from '{1}' with error message '{2}'.", fontName, assetName, errorMessage);
|
Log.Error("Can not load font '{0}' from '{1}' with error message '{2}'.", fontName, assetName,
|
||||||
}));
|
errorMessage);
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnLoadConfigSuccess(object sender, GameEventArgs e)
|
private void OnLoadConfigSuccess(object sender, GameEventArgs e)
|
||||||
|
|
@ -175,7 +167,8 @@ namespace Procedure
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.Error("Can not load config '{0}' from '{1}' with error message '{2}'.", ne.ConfigAssetName, ne.ConfigAssetName, ne.ErrorMessage);
|
Log.Error("Can not load config '{0}' from '{1}' with error message '{2}'.", ne.ConfigAssetName,
|
||||||
|
ne.ConfigAssetName, ne.ErrorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnLoadDataTableSuccess(object sender, GameEventArgs e)
|
private void OnLoadDataTableSuccess(object sender, GameEventArgs e)
|
||||||
|
|
@ -198,7 +191,8 @@ namespace Procedure
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.Error("Can not load data table '{0}' from '{1}' with error message '{2}'.", ne.DataTableAssetName, ne.DataTableAssetName, ne.ErrorMessage);
|
Log.Error("Can not load data table '{0}' from '{1}' with error message '{2}'.", ne.DataTableAssetName,
|
||||||
|
ne.DataTableAssetName, ne.ErrorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnLoadDictionarySuccess(object sender, GameEventArgs e)
|
private void OnLoadDictionarySuccess(object sender, GameEventArgs e)
|
||||||
|
|
@ -221,7 +215,8 @@ namespace Procedure
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.Error("Can not load dictionary '{0}' from '{1}' with error message '{2}'.", ne.DictionaryAssetName, ne.DictionaryAssetName, ne.ErrorMessage);
|
Log.Error("Can not load dictionary '{0}' from '{1}' with error message '{2}'.", ne.DictionaryAssetName,
|
||||||
|
ne.DictionaryAssetName, ne.ErrorMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,12 @@
|
||||||
"name": "SepCore.Procedure",
|
"name": "SepCore.Procedure",
|
||||||
"rootNamespace": "SepCore.Procedure",
|
"rootNamespace": "SepCore.Procedure",
|
||||||
"references": [
|
"references": [
|
||||||
|
"GUID:6055be8ebefd69e48b49212b09b47b2f",
|
||||||
|
"GUID:f51ebe6a0ceec4240a699833d6309b23",
|
||||||
"GUID:363c5eb08ff8e6a439b85e37b8c20d96",
|
"GUID:363c5eb08ff8e6a439b85e37b8c20d96",
|
||||||
"GUID:47a82ffa13c291447ab895cd0bc251cd",
|
"GUID:47a82ffa13c291447ab895cd0bc251cd",
|
||||||
"GUID:0e1d182005e0ae647ab3fa40f5492dbb",
|
"GUID:436e23dbdc31e7d4fb5c3f804548b2df",
|
||||||
"GUID:6055be8ebefd69e48b49212b09b47b2f",
|
"GUID:0e1d182005e0ae647ab3fa40f5492dbb"
|
||||||
"GUID:f51ebe6a0ceec4240a699833d6309b23"
|
|
||||||
],
|
],
|
||||||
"includePlatforms": [],
|
"includePlatforms": [],
|
||||||
"excludePlatforms": [],
|
"excludePlatforms": [],
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: f7c4b051e63f0c2418a55e8817bf4ba9
|
guid: e185f5edf2aad9e47be7d8a4b4d04966
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
timeCreated: 1528026151
|
|
||||||
licenseType: Pro
|
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
||||||
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||||
using SepCore.DataTable;
|
using SepCore.DataTable;
|
||||||
using SepCore.Definition;
|
using SepCore.Definition;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityGameFramework.Runtime;
|
||||||
|
|
||||||
namespace Entity.EntityData
|
namespace Entity.EntityData
|
||||||
{
|
{
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue