Skip to content

Commit

Permalink
Merge pull request #42 from TreasureProject/develop
Browse files Browse the repository at this point in the history
v0.2.8
  • Loading branch information
alecananian authored Apr 23, 2024
2 parents 0f2aff1 + 8824c7f commit 51bee1a
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 4 deletions.
8 changes: 8 additions & 0 deletions Assets/Plugins/WebGL.meta

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

11 changes: 11 additions & 0 deletions Assets/Plugins/WebGL/WebGLClipboard.jslib
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// WebGLClipboard.jslib
mergeInto(LibraryManager.library, {
CopyToClipboard: function(textPointer) {
var text = UTF8ToString(textPointer);
navigator.clipboard.writeText(text).then(function() {
console.log('Text copied to clipboard');
}).catch(function(err) {
console.error('Could not copy text:', err);
});
}
});
32 changes: 32 additions & 0 deletions Assets/Plugins/WebGL/WebGLClipboard.jslib.meta

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

4 changes: 2 additions & 2 deletions Assets/Treasure/TDK/Runtime/Common/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public static class Constants
{ Contract.Consumables, "0xf3d00a2559d84de7ac093443bcaada5f4ee4165c" },
{ Contract.Legions, "0xfe8c1ac365ba6780aec5a985d989b327c27670a1" },
{ Contract.Treasures, "0xebba467ecb6b21239178033189ceae27ca12eadf" },
{ Contract.CorruptionRemoval, "0xebba467ecb6b21239178033189ceae27ca12eadf" },
{ Contract.CorruptionRemoval, "0x08f3533acdf2b9c400204056f771bdd6f1f1c200" },
{ Contract.ERC1155TokenSetCorruptionHandler, "0x3c62778d8e01ed17c1048b64edaf121d36c71a4e" },
{ Contract.HarvesterEmberwing, "0x08f3533acdf2b9c400204056f771bdd6f1f1c200" },
{ Contract.HarvesterEmberwing, "0x36882e71d11eadd9f869b0fd70d18d5045939986" },
{ Contract.ZeeverseZee, "0x094fa8ae08426ab180e71e60fa253b079e13b9fe" },
{ Contract.ZeeverseItems, "0x58318bceaa0d249b62fad57d134da7475e551b47" },
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/Treasure/TDK/Runtime/Connect/Utils/CopyButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private void Start()
{
button.onClick.AddListener(() =>
{
GUIUtility.systemCopyBuffer = _textToCopy;
ClipboardHelper.Copy(_textToCopy);
icon.sprite = checkIcon;
});
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/Treasure/TDK/Runtime/TDKVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
public static class TDKVersion
{
public static string name = "tdk-unity";
public static string version = "0.2.7";
public static string version = "0.2.8";
}
}
17 changes: 17 additions & 0 deletions Assets/Treasure/TDK/Runtime/Utils/ClipboardHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System.Runtime.InteropServices;
using UnityEngine;

public static class ClipboardHelper
{
[DllImport("__Internal")]
private static extern void CopyToClipboard(string text);

public static void Copy(string text)
{
#if UNITY_WEBGL
CopyToClipboard(text);
#else
GUIUtility.systemCopyBuffer = text;
#endif
}
}
11 changes: 11 additions & 0 deletions Assets/Treasure/TDK/Runtime/Utils/ClipboardHelper.cs.meta

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

0 comments on commit 51bee1a

Please sign in to comment.