Skip to content

Commit 57702cd

Browse files
committed
perf: update unity version
1 parent bf82558 commit 57702cd

12 files changed

Lines changed: 374 additions & 193 deletions

File tree

poolakeyunitysdk-unity/Assets/Bazaar/Poolakey/Demo/Scenes/TestScene.unity

Lines changed: 178 additions & 48 deletions
Large diffs are not rendered by default.

poolakeyunitysdk-unity/Assets/Bazaar/Poolakey/Demo/Scripts/IapManager.cs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ public class IapManager : MonoBehaviour
1414

1515
private Payment _payment;
1616

17-
private Func<string,Task> _onPurchaseSuccess=null;
18-
private Action _onPurchaseFailure=null;
17+
private Func<string, Task> _onPurchaseSuccess = null;
18+
private Action _onPurchaseFailure = null;
19+
1920
private void Awake()
2021
{
2122
var securityCheck = SecurityCheck.Enable(Data.RsaKey);
@@ -38,10 +39,11 @@ private void OnPaymentConnectSuccess(Result<bool> result)
3839
Debug.Log($"Payment connected: {result.ToString()}");
3940
}
4041

41-
public async Task Purchase(string productId,Action<bool> onComplete)
42+
public async Task Purchase(string productId, Action<bool> onComplete)
4243
{
4344
Debug.Log($"Purchasing product: {productId}");
4445
var result = await _payment.Purchase(productId);
46+
Debug.Log($"purchase result: {result.message}, status: {result.status},{result.data.purchaseState}");
4547
if (result.status == Status.Success)
4648
{
4749
Debug.Log(result.data.ToString());
@@ -50,24 +52,26 @@ public async Task Purchase(string productId,Action<bool> onComplete)
5052
onComplete.Invoke(true);
5153
return;
5254
}
55+
5356
onComplete?.Invoke(false);
5457
}
5558

56-
public async Task PurchaseWithCallBack(string productId,Func<string,Task> onSuccess=null,Action onFailure=null)
59+
public async Task PurchaseWithCallBack(string productId, Func<string, Task> onSuccess = null,
60+
Action onFailure = null)
5761
{
5862
Debug.Log($"Purchasing product: {productId}");
5963
_onPurchaseFailure = onFailure;
6064
_onPurchaseSuccess = onSuccess;
61-
await _payment.Purchase(productId,onComplete:OnComplete);
62-
65+
var result = await _payment.Purchase(productId, onComplete: OnComplete);
66+
Debug.Log($"purchase result: {result.message}, status: {result.status},{result.data.purchaseState}");
6367
}
6468

6569
private void OnComplete(Result<PurchaseInfo> result)
6670
{
6771
if (result.status != Status.Success)
6872
{
6973
_onPurchaseFailure?.Invoke();
70-
_onPurchaseFailure=null;
74+
_onPurchaseFailure = null;
7175
_onPurchaseSuccess = null;
7276
return;
7377
}
@@ -76,7 +80,7 @@ private void OnComplete(Result<PurchaseInfo> result)
7680
var token = result.data.purchaseToken;
7781
PlayerPrefs.SetString(result.data.productId, token);
7882
_onPurchaseSuccess?.Invoke(result.data.productId);
79-
_onPurchaseFailure=null;
83+
_onPurchaseFailure = null;
8084
_onPurchaseSuccess = null;
8185
}
8286

@@ -94,7 +98,7 @@ public async Task GetPurchases()
9498
});
9599
}
96100

97-
public async Task ConsumePurchase(string productId,Action<bool> onComplete=null)
101+
public async Task ConsumePurchase(string productId, Action<bool> onComplete = null)
98102
{
99103
Debug.Log($"consuming purchase: {productId}");
100104
if (PlayerPrefs.HasKey(productId))
@@ -108,6 +112,7 @@ public async Task ConsumePurchase(string productId,Action<bool> onComplete=null)
108112
onComplete?.Invoke(true);
109113
return;
110114
}
115+
111116
onComplete?.Invoke(false);
112117
}
113118
}

poolakeyunitysdk-unity/Assets/Bazaar/Poolakey/Demo/Scripts/MessageBoxPanel.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
using RTLTMPro;
12
using TMPro;
23
using UnityEngine;
34

