Hi,
I want to create a plugin with button on toolstrip. But I don’t want text. I want a custom icon. I tried many ways, and still nothing. In logs i have output of invalid assetID but it’s copied from editor. I dont understand this, please help. Here is a code:
using System;
using System.Collections.Generic;
using FlaxEngine;
using FlaxEditor;
using FlaxEditor.GUI;
namespace Plugins
{
/// <summary>
/// TestPlugin Script.
/// </summary>
public class TestPlugin : EditorPlugin
{
private ToolStripButton btn;
public override void InitializeEditor()
{
base.InitializeEditor();
var guid = new Guid("15fa8b0045de732834800b8027779b8d"); <-- nevermind i need to parse it
var tex = Content.Load<Texture>(guid); <----- This everytime null.
Editor.UI.ToolStrip.AddSeparator();
var btn = Editor.UI.ToolStrip.AddButton(Editor.Icons.Add32); <--- I want custom icon here not editor one
btn.Clicked += () => MessageBox.Show("Wow!!!");
}
public override void DeinitializeEditor()
{
if(btn!=null)
{
Editor.UI.ToolStrip.RemoveChild(btn);
btn.Dispose();
btn = null;
}
base.DeinitializeEditor();
}
}
}