Skip to content

Commit 252240b

Browse files
feat: integrate click-to-copy functionality across all sample scripts
1 parent f737eeb commit 252240b

File tree

19 files changed

+120
-0
lines changed

19 files changed

+120
-0
lines changed

sample/Assets/Scripts/Passport/ClearStorageAndCache/ClearStorageAndCacheScript.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
using UnityEngine;
22
using UnityEngine.UI;
3+
using UnityEngine.EventSystems;
34

45
namespace Immutable.Passport.Sample.PassportFeatures
56
{
67
public class ClearStorageAndCacheScript : MonoBehaviour
78
{
89
[SerializeField] private Text Output;
910

11+
void Start()
12+
{
13+
ClickToCopyHelper.EnableClickToCopy(Output);
14+
}
15+
1016
public void ClearStorageAndCache()
1117
{
1218
if (Passport.Instance == null)

sample/Assets/Scripts/Passport/GetUserInfo/GetUserInfoScript.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
using System.Collections.Generic;
22
using UnityEngine;
33
using UnityEngine.UI;
4+
using UnityEngine.EventSystems;
45
using Cysharp.Threading.Tasks;
56
using Immutable.Passport;
67

78
public class GetUserInfoScript : MonoBehaviour
89
{
910
[SerializeField] private Text Output;
1011

12+
void Start()
13+
{
14+
ClickToCopyHelper.EnableClickToCopy(Output);
15+
}
16+
1117
/// <summary>
1218
/// Retrieves the currently logged-in user's email.
1319
/// </summary>

sample/Assets/Scripts/Passport/ImxConnect/ImxConnectScript.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
using UnityEngine;
22
using UnityEngine.UI;
3+
using UnityEngine.EventSystems;
34
using Cysharp.Threading.Tasks;
45
using Immutable.Passport;
56

67
public class ImxConnectScript : MonoBehaviour
78
{
89
[SerializeField] private Text Output;
910

11+
void Start()
12+
{
13+
ClickToCopyHelper.EnableClickToCopy(Output);
14+
}
15+
1016
/// <summary>
1117
/// Initialises the user's wallet and sets up the Immutable X provider using saved credentials if the user is already logged in.
1218
/// </summary>

sample/Assets/Scripts/Passport/ImxGetAddress/ImxGetAddressScript.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using UnityEngine;
33
using UnityEngine.UI;
4+
using UnityEngine.EventSystems;
45
using Immutable.Passport;
56
using Immutable.Passport.Model;
67

@@ -13,6 +14,8 @@ public class ImxGetAddressScript : MonoBehaviour
1314

1415
void Start()
1516
{
17+
ClickToCopyHelper.EnableClickToCopy(Output);
18+
1619
if (Passport.Instance != null)
1720
{
1821
Passport = Passport.Instance;

sample/Assets/Scripts/Passport/ImxIsRegisteredOffchain/ImxIsRegisteredOffchainScript.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using UnityEngine;
22
using UnityEngine.UI;
3+
using UnityEngine.EventSystems;
34
using Cysharp.Threading.Tasks;
45

56
namespace Immutable.Passport.Sample.PassportFeatures
@@ -10,6 +11,14 @@ public class ImxIsRegisteredOffchainScript : MonoBehaviour
1011
public Button checkRegistrationButton;
1112
public Text output;
1213

14+
void Start()
15+
{
16+
if (output != null)
17+
{
18+
ClickToCopyHelper.EnableClickToCopy(output);
19+
}
20+
}
21+
1322
public void CheckIsRegisteredOffchain()
1423
{
1524
CheckIsRegisteredOffchainAsync();

sample/Assets/Scripts/Passport/ImxNftTransfer/ImxNftTransferScript.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using UnityEngine;
33
using UnityEngine.UI;
44
using UnityEngine.SceneManagement;
5+
using UnityEngine.EventSystems;
56
using Cysharp.Threading.Tasks;
67
using Immutable.Passport;
78
using Immutable.Passport.Model;
@@ -16,6 +17,11 @@ public class ImxNftTransferScript : MonoBehaviour
1617
[SerializeField] private InputField TokenAddressInput2;
1718
[SerializeField] private InputField ReceiverInput2;
1819

20+
void Start()
21+
{
22+
ClickToCopyHelper.EnableClickToCopy(Output);
23+
}
24+
1925
/// <summary>
2026
/// Transfers NFTs to the specified receivers based on the provided details.
2127
/// </summary>

sample/Assets/Scripts/Passport/ImxRegister/ImxRegisterScript.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using UnityEngine;
33
using UnityEngine.UI;
4+
using UnityEngine.EventSystems;
45
using Immutable.Passport;
56
using Immutable.Passport.Model;
67

@@ -13,6 +14,8 @@ public class ImxRegisterScript : MonoBehaviour
1314

1415
void Start()
1516
{
17+
ClickToCopyHelper.EnableClickToCopy(Output);
18+
1619
if (Passport.Instance != null)
1720
{
1821
Passport = Passport.Instance;

sample/Assets/Scripts/Passport/Login/LoginScript.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using UnityEngine;
33
using UnityEngine.UI;
44
using UnityEngine.SceneManagement;
5+
using UnityEngine.EventSystems;
56
using Immutable.Passport;
67
using Immutable.Passport.Model;
78

@@ -35,6 +36,9 @@ void Start()
3536
if (Auth0NativeLoginButton != null) Auth0NativeLoginButton.onClick.AddListener(LoginWithAuth0Native);
3637
if (AppleLoginButton != null) AppleLoginButton.onClick.AddListener(() => Login(new DirectLoginOptions(DirectLoginMethod.Apple)));
3738
if (FacebookLoginButton != null) FacebookLoginButton.onClick.AddListener(() => Login(new DirectLoginOptions(DirectLoginMethod.Facebook)));
39+
40+
// Set up click-to-copy functionality for Output text
41+
ClickToCopyHelper.EnableClickToCopy(Output);
3842
}
3943

4044
/// <summary>

sample/Assets/Scripts/Passport/Other/SetCallTimeout/SetCallTimeoutScript.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
using UnityEngine;
22
using UnityEngine.UI;
33
using UnityEngine.SceneManagement;
4+
using UnityEngine.EventSystems;
45
using Immutable.Passport;
56

67
public class SetCallTimeoutScript : MonoBehaviour
78
{
89
[SerializeField] private Text Output;
910
[SerializeField] private InputField TimeoutInput;
1011

12+
void Start()
13+
{
14+
ClickToCopyHelper.EnableClickToCopy(Output);
15+
}
16+
1117
public void SetTimeout()
1218
{
1319
if (Passport.Instance == null)

sample/Assets/Scripts/Passport/PassportInitialisation/PassportInitialisationScript.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using UnityEngine;
33
using UnityEngine.UI;
44
using UnityEngine.SceneManagement;
5+
using UnityEngine.EventSystems;
56
using Immutable.Passport;
67
using Immutable.Passport.Core.Logging;
78

@@ -14,6 +15,7 @@ public class PassportInitialisationScript : MonoBehaviour
1415

1516
void Start()
1617
{
18+
ClickToCopyHelper.EnableClickToCopy(Output);
1719
InitialisePassport();
1820
}
1921

0 commit comments

Comments
 (0)