Merge branch 'jsontype-thumbnail' of https://github.com/Tryibion/FlaxEngine into Tryibion-jsontype-thumbnail
This commit is contained in:
@@ -166,6 +166,18 @@ namespace FlaxEditor.Content
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string Name { get; } = Utilities.Utils.GetPropertyNameUI(typeof(T).Name);
|
public override string Name { get; } = Utilities.Utils.GetPropertyNameUI(typeof(T).Name);
|
||||||
|
|
||||||
|
private SpriteHandle _thumbnail;
|
||||||
|
|
||||||
|
public SpawnableJsonAssetProxy()
|
||||||
|
{
|
||||||
|
_thumbnail = SpriteHandle.Invalid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SpawnableJsonAssetProxy(SpriteHandle thumbnail)
|
||||||
|
{
|
||||||
|
_thumbnail = thumbnail;
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override bool CanCreate(ContentFolder targetLocation)
|
public override bool CanCreate(ContentFolder targetLocation)
|
||||||
{
|
{
|
||||||
@@ -177,6 +189,12 @@ namespace FlaxEditor.Content
|
|||||||
{
|
{
|
||||||
Editor.SaveJsonAsset(outputPath, new T());
|
Editor.SaveJsonAsset(outputPath, new T());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override AssetItem ConstructItem(string path, string typeName, ref Guid id)
|
||||||
|
{
|
||||||
|
return _thumbnail.IsValid ? new JsonAssetItem(path, id, typeName, _thumbnail) : base.ConstructItem(path, typeName, ref id);
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string TypeName { get; } = typeof(T).FullName;
|
public override string TypeName { get; } = typeof(T).FullName;
|
||||||
|
|||||||
Reference in New Issue
Block a user