Add support for custom drag&drop into level/prefab viewports from custom asset items
This commit is contained in:
@@ -103,14 +103,26 @@ namespace FlaxEditor.Content
|
||||
/// Implementation of <see cref="BinaryAssetItem"/> for <see cref="Model"/> assets.
|
||||
/// </summary>
|
||||
/// <seealso cref="FlaxEditor.Content.BinaryAssetItem" />
|
||||
public class ModelAssetItem : BinaryAssetItem
|
||||
public class ModelItem : BinaryAssetItem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public ModelAssetItem(string path, ref Guid id, string typeName, Type type)
|
||||
public ModelItem(string path, ref Guid id, string typeName, Type type)
|
||||
: base(path, ref id, typeName, type, ContentItemSearchFilter.Model)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool OnEditorDrag(object context)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Actor OnEditorDrop(object context)
|
||||
{
|
||||
return new StaticModel { Model = FlaxEngine.Content.LoadAsync<Model>(ID) };
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void OnBuildTooltipText(StringBuilder sb)
|
||||
{
|
||||
@@ -142,14 +154,26 @@ namespace FlaxEditor.Content
|
||||
/// Implementation of <see cref="BinaryAssetItem"/> for <see cref="SkinnedModel"/> assets.
|
||||
/// </summary>
|
||||
/// <seealso cref="FlaxEditor.Content.BinaryAssetItem" />
|
||||
public class SkinnedModelAssetItem : BinaryAssetItem
|
||||
public class SkinnedModeItem : BinaryAssetItem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public SkinnedModelAssetItem(string path, ref Guid id, string typeName, Type type)
|
||||
public SkinnedModeItem(string path, ref Guid id, string typeName, Type type)
|
||||
: base(path, ref id, typeName, type, ContentItemSearchFilter.Model)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool OnEditorDrag(object context)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Actor OnEditorDrop(object context)
|
||||
{
|
||||
return new AnimatedModel { SkinnedModel = FlaxEngine.Content.LoadAsync<SkinnedModel>(ID) };
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void OnBuildTooltipText(StringBuilder sb)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user