//------------------------------------------------------------ // 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 ResourcePackVersionList { /// /// 资源。 /// [StructLayout(LayoutKind.Auto)] public struct Resource { private readonly string m_Name; private readonly string m_Variant; private readonly string m_Extension; private readonly byte m_LoadType; private readonly long m_Offset; private readonly int m_Length; private readonly int m_HashCode; private readonly int m_CompressedLength; private readonly int m_CompressedHashCode; /// /// 初始化资源的新实例。 /// /// 资源名称。 /// 资源变体名称。 /// 资源扩展名称。 /// 资源加载方式。 /// 资源偏移。 /// 资源长度。 /// 资源哈希值。 /// 资源压缩后长度。 /// 资源压缩后哈希值。 public Resource(string name, string variant, string extension, byte loadType, long offset, int length, int hashCode, int compressedLength, int compressedHashCode) { if (string.IsNullOrEmpty(name)) { throw new GameFrameworkException("Name is invalid."); } m_Name = name; m_Variant = variant; m_Extension = extension; m_LoadType = loadType; m_Offset = offset; m_Length = length; m_HashCode = hashCode; m_CompressedLength = compressedLength; m_CompressedHashCode = compressedHashCode; } /// /// 获取资源名称。 /// public string Name { get { return m_Name; } } /// /// 获取资源变体名称。 /// public string Variant { get { return m_Variant; } } /// /// 获取资源扩展名称。 /// public string Extension { get { return m_Extension; } } /// /// 获取资源加载方式。 /// public byte LoadType { get { return m_LoadType; } } /// /// 获取资源偏移。 /// public long Offset { get { return m_Offset; } } /// /// 获取资源长度。 /// public int Length { get { return m_Length; } } /// /// 获取资源哈希值。 /// public int HashCode { get { return m_HashCode; } } /// /// 获取资源压缩后长度。 /// public int CompressedLength { get { return m_CompressedLength; } } /// /// 获取资源压缩后哈希值。 /// public int CompressedHashCode { get { return m_CompressedHashCode; } } } } }