Files
2025-11-30 08:35:03 +02:00

52 lines
1.1 KiB
C#

using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
using Needle.Engine.Editors;
namespace Needle.Engine.Deployment
{
public class BaseDeployToEditor : Editor
{
public override VisualElement CreateInspectorGUI()
{
var v = new VisualElement();
v.Add(new UpgradeButton());
var main = new IMGUIContainer();
main.onGUIHandler = () =>
{
if (!OnBeforeInspectorGUI()) return;
OnInspectorGUI();
};
v.Add(main);
return v;
}
private static GUIStyle miniLabelWrap;
protected bool OnBeforeInspectorGUI()
{
miniLabelWrap ??= new GUIStyle(EditorStyles.miniLabel) { wordWrap = true };
if (!LicenseCheck.HasLicense)
{
GUILayout.Label("Please get a Needle Engine license to deploy your project to this platform.", miniLabelWrap);
return false;
}
if (!LicenseCheck.LicenseIsActive)
{
NeedleCloudGUI.DrawLicenseNotActiveGUI();
return false;
}
if (!LicenseCheck.HasCommercialLicense)
{
GUILayout.Space(25);
NeedleCloudGUI.DrawGoProGUI();
GUILayout.Space(25);
return false;
}
return true;
}
}
}