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; } } }