45 lines
1.4 KiB
C#
45 lines
1.4 KiB
C#
//------------------------------------------------------------
|
|
// Game Framework
|
|
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
|
|
// Homepage: https://gameframework.cn/
|
|
// Feedback: mailto:ellan@gameframework.cn
|
|
//------------------------------------------------------------
|
|
|
|
using GameFramework;
|
|
using GeometryTD.Definition;
|
|
using GeometryTD.UI;
|
|
using UnityEngine;
|
|
using UnityEngine.Serialization;
|
|
using UnityGameFramework.Runtime;
|
|
|
|
namespace GeometryTD.CustomComponent
|
|
{
|
|
public class BuiltinDataComponent : GameFrameworkComponent
|
|
{
|
|
[SerializeField] private TextAsset _buildInfoTextAsset = null;
|
|
|
|
[SerializeField] private UpdateResourceForm _updateResourceFormTemplate = null;
|
|
|
|
private BuildInfo _buildInfo = null;
|
|
|
|
public BuildInfo BuildInfo => _buildInfo;
|
|
|
|
public UpdateResourceForm UpdateResourceFormTemplate => _updateResourceFormTemplate;
|
|
|
|
public void InitBuildInfo()
|
|
{
|
|
if (_buildInfoTextAsset == null || string.IsNullOrEmpty(_buildInfoTextAsset.text))
|
|
{
|
|
Log.Info("Build info can not be found or empty.");
|
|
return;
|
|
}
|
|
|
|
_buildInfo = Utility.Json.ToObject<BuildInfo>(_buildInfoTextAsset.text);
|
|
if (_buildInfo == null)
|
|
{
|
|
Log.Warning("Parse build info failure.");
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
} |