-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: New component Transactions Data | of an NFT - Solana + Ethereum
- Loading branch information
Showing
10 changed files
with
601 additions
and
0 deletions.
There are no files selected for viewing
Git LFS file not shown
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Git LFS file not shown
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using UnityEngine; | ||
|
||
namespace NFTPort.Editor | ||
{ | ||
using UnityEditor; | ||
using Internal; | ||
|
||
[CustomEditor(typeof(Txn_NFT))] | ||
public class Txn_NFT_Editor : Editor | ||
{ | ||
public override void OnInspectorGUI() | ||
{ | ||
|
||
Txn_NFT myScript = (Txn_NFT)target; | ||
|
||
|
||
Texture banner = Resources.Load<Texture>("c_tx_nft"); | ||
GUILayout.BeginHorizontal(); | ||
GUILayout.Box(banner); | ||
GUILayout.EndHorizontal(); | ||
|
||
if (GUILayout.Button("Get NFT Transactions", GUILayout.Height(45))) | ||
{ | ||
PortUser.SetFromEditorWin(); | ||
myScript.Run(); | ||
} | ||
|
||
|
||
if(GUILayout.Button("View Documentation", GUILayout.Height(25))) | ||
Application.OpenURL(PortConstants.Docs_Txns_NFT); | ||
DrawDefaultInspector(); | ||
} | ||
} | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using UnityEngine; | ||
using System; | ||
|
||
/// <summary> | ||
/// Draws the field/property ONLY if the compared property compared by the comparison type with the value of comparedValue returns true. | ||
/// Based on: https://forum.unity.com/threads/draw-a-field-only-if-a-condition-is-met.448855/ | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true)] | ||
public class DrawIfAttribute : PropertyAttribute | ||
{ | ||
#region Fields | ||
|
||
public string comparedPropertyName { get; private set; } | ||
public object comparedValue { get; private set; } | ||
public DisablingType disablingType { get; private set; } | ||
|
||
/// <summary> | ||
/// Types of comperisons. | ||
/// </summary> | ||
public enum DisablingType | ||
{ | ||
ReadOnly = 2, | ||
DontDraw = 3, | ||
DontDrawInverse = 4 | ||
} | ||
|
||
#endregion | ||
|
||
/// <summary> | ||
/// Only draws the field only if a condition is met. Supports enum and bools. | ||
/// </summary> | ||
/// <param name="comparedPropertyName">The name of the property that is being compared (case sensitive).</param> | ||
/// <param name="comparedValue">The value the property is being compared to.</param> | ||
/// <param name="disablingType">The type of disabling that should happen if the condition is NOT met. Defaulted to DisablingType.DontDraw.</param> | ||
public DrawIfAttribute(string comparedPropertyName, object comparedValue, DisablingType disablingType = DisablingType.DontDraw) | ||
{ | ||
this.comparedPropertyName = comparedPropertyName; | ||
this.comparedValue = comparedValue; | ||
this.disablingType = disablingType; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.