Skip to content

Commit df37bbc

Browse files
author
Zhichao Link
committed
update for iOS
1 parent 1bad02e commit df37bbc

File tree

126 files changed

+7817
-14539
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+7817
-14539
lines changed

Assembly-CSharp-Editor.csproj

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,20 @@
4141
<ImplicitlyExpandDesignTimeFacades>false</ImplicitlyExpandDesignTimeFacades>
4242
</PropertyGroup>
4343
<ItemGroup>
44-
<Compile Include="Assets/Vuplex/WebView/Core/Editor/Scripts/CanvasPointerInputDetectorInspector.cs" />
45-
<Compile Include="Assets/Vuplex/WebView/Core/Editor/Scripts/ConditionalCompilationUtility.cs" />
4644
<Compile Include="Assets/Vuplex/WebView/Core/Editor/Scripts/OptionalDependencyAttribute.cs" />
47-
<Compile Include="Assets/Vuplex/WebView/Core/Editor/Scripts/ScriptingSymbols.cs" />
4845
<Compile Include="Assets/Vuplex/WebView/Standalone/Mac/Editor/MacBuildScript.cs" />
4946
<Compile Include="Assets/Vuplex/WebView/Standalone/Mac/Editor/MacEditorScript.cs" />
5047
<Compile Include="Assets/Vuplex/WebView/Core/Editor/Scripts/CanvasWebViewPrefabInspector.cs" />
51-
<Compile Include="Assets/Vuplex/WebView/Core/Editor/Scripts/DocumentationLinkDrawer.cs" />
52-
<Compile Include="Assets/Vuplex/WebView/Core/Editor/Scripts/WebViewPrefabInspector.cs" />
53-
<Compile Include="Assets/Vuplex/WebView/Standalone/Editor/StandaloneVideoCodecsWindow.cs" />
5448
<Compile Include="Assets/Vuplex/WebView/Core/Editor/Scripts/LabelDrawer.cs" />
5549
<Compile Include="Assets/Vuplex/WebView/Core/Editor/Scripts/AndroidEditorUtils.cs" />
5650
<Compile Include="Assets/Vuplex/WebView/Standalone/Windows/Editor/WindowsBuildScript.cs" />
5751
<Compile Include="Assets/Vuplex/WebView/Core/Editor/Scripts/DefaultPointerInputDetectorInspector.cs" />
52+
<Compile Include="Assets/Vuplex/WebView/Core/Editor/Scripts/CanvasPointerInputDetectorInspector.cs" />
53+
<Compile Include="Assets/Vuplex/WebView/Core/Editor/Scripts/ConditionalCompilationUtility.cs" />
54+
<Compile Include="Assets/Vuplex/WebView/Core/Editor/Scripts/ScriptingSymbols.cs" />
55+
<Compile Include="Assets/Vuplex/WebView/Core/Editor/Scripts/DocumentationLinkDrawer.cs" />
56+
<Compile Include="Assets/Vuplex/WebView/Core/Editor/Scripts/WebViewPrefabInspector.cs" />
57+
<Compile Include="Assets/Vuplex/WebView/Standalone/Editor/StandaloneVideoCodecsWindow.cs" />
5858
<Compile Include="Assets/Vuplex/WebView/Core/Editor/Scripts/BaseWebViewPrefabInspector.cs" />
5959
<Compile Include="Assets/Vuplex/WebView/Core/Editor/Scripts/EditorUtils.cs" />
6060
<Compile Include="Assets/Vuplex/WebView/Core/Plugins/Editor/OldWebViewDirectoryDeleter.cs" />
@@ -753,6 +753,10 @@
753753
<Project>{1e9d8133-b3c0-17bd-0e56-d1d2e01d3482}</Project>
754754
<Name>Unity.TextMeshPro</Name>
755755
</ProjectReference>
756+
<ProjectReference Include="Unity.2D.Sprite.Editor.csproj">
757+
<Project>{48541e89-8dce-b7cf-6c07-af8269495d1c}</Project>
758+
<Name>Unity.2D.Sprite.Editor</Name>
759+
</ProjectReference>
756760
<ProjectReference Include="UnityEditor.UI.csproj">
757761
<Project>{40bef3b2-29b8-ac71-3915-c13baaf77135}</Project>
758762
<Name>UnityEditor.UI</Name>

