// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
namespace FlaxEditor.Content
{
///
/// Content item that contains data.
///
///
public sealed class PrefabItem : JsonAssetItem
{
///
/// Initializes a new instance of the class.
///
/// The asset path.
/// The asset identifier.
public PrefabItem(string path, Guid id)
: base(path, id, PrefabProxy.AssetTypename)
{
}
///
public override bool OnEditorDrag(object context)
{
return true;
}
///
public override Actor OnEditorDrop(object context)
{
return PrefabManager.SpawnPrefab(FlaxEngine.Content.LoadAsync(ID), null);
}
///
public override ContentItemType ItemType => ContentItemType.Asset;
///
public override ContentItemSearchFilter SearchFilter => ContentItemSearchFilter.Prefab;
///
public override SpriteHandle DefaultThumbnail => SpriteHandle.Invalid;
///
public override bool IsOfType(Type type)
{
return type.IsAssignableFrom(typeof(Prefab));
}
}
}