Skip to content

Commit

Permalink
other
Browse files Browse the repository at this point in the history
  • Loading branch information
saszer committed Aug 17, 2022
1 parent 310bba3 commit ae0420d
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 7 deletions.
2 changes: 0 additions & 2 deletions Editor/ConnectPlayerWallet_Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
14 changes: 14 additions & 0 deletions Editor/FeatureSpawner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,20 @@ static void Spawn_Txn_Account()
{
Selection.activeGameObject= new GameObject(PortConstants.FeatureName_Txn_Account).AddComponent<Txn_Account>().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<Txn_NFT>().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<Txn_Collection>().gameObject;
}



Expand Down
56 changes: 52 additions & 4 deletions Editor/NFTPortSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down Expand Up @@ -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<Texture>("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<Texture2D>("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" +
Expand Down Expand Up @@ -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<Texture>("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<Texture>("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();


}

Expand Down Expand Up @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion Editor/Txn_Account_Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit ae0420d

Please sign in to comment.