Assembly-CSharp-firstpass.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@
4343
<ItemGroup>
4444
<None Include="Assets/Plugins/Android/AndroidManifest.xml" />
4545
<Reference Include="UnityEngine">
46-
<HintPath>/Applications/Unity/Hub/Editor/2021.3.36f1/Unity.app/Contents/Managed/UnityEngine/UnityEngine.dll</HintPath>
46+
<HintPath>/Applications/Unity/Hub/Editor/2021.3.35f1/Unity.app/Contents/Managed/UnityEngine/UnityEngine.dll</HintPath>
4747
</Reference>
4848
<Reference Include="UnityEngine.CoreModule">
49-
<HintPath>/Applications/Unity/Hub/Editor/2021.3.36f1/Unity.app/Contents/Managed/UnityEngine/UnityEngine.CoreModule.dll</HintPath>
49+
<HintPath>/Applications/Unity/Hub/Editor/2021.3.35f1/Unity.app/Contents/Managed/UnityEngine/UnityEngine.CoreModule.dll</HintPath>
5050
</Reference>
5151
<Reference Include="UnityEditor">
52-
<HintPath>/Applications/Unity/Hub/Editor/2021.3.36f1/Unity.app/Contents/Managed/UnityEngine/UnityEditor.dll</HintPath>
52+
<HintPath>/Applications/Unity/Hub/Editor/2021.3.35f1/Unity.app/Contents/Managed/UnityEngine/UnityEditor.dll</HintPath>
5353
</Reference>
5454
</ItemGroup>
5555
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

Assembly-CSharp.csproj

Lines changed: 381 additions & 313 deletions
Large diffs are not rendered by default.

