WuhuIslandTesting/Library/PackageCache/com.stresslevelzero.marrow.sdk@1.2.0/Scripts/SLZ.Marrow/SLZ.Marrow.Warehouse/PackedAsset.cs
2025-01-07 02:06:59 +01:00

51 lines
No EOL
1.4 KiB
C#

using System;
using System.Collections.Generic;
using UnityEngine;
namespace SLZ.Marrow.Warehouse
{
[Serializable]
public struct PackedAsset
{
public string title;
public MarrowAsset marrowAsset;
public List<PackedSubAsset> subAssets;
public Type assetType;
private string assetFieldName;
public PackedAsset(string title, MarrowAsset marrowAsset, Type assetType, string assetFieldName)
{
this.title = title;
this.marrowAsset = marrowAsset;
this.subAssets = new List<PackedSubAsset>();
this.assetFieldName = assetFieldName;
this.assetType = assetType;
}
public PackedAsset(string title, List<PackedSubAsset> subAssets, Type assetType, string assetFieldName)
{
this.title = title;
this.marrowAsset = null;
this.subAssets = subAssets;
this.assetType = assetType;
this.assetFieldName = assetFieldName;
}
public bool HasSubAssets()
{
return subAssets != null && subAssets.Count > 0;
}
}
[Serializable]
public struct PackedSubAsset
{
public string subTitle;
public MarrowAsset subAsset;
public PackedSubAsset(string subTitle, MarrowAsset subAsset)
{
this.subTitle = subTitle;
this.subAsset = subAsset;
}
}
}