-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Asset Store Validator Warnings Fixed (#109)
* missing namespaces added, Issue Report Form menu item path changed * Update CHANGELOG.md #109 * Issue Report Form menu item path changed, update CHANGELOG.md #109
- Loading branch information
Showing
34 changed files
with
1,966 additions
and
1,864 deletions.
There are no files selected for viewing
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
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
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
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
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 |
---|---|---|
@@ -1,44 +1,46 @@ | ||
using System.Collections; | ||
using Unity.VisualScripting; | ||
using UnityEngine; | ||
using UnityEngine.EventSystems; | ||
using CoroutineRunner = TezosSDK.Helpers.CoroutineRunner; | ||
|
||
public class CopyToClipboard : MonoBehaviour, IPointerClickHandler | ||
namespace TezosSDK.Samples.DemoExample | ||
{ | ||
[SerializeField] TMPro.TextMeshProUGUI text; | ||
[SerializeField] TMPro.TMP_InputField inputField; | ||
public class CopyToClipboard : MonoBehaviour, IPointerClickHandler | ||
{ | ||
[SerializeField] TMPro.TextMeshProUGUI text; | ||
[SerializeField] TMPro.TMP_InputField inputField; | ||
|
||
bool _blockCopy = false; | ||
bool _blockCopy = false; | ||
|
||
private void Start() | ||
{ | ||
inputField.gameObject.SetActive(false); | ||
} | ||
private void Start() | ||
{ | ||
inputField.gameObject.SetActive(false); | ||
} | ||
|
||
public void OnPointerClick(PointerEventData eventData) | ||
{ | ||
if (_blockCopy) | ||
return; | ||
|
||
public void OnPointerClick(PointerEventData eventData) | ||
{ | ||
if (_blockCopy) | ||
return; | ||
|
||
#if UNITY_WEBGL | ||
inputField.gameObject.SetActive(true); | ||
inputField.text = text.text; | ||
text.gameObject.SetActive(false); | ||
#endif | ||
|
||
// copy text to the clipboard | ||
GUIUtility.systemCopyBuffer = text.text; | ||
CoroutineRunner.Instance.StartWrappedCoroutine(OnTextCopied()); | ||
} | ||
|
||
IEnumerator OnTextCopied() | ||
{ | ||
_blockCopy = true; | ||
string origin = text.text; | ||
text.text = "Copied to clipboard."; | ||
yield return new WaitForSeconds(1.5f); | ||
text.text = origin; | ||
_blockCopy = false; | ||
// copy text to the clipboard | ||
GUIUtility.systemCopyBuffer = text.text; | ||
CoroutineRunner.Instance.StartWrappedCoroutine(OnTextCopied()); | ||
} | ||
|
||
IEnumerator OnTextCopied() | ||
{ | ||
_blockCopy = true; | ||
string origin = text.text; | ||
text.text = "Copied to clipboard."; | ||
yield return new WaitForSeconds(1.5f); | ||
text.text = origin; | ||
_blockCopy = false; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.