//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
using System.Runtime.InteropServices;
namespace GameFramework.Resource
{
public partial struct UpdatableVersionList
{
///
/// 资源。
///
[StructLayout(LayoutKind.Auto)]
public struct Asset
{
private static readonly int[] EmptyIntArray = new int[] { };
private readonly string m_Name;
private readonly int[] m_DependencyAssetIndexes;
///
/// 初始化资源的新实例。
///
/// 资源名称。
/// 资源包含的依赖资源索引集合。
public Asset(string name, int[] dependencyAssetIndexes)
{
if (string.IsNullOrEmpty(name))
{
throw new GameFrameworkException("Name is invalid.");
}
m_Name = name;
m_DependencyAssetIndexes = dependencyAssetIndexes ?? EmptyIntArray;
}
///
/// 获取资源名称。
///
public string Name
{
get
{
return m_Name;
}
}
///
/// 获取资源包含的依赖资源索引集合。
///
/// 资源包含的依赖资源索引集合。
public int[] GetDependencyAssetIndexes()
{
return m_DependencyAssetIndexes;
}
}
}
}