Skip to content

Commit

Permalink
feat: Adds NFT Data | NFT Details feature
Browse files Browse the repository at this point in the history
  • Loading branch information
saszer committed Jun 6, 2022
1 parent 0e790a8 commit 74d6ba1
Show file tree
Hide file tree
Showing 10 changed files with 423 additions and 5 deletions.
6 changes: 6 additions & 0 deletions Editor/FeatureSpawner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ public class FeatureSpawner : EditorWindow
//GameObject
private const string GameObjMenu = "GameObject/NFTPort/";

[MenuItem(PortConstants.BaseFeatureSpawnerMenu + PortConstants.FeatureName_NFT_Details)]
[MenuItem(GameObjMenu + PortConstants.FeatureName_NFT_Details)]
static void Spawn_NFTDetails()
{
Selection.activeGameObject= new GameObject(PortConstants.FeatureName_NFT_Details).AddComponent<NFT_Details>().gameObject;
}

[MenuItem(PortConstants.BaseFeatureSpawnerMenu + PortConstants.FeatureName_NFTs_OfAccount)]
[MenuItem(GameObjMenu + PortConstants.FeatureName_NFTs_OfAccount)]
Expand Down
33 changes: 33 additions & 0 deletions Editor/NFTs_Details_Editor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using UnityEngine;

namespace NFTPort.Editor
{
using UnityEditor;
using Internal;

[CustomEditor(typeof(NFT_Details))]
public class NFTs_Details_Editor : Editor
{
public override void OnInspectorGUI()
{

NFT_Details myScript = (NFT_Details)target;


Texture banner = Resources.Load<Texture>("c_nftdata_details");
GUILayout.BeginHorizontal();
GUILayout.Box(banner);
GUILayout.EndHorizontal();

if (GUILayout.Button("GET NFT Details", GUILayout.Height(45)))
{
myScript.Run();
}

if(GUILayout.Button("View Documentation", GUILayout.Height(25)))
Application.OpenURL(PortConstants.NFTs_OfAccount);
DrawDefaultInspector();
}
}
}

11 changes: 11 additions & 0 deletions Editor/NFTs_Details_Editor.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Editor/Resources/c_nftdata_details.psd
Git LFS file not shown
134 changes: 134 additions & 0 deletions Editor/Resources/c_nftdata_details.psd.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Runtime/Internal/PortConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public static class PortConstants
public const string Docs_GettingStarted = "https://docs.nftport.xyz/docs/nftport/ZG9jOjUwMzc2NzA5-getting-started";
public const string Docs_StorageFile = "https://docs.nftport.xyz/docs/nftport/ZG9jOjYwODM0NTY3-storage-upload-file";
public const string Docs_StorageMetadata= "https://docs.nftport.xyz/docs/nftport/ZG9jOjYwODM0NTY4-storage-upload-metadata";
public const string Docs_NFTDetails = "https://docs.nftport.xyz/docs/nftport/ZG9jOjU3MTU2NTE5-player-wallet-connect";
public const string NFTs_OfAccount = "https://docs.nftport.xyz/docs/nftport/ZG9jOjUyMzI4NTkz-nf-ts-owned-by-an-account";
public const string NFTs_OfContract = "https://docs.nftport.xyz/docs/nftport/ZG9jOjUzNjI2MzQ0-nf-ts-of-a-contract-collection";
public const string Docs_Mint_URL = "https://docs.nftport.xyz/docs/nftport/ZG9jOjU1MDM4OTgw-minting-w-url";
Expand All @@ -24,6 +25,7 @@ public static class PortConstants
public const string BaseComponentMenu = "NFTPort/";
public const string BaseFeatureSpawnerMenu = "NFTPort/Spawner/";
public const string FeatureName_ConnectUserWallet = "Connect Player Wallet";
public const string FeatureName_NFT_Details = "NFT Data | Details";
public const string FeatureName_NFTs_OfContract = "NFT Data | of a contract-collection";
public const string FeatureName_NFTs_OfAccount = "NFT Data | of an Account";
public const string FeatureName_StorageFiles = "Storage | Upload File";
Expand Down
5 changes: 5 additions & 0 deletions Runtime/Internal/models/NFTs_model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ public class NFTs_model
{
public string response;
public List<Nft> nfts;
public Nft nft;
public Contract contract;
public string owner;
public int total;
public object continuation;
}
Expand Down Expand Up @@ -83,12 +85,15 @@ public class Nft
public string metadata_url;
public string file_url;
public string cached_file_url;
public string animation_url;
public string cached_animation_url;
public DateTime mint_date;
public FileInformation file_information;
public DateTime updated_date;
public string description;
public string creator_address;
public Assets assets;

}

[Serializable]
Expand Down
Loading

0 comments on commit 74d6ba1

Please sign in to comment.