Files
FlaxEngine/Source/Editor/Content/Proxy/AnimationGraphProxy.cs
2023-01-10 15:29:37 +01:00

46 lines
1.3 KiB
C#

// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Windows;
using FlaxEditor.Windows.Assets;
using FlaxEngine;
namespace FlaxEditor.Content
{
/// <summary>
/// A <see cref="AnimationGraph"/> asset proxy object.
/// </summary>
/// <seealso cref="FlaxEditor.Content.BinaryAssetProxy" />
[ContentContextMenu("New/Animation/Animation Graph")]
public class AnimationGraphProxy : BinaryAssetProxy
{
/// <inheritdoc />
public override string Name => "Animation Graph";
/// <inheritdoc />
public override EditorWindow Open(Editor editor, ContentItem item)
{
return new AnimationGraphWindow(editor, item as AssetItem);
}
/// <inheritdoc />
public override Color AccentColor => Color.FromRGB(0x00B371);
/// <inheritdoc />
public override Type AssetType => typeof(AnimationGraph);
/// <inheritdoc />
public override bool CanCreate(ContentFolder targetLocation)
{
return targetLocation.CanHaveAssets;
}
/// <inheritdoc />
public override void Create(string outputPath, object arg)
{
if (Editor.CreateAsset(Editor.NewAssetType.AnimationGraph, outputPath))
throw new Exception("Failed to create new asset.");
}
}
}