45
namespace PoolakeyDemo
56
{
67
public class MessageBoxPanel:MonoBehaviour
78
{
8-
[SerializeField] private TMP_Text _text_message;
9+
[SerializeField] private RTLTextMeshPro _text_message;
910

1011
public void Show(string message)
1112
{
13+
_text_message.Farsi = true;
1214
_text_message.text = message;
1315
gameObject.SetActive(true);
1416
}

poolakeyunitysdk-unity/Assets/Bazaar/Poolakey/Demo/Scripts/UIManager.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Threading.Tasks;
3+
using RTLTMPro;
34
using TMPro;
45
using UnityEngine;
56

@@ -12,8 +13,8 @@ public class UIManager : MonoBehaviour
1213
[SerializeField] private UiManagerData _uiManagerData;
1314
[SerializeField] MessageBoxPanel _messageBoxPanel;
1415
[SerializeField] ResourceManager _resourceManager;
15-
[SerializeField] private TMP_Text _text_starCount;
16-
[SerializeField] private TMP_Text _text_remainingJellyTime;
16+
[SerializeField] private RTLTextMeshPro _text_starCount;
17+
[SerializeField] private RTLTextMeshPro _text_remainingJellyTime;
1718
private bool _isPurchasing = false;
1819
private bool _isConsuming = false;
1920
private bool _isGettingPurchaseData = false;
@@ -83,6 +84,11 @@ private async Task Purchase(int itemIndex)
8384

8485
private void OnSubscriptionPurchaseComplete(bool isSucceeded)
8586
{
87+
#if UNITY_EDITOR
88+
_messageBoxPanel.Show(_uiManagerData.OnPurchaseSuccessMessage);
89+
_resourceManager.AddJellyEndTime(new TimeSpan(0,5,0));
90+
return;
91+
#endif
8692
if (isSucceeded)
8793
{
8894
_messageBoxPanel.Show(_uiManagerData.OnPurchaseSuccessMessage);
@@ -135,11 +141,13 @@ private void OnConsumeComplete(bool isSucceeded)
135141

136142
private void OnStarCountChane(int starCount)
137143
{
144+
_text_starCount.Farsi=true;
138145
_text_starCount.text = $"{starCount:N0}";
139146
}
140147

141148
private void OnJellyTimeUpdate(string jellyTime)
142149
{
150+
_text_remainingJellyTime.Farsi=true;
143151
_text_remainingJellyTime.text = jellyTime;
144152
}
145153
}

poolakeyunitysdk-unity/Assets/RTLTMPro/Scripts/Editor/RTLTextMeshProEditor.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
using UnityEditor;
33
using UnityEngine;
44

5-
#if TMP_VERSION_2_1_0_OR_NEWER
5+
66
using TMP_UiEditorPanel = TMPro.EditorUtilities.TMP_EditorPanelUI;
7-
#else
8-
using TMP_UiEditorPanel = TMPro.EditorUtilities.TMP_UiEditorPanel;
9-
#endif
7+
108

119
namespace RTLTMPro
1210
{
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!114 &1
4+
MonoBehaviour:
5+
m_ObjectHideFlags: 53
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
m_GameObject: {fileID: 0}
10+
m_Enabled: 1
11+
m_EditorHideFlags: 0
12+
m_Script: {fileID: 11500000, guid: 18cde282a8d045bf9d245fdcfaa7271b, type: 3}
13+
m_Name:
14+
m_EditorClassIdentifier:
15+
QuestionnaireVersion: 1.3
16+
UserAnswers:
17+
Answers:
18+
- QuestionId: Pace
19+
Answers:
20+
- Fast
21+
- QuestionId: Cheating
22+
Answers:
23+
- CheatingImportant
24+
- QuestionId: CostSensitivity
25+
Answers:
26+
- BestExperience
27+
- QuestionId: NetcodeArchitecture
28+
Answers:
29+
- ClientServer
30+
- QuestionId: PlayerCount
31+
Answers:
32+
- 4
33+
Preset: 2
34+
SelectedSolutions:
35+
SelectedHostingModel: 2
36+
SelectedNetcodeSolution: 1

poolakeyunitysdk-unity/Packages/manifest.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"dependencies": {
33
"com.unity.2d.sprite": "1.0.0",
4-
"com.unity.ai.navigation": "1.1.3",
5-
"com.unity.collab-proxy": "2.0.4",
6-
"com.unity.ide.rider": "3.0.21",
7-
"com.unity.ide.visualstudio": "2.0.18",
8-
"com.unity.ide.vscode": "1.2.5",
9-
"com.unity.test-framework": "1.1.33",
10-
"com.unity.textmeshpro": "3.0.6",
11-
"com.unity.timeline": "1.7.4",
12-
"com.unity.ugui": "1.0.0",
4+
"com.unity.ai.navigation": "2.0.5",
5+
"com.unity.collab-proxy": "2.5.2",
6+
"com.unity.ide.rider": "3.0.34",
7+
"com.unity.ide.visualstudio": "2.0.22",
8+
"com.unity.multiplayer.center": "1.0.0",
9+
"com.unity.test-framework": "1.4.5",
10+
"com.unity.timeline": "1.8.7",
11+
"com.unity.ugui": "2.0.0",
12+
"com.unity.modules.accessibility": "1.0.0",
1313
"com.unity.modules.ai": "1.0.0",
1414
"com.unity.modules.androidjni": "1.0.0",
1515
"com.unity.modules.animation": "1.0.0",

poolakeyunitysdk-unity/Packages/packages-lock.json

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"dependencies": {}
88
},
99
"com.unity.ai.navigation": {
10-
"version": "1.1.3",
10+
"version": "2.0.5",
1111
"depth": 0,
1212
"source": "registry",
1313
"dependencies": {
@@ -16,21 +16,21 @@
1616
"url": "https://packages.unity.com"
1717
},
1818
"com.unity.collab-proxy": {
19-
"version": "2.0.4",
19+
"version": "2.5.2",
2020
"depth": 0,
2121
"source": "registry",
2222
"dependencies": {},
2323
"url": "https://packages.unity.com"
2424
},
2525
"com.unity.ext.nunit": {
26-
"version": "1.0.6",
26+
"version": "2.0.5",
2727
"depth": 1,
2828
"source": "registry",
2929
"dependencies": {},
3030
"url": "https://packages.unity.com"
3131
},
3232
"com.unity.ide.rider": {
33-
"version": "3.0.21",
33+
"version": "3.0.34",
3434
"depth": 0,
3535
"source": "registry",
3636
"dependencies": {
@@ -39,43 +39,35 @@
3939
"url": "https://packages.unity.com"
4040
},
4141
"com.unity.ide.visualstudio": {
42-
"version": "2.0.18",
42+
"version": "2.0.22",
4343
"depth": 0,
4444
"source": "registry",
4545
"dependencies": {
4646
"com.unity.test-framework": "1.1.9"
4747
},
4848
"url": "https://packages.unity.com"
4949
},
50-
"com.unity.ide.vscode": {
51-
"version": "1.2.5",
50+
"com.unity.multiplayer.center": {
51+
"version": "1.0.0",
5252
"depth": 0,
53-
"source": "registry",
54-
"dependencies": {},
55-
"url": "https://packages.unity.com"
53+
"source": "builtin",
54+
"dependencies": {
55+
"com.unity.modules.uielements": "1.0.0"
56+
}
5657
},
5758
"com.unity.test-framework": {
58-
"version": "1.1.33",
59+
"version": "1.4.5",
5960
"depth": 0,
6061
"source": "registry",
6162
"dependencies": {
62-
"com.unity.ext.nunit": "1.0.6",
63+
"com.unity.ext.nunit": "2.0.3",
6364
"com.unity.modules.imgui": "1.0.0",
6465
"com.unity.modules.jsonserialize": "1.0.0"
6566
},
6667
"url": "https://packages.unity.com"
6768
},
68-
"com.unity.textmeshpro": {
69-
"version": "3.0.6",
70-
"depth": 0,
71-
"source": "registry",
72-
"dependencies": {
73-
"com.unity.ugui": "1.0.0"
74-
},
75-
"url": "https://packages.unity.com"
76-
},
7769
"com.unity.timeline": {
78-
"version": "1.7.4",
70+
"version": "1.8.7",
7971
"depth": 0,
8072
"source": "registry",
8173
"dependencies": {
@@ -87,14 +79,20 @@
8779
"url": "https://packages.unity.com"
8880
},
8981
"com.unity.ugui": {
90-
"version": "1.0.0",
82+
"version": "2.0.0",
9183
"depth": 0,
9284
"source": "builtin",
9385
"dependencies": {
9486
"com.unity.modules.ui": "1.0.0",
9587
"com.unity.modules.imgui": "1.0.0"
9688
}
9789
},
90+
"com.unity.modules.accessibility": {
91+
"version": "1.0.0",
92+
"depth": 0,
93+
"source": "builtin",
94+
"dependencies": {}
95+
},
9896
"com.unity.modules.ai": {
9997
"version": "1.0.0",
10098
"depth": 0,
@@ -142,6 +140,12 @@
142140
"com.unity.modules.animation": "1.0.0"
143141
}
144142
},
143+
"com.unity.modules.hierarchycore": {
144+
"version": "1.0.0",
145+
"depth": 1,
146+
"source": "builtin",
147+
"dependencies": {}
148+
},
145149
"com.unity.modules.imageconversion": {
146150
"version": "1.0.0",
147151
"depth": 0,
@@ -230,7 +234,8 @@
230234
"dependencies": {
231235
"com.unity.modules.ui": "1.0.0",
232236
"com.unity.modules.imgui": "1.0.0",
233-
"com.unity.modules.jsonserialize": "1.0.0"
237+
"com.unity.modules.jsonserialize": "1.0.0",
238+
"com.unity.modules.hierarchycore": "1.0.0"
234239
}
235240
},
236241
"com.unity.modules.umbra": {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!655991488 &1
4+
MultiplayerManager:
5+
m_ObjectHideFlags: 0
6+
m_EnableMultiplayerRoles: 0
7+
m_StrippingTypes: {}

0 commit comments

Comments
 (0)