Assets/ParticleNetwork/Mobile/Demo/AuthCoreDemo.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void SelectLoginType()
4040
public void Init()
4141
{
4242
ParticleNetwork.Init(this._chainInfo);
43-
43+
4444
ParticleAuthCoreInteraction.Init();
4545
// control how to show set master password and payment password.
4646
ParticleNetwork.SetSecurityAccountConfig(new SecurityAccountConfig(0, 0));
@@ -50,11 +50,12 @@ public async void Connect()
5050
{
5151
try
5252
{
53-
List<SupportLoginType> allSupportLoginTypes = new List<SupportLoginType>(Enum.GetValues(typeof(SupportLoginType)) as SupportLoginType[]);
53+
List<SupportLoginType> allSupportLoginTypes =
54+
new List<SupportLoginType>(Enum.GetValues(typeof(SupportLoginType)) as SupportLoginType[]);
5455
var nativeResultData =
5556
await ParticleAuthCore.Instance.Connect(_loginType, null, allSupportLoginTypes,
5657
SocialLoginPrompt.SelectAccount,
57-
new LoginPageConfig("Particle Unity Example", "Welcome to login",
58+
new LoginPageConfig("Particle Unity Example", "Welcome to login",
5859
"https://connect.particle.network/icons/512.png"));
5960

6061
Debug.Log(nativeResultData.data);
@@ -75,7 +76,6 @@ await ParticleAuthCore.Instance.Connect(_loginType, null, allSupportLoginTypes,
7576
{
7677
Debug.LogError($"An error occurred: {e.Message}");
7778
}
78-
7979
}
8080

8181
public async void ConnectJWT()

Assets/ParticleNetwork/Mobile/Demo/Connect/ConnectV2Demo.cs renamed to Assets/ParticleNetwork/Mobile/Demo/Connect/ConnectDemo.cs

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515

1616
namespace Network.Particle.Scripts.Test
1717
{
18-
public class ConnectV2Demo : MonoBehaviour
18+
public class ConnectDemo : MonoBehaviour
1919
{
20-
private ChainInfo currChainInfo = ChainInfo.EthereumSepolia;
20+
21+
public static ChainInfo currChainInfo = ChainInfo.EthereumSepolia;
2122

2223
//Connect HomePage
2324
[SerializeField] private GameObject homePageGameObject;
@@ -29,8 +30,6 @@ public class ConnectV2Demo : MonoBehaviour
2930
[SerializeField] private GameObject emptyAccountsTip;
3031

3132

32-
33-
3433
//Connect With Wallet
3534
[SerializeField] private ConnectWithWallet connectWithWalletPage;
3635

@@ -39,7 +38,6 @@ public class ConnectV2Demo : MonoBehaviour
3938

4039
private void Awake()
4140
{
42-
Init();
4341
homePageGameObject.SetActive(true);
4442
connectWithWalletPage.gameObject.SetActive(false);
4543
connectedWalletOpratePage.gameObject.SetActive(false);
@@ -58,6 +56,7 @@ private void OnChainSelected(ChainInfo chainInfo)
5856
currChainInfo = chainInfo;
5957
ParticleNetwork.SetChainInfo(chainInfo);
6058
currChainInfoTextMeshProUGUI.text = currChainInfo.Fullname + " " + currChainInfo.Id;
59+
LoadConnectWalletAccount();
6160
}
6261

6362
private void OnWalletConnectCallback(bool refresh)
@@ -66,22 +65,6 @@ private void OnWalletConnectCallback(bool refresh)
6665
LoadConnectWalletAccount();
6766
}
6867

69-
private void Init()
70-
{
71-
var metadata = new DAppMetaData(TestConfig.walletConnectProjectId, "Particle Connect",
72-
"https://connect.particle.network/icons/512.png",
73-
"https://connect.particle.network",
74-
"Particle Connect Unity Demo");
75-
ParticleNetwork.Init(currChainInfo);
76-
ParticleConnectInteraction.Init(currChainInfo, metadata);
77-
// List<ChainInfo> chainInfos = new List<ChainInfo>
78-
// { ChainInfo.Ethereum, ChainInfo.EthereumSepolia, ChainInfo.EthereumSepolia };
79-
// ParticleConnectInteraction.SetWalletConnectV2SupportChainInfos(chainInfos.ToArray());
80-
81-
// control how to show set master password and payment password.
82-
// ParticleNetwork.SetSecurityAccountConfig(new SecurityAccountConfig(0, 0));
83-
}
84-
8568
private void LoadConnectWalletAccount()
8669
{
8770
ClearAllChildren(accountItemParent.transform);
@@ -90,12 +73,23 @@ private void LoadConnectWalletAccount()
9073
walletTypes.ForEach(walletType =>
9174
{
9275
var accounts = ParticleConnectInteraction.GetAccounts(walletType);
76+
77+
if (ParticleNetwork.GetChainInfo().IsEvmChain())
78+
{
79+
accounts = accounts.Where(item => item.publicAddress.StartsWith("0x")).ToList();
80+
}
81+
else
82+
{
83+
accounts = accounts.Where(item => !item.publicAddress.StartsWith("0x")).ToList();
84+
}
85+
9386
if (accounts.Count != 0)
9487
{
9588
var item = new AccountItem(walletType, accounts);
9689
allAccountItems.Add(item);
9790
}
9891
});
92+
9993
if (allAccountItems.Count == 0)
10094
{
10195
emptyAccountsTip.SetActive(true);

Assets/ParticleNetwork/Mobile/Demo/Connect/ConnectV2Demo.cs.meta renamed to Assets/ParticleNetwork/Mobile/Demo/Connect/ConnectDemo.cs.meta

File renamed without changes.

Assets/ParticleNetwork/Mobile/Demo/Connect/ConnectedWalletOprate.cs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ public void AuthCoreHasMasterPassword()
9393
public void AuthCoreHasPaymentPassword()
9494
{
9595
var result = ParticleAuthCoreInteraction.HasPaymentPassword();
96-
ShowToast($"has master password {result}");
97-
Debug.Log($"has master password {result}");
96+
ShowToast($"has payment password {result}");
97+
Debug.Log($"has payment password {result}");
9898
}
9999

100100
public async void AuthCoreOpenAccountAndSecurity()
@@ -209,6 +209,12 @@ public async void SignAndSendTransaction()
209209

210210
public async void SignTransaction()
211211
{
212+
if (ParticleNetwork.GetChainInfo().IsEvmChain())
213+
{
214+
Debug.Log("SignTransaction only support solana");
215+
return;
216+
}
217+
212218
try
213219
{
214220
// sign transaction doesn't support evm.
@@ -238,6 +244,12 @@ public async void SignTransaction()
238244

239245
public async void SignAllTransactions()
240246
{
247+
if (ParticleNetwork.GetChainInfo().IsEvmChain())
248+
{
249+
Debug.Log("SignAllTransactions only support solana");
250+
return;
251+
}
252+
241253
try
242254
{
243255
// sign all transactions doesn't support evm.
@@ -301,6 +313,12 @@ public async void SignMessage()
301313

302314
public async void SignTypedData()
303315
{
316+
if (!ParticleNetwork.GetChainInfo().IsEvmChain())
317+
{
318+
Debug.Log("SignTypedData only support evm");
319+
return;
320+
}
321+
304322
try
305323
{
306324
// sign typed data doesn't support solana

Assets/ParticleNetwork/Mobile/Demo/Connect/Items/ConnectedWalletAccountItem.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ public class ConnectedWalletAccountItem : MonoBehaviour
1111
[SerializeField] private TextMeshProUGUI walletName;
1212
[SerializeField] private TextMeshProUGUI publicAddress;
1313
[SerializeField] private Image walletIcon;
14-
[HideInInspector]
15-
public WalletType walletType;
16-
[HideInInspector]
17-
public Account account;
14+
[HideInInspector] public WalletType walletType;
15+
[HideInInspector] public Account account;
1816

1917
public void InitItem(WalletType walletType, Account account)
2018
{
@@ -25,7 +23,7 @@ public void InitItem(WalletType walletType, Account account)
2523
publicAddress.text = account.publicAddress;
2624
walletIcon.sprite = Resources.Load<Sprite>(walletType.ToString());
2725
}
28-
26+
2927
public void SetBtnDisconnectClickListner(UnityAction<WalletType, Account> action)
3028
{
3129
GetComponent<Button>().onClick.AddListener(() => { action(walletType, account); });

Assets/ParticleNetwork/Mobile/Demo/Connect/Items/SelectChainItem.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ public void InitItem(ChainInfo chainInfo)
1818
{
1919
text.text = chainInfo.Name + " " + chainInfo.Network + " " + chainInfo.Id.ToString();
2020
}
21-
2221
}

Assets/ParticleNetwork/Mobile/Demo/Connect/Items/SupportLoginTypeItem.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class SupportLoginTypeItem : MonoBehaviour
1111
[SerializeField] private Image image;
1212
[SerializeField] private Image unSelectedImage;
1313
private SupportLoginType supportLoginType;
14-
14+
1515
public void InitItem(SupportLoginType supportLoginType)
1616
{
1717
this.supportLoginType = supportLoginType;
@@ -36,6 +36,7 @@ public SupportLoginType GetSupportLoginType()
3636
{
3737
return supportLoginType;
3838
}
39+
3940
public bool GetSelected()
4041
{
4142
return isSelected;

0 commit comments

Comments
 (0)