// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Windows;
using FlaxEditor.Windows.Assets;
using FlaxEngine;
namespace FlaxEditor.Content
{
///
/// A asset proxy object.
///
///
[ContentContextMenu("New/Gameplay Globals")]
public class GameplayGlobalsProxy : BinaryAssetProxy
{
///
public override string Name => "Gameplay Globals";
///
public override EditorWindow Open(Editor editor, ContentItem item)
{
return new GameplayGlobalsWindow(editor, (AssetItem)item);
}
///
public override Color AccentColor => Color.FromRGB(0xccff33);
///
public override Type AssetType => typeof(GameplayGlobals);
///
public override bool CanCreate(ContentFolder targetLocation)
{
return targetLocation.CanHaveAssets;
}
///
public override void Create(string outputPath, object arg)
{
var asset = FlaxEngine.Content.CreateVirtualAsset();
if (asset.Save(outputPath))
throw new Exception("Failed to create new asset.");
FlaxEngine.Object.Destroy(asset);
}
}
}