Skip to content

Commit

Permalink
feat: New Feature : Transfer NFT
Browse files Browse the repository at this point in the history
  • Loading branch information
saszer committed Sep 7, 2022
1 parent b916010 commit c2ce53b
Show file tree
Hide file tree
Showing 11 changed files with 593 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Editor/FeatureSpawner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ static void Burn_NFT()
{
Selection.activeGameObject= new GameObject(PortConstants.FeatureName_Burn_NFT).AddComponent<Burn_NFT>().gameObject;
}

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

[MenuItem(PortConstants.BaseFeatureSpawnerMenu + PortConstants.FeatureName_Update_NFT)]
[MenuItem(GameObjMenu + PortConstants.FeatureName_Update_NFT)]
Expand Down
3 changes: 3 additions & 0 deletions Editor/Resources/c_product_update 1.psd
Git LFS file not shown
134 changes: 134 additions & 0 deletions Editor/Resources/c_product_update 1.psd.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_transferNFT.psd
Git LFS file not shown
134 changes: 134 additions & 0 deletions Editor/Resources/c_transferNFT.psd.meta

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

38 changes: 38 additions & 0 deletions Editor/Transfer_NFT_Editor1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using UnityEngine;

namespace NFTPort.Editor
{
using UnityEditor;
using Internal;

[CustomEditor(typeof(Transfer_NFT))]
public class Transfer_NFT_Editor : Editor
{
public override void OnInspectorGUI()
{

Transfer_NFT myScript = (Transfer_NFT)target;


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

if (GUILayout.Button("Transfer NFT", GUILayout.Height(45)))
{
PortUser.SetFromEditorWin();
myScript.Run();
}

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

EditorGUILayout.HelpBox("Transferring is possible only if the token is owned by the contract owner and the token has not been transferred/sold yet.", MessageType.Info);


DrawDefaultInspector();
}
}
}

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

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

2 changes: 1 addition & 1 deletion Runtime/Burn_NFT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ IEnumerator CallAPIProcess(CustomNFT nft)
afterSuccess.Invoke();

if(debugErrorLog)
Debug.Log($"NFTPort | NFT Update Success (⌐■_■) : at: {minted.transaction_external_url}" );
Debug.Log($"NFTPort | NFT Burn Success (⌐■_■) : at: {minted.transaction_external_url}" );
}

request.Dispose();
Expand Down
2 changes: 2 additions & 0 deletions Runtime/Internal/PortConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public static class PortConstants
public const string Txn_Collection = "https://docs.nftport.xyz/docs/nftport/ZG9jOjgzODU5NDUx-transaction-data-collection-contract";
public const string Docs_Update_NFT = "https://docs.nftport.xyz/docs/nftport/ZG9jOjg2MTE3MTg4-customizable-minted-update-nft";

public const string Docs_Transfer_NFT = "https://docs.nftport.xyz/docs/nftport/ZG9jOjg2MTE3MTg4-customizable-minted-update-nft";
public const string Docs_Burn_NFT = "https://docs.nftport.xyz/docs/nftport/ZG9jOjg2MTE3MTg4-customizable-minted-update-nft";


Expand Down Expand Up @@ -59,6 +60,7 @@ public static class PortConstants
public const string FeatureName_Txn_Collection = "Transaction Data | Collection";
public const string FeatureName_Update_NFT = "Customizable minted | Update NFT";
public const string FeatureName_Burn_NFT = "Customizable minted | Burn NFT";
public const string FeatureName_Transfer_NFT = "Customizable minted | Transfer NFT";

}
}
Expand Down
Loading

0 comments on commit c2ce53b

Please sign in to comment.