From ae0420d83a48e5f6d6f28c1a8364be0af974fb7a Mon Sep 17 00:00:00 2001 From: "sz.sahaj" <43649755+saszer@users.noreply.github.com> Date: Wed, 17 Aug 2022 22:27:21 +1000 Subject: [PATCH] other --- Editor/ConnectPlayerWallet_Editor.cs | 2 - Editor/FeatureSpawner.cs | 14 +++++++ Editor/NFTPortSettings.cs | 56 ++++++++++++++++++++++++++-- Editor/Txn_Account_Editor.cs | 2 +- 4 files changed, 67 insertions(+), 7 deletions(-) diff --git a/Editor/ConnectPlayerWallet_Editor.cs b/Editor/ConnectPlayerWallet_Editor.cs index 323e527..dcea045 100644 --- a/Editor/ConnectPlayerWallet_Editor.cs +++ b/Editor/ConnectPlayerWallet_Editor.cs @@ -25,8 +25,6 @@ public override void OnInspectorGUI() if (GUILayout.Button("View Documentation", GUILayout.Height(25))) Application.OpenURL(PortConstants.Docs_PlayerWalletConnect); - - EditorGUILayout.HelpBox("This feature currently only supports WebGL build with MetaMask wallet on EVM network", MessageType.Warning); EditorGUILayout.LabelField(""); GuiLine(); diff --git a/Editor/FeatureSpawner.cs b/Editor/FeatureSpawner.cs index 41f5436..ffdbbc7 100644 --- a/Editor/FeatureSpawner.cs +++ b/Editor/FeatureSpawner.cs @@ -95,6 +95,20 @@ static void Spawn_Txn_Account() { Selection.activeGameObject= new GameObject(PortConstants.FeatureName_Txn_Account).AddComponent().gameObject; } + + [MenuItem(PortConstants.BaseFeatureSpawnerMenu + PortConstants.FeatureName_Txn_NFT)] + [MenuItem(GameObjMenu + PortConstants.FeatureName_Txn_NFT)] + static void Spawn_Txn_NFT() + { + Selection.activeGameObject= new GameObject(PortConstants.FeatureName_Txn_NFT).AddComponent().gameObject; + } + + [MenuItem(PortConstants.BaseFeatureSpawnerMenu + PortConstants.FeatureName_Txn_Collection)] + [MenuItem(GameObjMenu + PortConstants.FeatureName_Txn_Collection)] + static void Spawn_Txn_Collection() + { + Selection.activeGameObject= new GameObject(PortConstants.FeatureName_Txn_Collection).AddComponent().gameObject; + } diff --git a/Editor/NFTPortSettings.cs b/Editor/NFTPortSettings.cs index 63aa642..4435f93 100644 --- a/Editor/NFTPortSettings.cs +++ b/Editor/NFTPortSettings.cs @@ -17,6 +17,12 @@ public class NFTPortSettings : EditorWindow private bool ranLatestrel = false; static PkgJson releasedPkgJson = null; static private bool NFTPortStarted; + + GUIStyle _horizontalGroup; + GUIStyle _sampleButtonStyle; + static int _selectedSample; + + [MenuItem("NFTPort/Home")] public static void ShowWindow() { @@ -103,13 +109,36 @@ static void LatestReleaseCallback(PkgJson pkg) } } + + void InitStyles() + { + _horizontalGroup = new GUIStyle(); + _horizontalGroup.padding = new RectOffset(0, 0, 4, 4); + + _sampleButtonStyle = new GUIStyle(GUI.skin.FindStyle("button")); + _sampleButtonStyle.imagePosition = ImagePosition.ImageAbove; + _sampleButtonStyle.padding = new RectOffset(10, 10, 15, 15); + _sampleButtonStyle.fontStyle = FontStyle.Bold; + } + private bool apiIsPass = true; void OnGUI() { + InitStyles(); + Texture banner = Resources.Load("banner"); - GUILayout.Box(banner); - + GUIContent button_banner = new GUIContent(banner, "NFTPort.xyz"); + if (GUILayout.Button(button_banner, GUILayout.Width(530), GUILayout.Height(270))) + Application.OpenURL(PortConstants.FeatureList); + var hover = GUI.tooltip; + + Texture2D Portcursor = Resources.Load("nftport_logo 1"); + if (hover == "NFTPort.xyz") + Cursor.SetCursor(Portcursor, new Vector2(0,0),0); + //EditorGUIUtility.AddCursorRect(new Rect(0, 0, 500, 500), MouseCursor.FPS); + + GUILayout.Label("Welcome to NFTPort Unity SDK ", EditorStyles.whiteLargeLabel); GUILayout.Label("\n" + " Create cross-chain compatible NFT games \n and products in Unity with fast and reliable data.\n" + @@ -205,6 +234,25 @@ void OnGUI() Application.OpenURL(PortConstants.Dashboard); GUILayout.EndHorizontal(); + + GuiLine(); + + EditorGUILayout.LabelField(""); + EditorGUILayout.LabelField("Basic examples can be imported via package Manager, Explore more projects below:"); + EditorGUILayout.BeginHorizontal(); + + Texture button_tex = (Texture)Resources.Load("pg-gallery1"); + GUIContent button_tex_con = new GUIContent(button_tex); + if (GUILayout.Button(button_tex_con,_sampleButtonStyle, GUILayout.Width(260), GUILayout.Height(100))) + Application.OpenURL(PortConstants.AdvPlaygroundGallery); + + Texture button_tex2 = (Texture)Resources.Load("pg-gallery2"); + GUIContent button_tex_con2 = new GUIContent(button_tex2); + if (GUILayout.Button(button_tex_con2,_sampleButtonStyle, GUILayout.Width(260), GUILayout.Height(100))) + Application.OpenURL(PortConstants.PlaygroundButterflyMint); + + EditorGUILayout.EndHorizontal(); + } @@ -264,8 +312,8 @@ static void ShowHomeWindow() } static void SetSize(NFTPortSettings win) { - win.minSize = new Vector2(530, 650); - win.maxSize = new Vector2(530, 650); + win.minSize = new Vector2(530, 750); + win.maxSize = new Vector2(530, 750); } static void GuiLine( int i_height = 1 ) diff --git a/Editor/Txn_Account_Editor.cs b/Editor/Txn_Account_Editor.cs index 8aee38a..cccf51d 100644 --- a/Editor/Txn_Account_Editor.cs +++ b/Editor/Txn_Account_Editor.cs @@ -19,7 +19,7 @@ public override void OnInspectorGUI() GUILayout.Box(banner); GUILayout.EndHorizontal(); - if (GUILayout.Button("Get Account NFT TXNs", GUILayout.Height(45))) + if (GUILayout.Button("Get Account NFT Transactions", GUILayout.Height(45))) { PortUser.SetFromEditorWin(); myScript.Run();