From 3083224ee6235041a87d380c22b87a1fd53c87c2 Mon Sep 17 00:00:00 2001 From: CaiYanPeng Date: Fri, 19 Nov 2021 10:54:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=9B=BE=E7=89=87=E5=8E=8B?= =?UTF-8?q?=E7=BC=A9=EF=BC=9B=E8=AE=B0=E5=BD=95=E5=88=97=E8=A1=A8=E6=B8=85?= =?UTF-8?q?=E7=BC=93=E5=AD=98=EF=BC=9Bms=E5=BB=B6=E8=BF=9F3s=EF=BC=9B?= =?UTF-8?q?=E6=AF=94=E8=B5=9B=E5=88=97=E8=A1=A8=E6=A0=B7=E5=BC=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + .../Prefab/Panel/Mobile/RaceListPanel.prefab | 30 +++++++++---------- .../Scenes/Ride/Scripts/CyclingController.cs | 2 +- Assets/Scripts/UI/Control/PfUIButton.cs | 5 ++++ Assets/Scripts/UI/Prefab/MainNav.cs | 28 +++++++++++++++-- .../Prefab/ResultList/ResultListController.cs | 10 +++++++ .../Scripts/UI/Prefab/ResultList/RouteItem.cs | 5 ++-- ProjectSettings/ProjectSettings.asset | 6 ++-- 8 files changed, 63 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index b24a3955..4b3ae85e 100644 --- a/.gitignore +++ b/.gitignore @@ -92,3 +92,4 @@ Assets/Mapbox/User.meta Packages/packages-lock.json GPUCache Assets/Shatalmic/plugin.unitypackage.meta +.idea diff --git a/Assets/Resources/UI/Prefab/Panel/Mobile/RaceListPanel.prefab b/Assets/Resources/UI/Prefab/Panel/Mobile/RaceListPanel.prefab index b8c43dce..a54710fa 100644 --- a/Assets/Resources/UI/Prefab/Panel/Mobile/RaceListPanel.prefab +++ b/Assets/Resources/UI/Prefab/Panel/Mobile/RaceListPanel.prefab @@ -951,8 +951,8 @@ RectTransform: - {fileID: 6595848013761631944} - {fileID: 4408462524766711656} - {fileID: 7578623247347515893} - - {fileID: 9114115754477968003} - {fileID: 7118448401530350836} + - {fileID: 9114115754477968003} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -2046,7 +2046,7 @@ RectTransform: - {fileID: 1128690593457696285} - {fileID: 7052195156892582935} m_Father: {fileID: 1673965681348374004} - m_RootOrder: 5 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 0, y: 0.5} @@ -3652,18 +3652,18 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 07e45aecba1a2d542b043157aa2e9322, type: 3} ---- !u!1 &3712583330546725488 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1827088261433348456, guid: 07e45aecba1a2d542b043157aa2e9322, - type: 3} - m_PrefabInstance: {fileID: 3089084281570681624} - m_PrefabAsset: {fileID: 0} --- !u!224 &1786430169159750715 stripped RectTransform: m_CorrespondingSourceObject: {fileID: 3608523562535466787, guid: 07e45aecba1a2d542b043157aa2e9322, type: 3} m_PrefabInstance: {fileID: 3089084281570681624} m_PrefabAsset: {fileID: 0} +--- !u!1 &3712583330546725488 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 1827088261433348456, guid: 07e45aecba1a2d542b043157aa2e9322, + type: 3} + m_PrefabInstance: {fileID: 3089084281570681624} + m_PrefabAsset: {fileID: 0} --- !u!1001 &5067779267173090679 PrefabInstance: m_ObjectHideFlags: 0 @@ -3839,7 +3839,7 @@ PrefabInstance: - target: {fileID: 2638424933752433027, guid: a1999d0576fee6248a9c5a507ae8d10e, type: 3} propertyPath: m_RootOrder - value: 6 + value: 5 objectReference: {fileID: 0} - target: {fileID: 2638424933752433027, guid: a1999d0576fee6248a9c5a507ae8d10e, type: 3} @@ -4179,15 +4179,15 @@ PrefabInstance: m_RemovedComponents: - {fileID: 829206726517620079, guid: a1999d0576fee6248a9c5a507ae8d10e, type: 3} m_SourcePrefab: {fileID: 100100000, guid: a1999d0576fee6248a9c5a507ae8d10e, type: 3} ---- !u!224 &7118448401530350836 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 2638424933752433027, guid: a1999d0576fee6248a9c5a507ae8d10e, - type: 3} - m_PrefabInstance: {fileID: 5067779267173090679} - m_PrefabAsset: {fileID: 0} --- !u!1 &7118448401530350837 stripped GameObject: m_CorrespondingSourceObject: {fileID: 2638424933752433026, guid: a1999d0576fee6248a9c5a507ae8d10e, type: 3} m_PrefabInstance: {fileID: 5067779267173090679} m_PrefabAsset: {fileID: 0} +--- !u!224 &7118448401530350836 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 2638424933752433027, guid: a1999d0576fee6248a9c5a507ae8d10e, + type: 3} + m_PrefabInstance: {fileID: 5067779267173090679} + m_PrefabAsset: {fileID: 0} diff --git a/Assets/Scripts/Scenes/Ride/Scripts/CyclingController.cs b/Assets/Scripts/Scenes/Ride/Scripts/CyclingController.cs index 1261d472..6e1cb681 100644 --- a/Assets/Scripts/Scenes/Ride/Scripts/CyclingController.cs +++ b/Assets/Scripts/Scenes/Ride/Scripts/CyclingController.cs @@ -904,7 +904,7 @@ public class CyclingController : DeviceServiceMonoBase RenderTexture.active = null; // JC: added to avoid errors GameObject.Destroy(rt); // 最后将这些纹理数据,成一个图片文件 - byte[] bytes = screenShot.EncodeToPNG(); + byte[] bytes = screenShot.EncodeToJPG(); //var path = Helper.GetDataDir("MapWorkoutRecords/images"); //string filename = path + "/" + Guid.NewGuid().ToString() + ".png"; diff --git a/Assets/Scripts/UI/Control/PfUIButton.cs b/Assets/Scripts/UI/Control/PfUIButton.cs index 2612928b..2b65b13d 100644 --- a/Assets/Scripts/UI/Control/PfUIButton.cs +++ b/Assets/Scripts/UI/Control/PfUIButton.cs @@ -148,8 +148,13 @@ namespace Assets.Scripts.UI.Control UIManager.AddEvent(this.gameObject, EventTriggerType.PointerExit, new UnityAction(e => { if (!this.isActiveAndEnabled) return; +#if !(UNITY_ANDROID || UNITY_IOS) if (!string.IsNullOrWhiteSpace(Tooltips)) { +#else + if (!string.IsNullOrWhiteSpace(Tooltips) && showTooltip) + { +#endif tooltips.SetActive(false); } //Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto); diff --git a/Assets/Scripts/UI/Prefab/MainNav.cs b/Assets/Scripts/UI/Prefab/MainNav.cs index 546b62f2..70d8a1b4 100644 --- a/Assets/Scripts/UI/Prefab/MainNav.cs +++ b/Assets/Scripts/UI/Prefab/MainNav.cs @@ -1,4 +1,5 @@ using Assets.Scripts.UI.Control; +using DG.Tweening; using System; using System.Collections; using System.Collections.Generic; @@ -10,6 +11,7 @@ public class MainNav : MonoBehaviour { private GameObject exit; private GameObject home; + float delayTime = 0; private void Awake() { //var material = Instantiate(Resources.Load("UI/Material/RoundedCornersTextureMaterial")); @@ -33,8 +35,15 @@ public class MainNav : MonoBehaviour exit = this.transform.Find("Exit").gameObject; exit.SetActive(false); - - transform.Find("Delay").GetComponent().showTooltip = true; +#if UNITY_ANDROID || UNITY_IOS + UIManager.AddEvent(transform.Find("Delay").gameObject, EventTriggerType.PointerClick, b => + { + delayTime = 3; + transform.Find("Delay/Tooltips").gameObject.SetActive(true); + transform.Find("Delay/Tooltips").GetComponent().DOFade(1, 0.5f); + }); +#endif + //transform.Find("Delay").GetComponent().showTooltip = true; UIManager.AddEvent(exit, EventTriggerType.PointerClick, (e) => { UIManager.ShowConfirm("Quit", "Do you want to quit PowerFun?", ()=> { @@ -77,7 +86,20 @@ public class MainNav : MonoBehaviour // Update is called once per frame void Update() { - + if (delayTime < 0) + { + Debug.Log("小时"); + delayTime = 0; + transform.Find("Delay/Tooltips").GetComponent().DOFade(0, 0.5f).onComplete = ()=> + { + transform.Find("Delay/Tooltips").gameObject.SetActive(false); + }; + } + else if(delayTime > 0) + { + Debug.Log(delayTime); + delayTime -= Time.deltaTime; + } } public void ShowExit() diff --git a/Assets/Scripts/UI/Prefab/ResultList/ResultListController.cs b/Assets/Scripts/UI/Prefab/ResultList/ResultListController.cs index 19b885d4..46f54fa2 100644 --- a/Assets/Scripts/UI/Prefab/ResultList/ResultListController.cs +++ b/Assets/Scripts/UI/Prefab/ResultList/ResultListController.cs @@ -37,6 +37,7 @@ public class ResultListController : PFUIPanel { //ApiBase.SetCookie("73385F5F719B610D132C1ECF3E9143272BF15214D57ED91CD7A9DFD832407471535112AAEB8E9271F75D54FBBF2D99F18FA313C1EEA5676F5D722D7FBB07C926BEC5905591BF9AFDDC6336552DF273112C2DA1794E6FA2F465B11FECD2E82E52"); localRouteItem = Resources.Load("UI/Prefab/ResultList/LocalRouteItem"); + caches = new Dictionary(); #if UNITY_ANDROID || UNITY_IOS routeResult = Resources.Load("UI/Prefab/ResultList/RouteItem-Mobile"); localRouteItem = Resources.Load("UI/Prefab/ResultList/LocalRouteItem-Mobile"); @@ -231,6 +232,8 @@ public class ResultListController : PFUIPanel Utils.showToast(gameObject, r.errMsg); } } + [HideInInspector] + public Dictionary caches = null; void DisplayRouteResult(List list,Transform content,int index) { if (routeResult != null) @@ -353,4 +356,11 @@ public class ResultListController : PFUIPanel //} } + protected override void OnDestroy() + { + caches = null; + Resources.UnloadUnusedAssets(); + GC.Collect(); + Debug.Log("list empty"); + } } diff --git a/Assets/Scripts/UI/Prefab/ResultList/RouteItem.cs b/Assets/Scripts/UI/Prefab/ResultList/RouteItem.cs index 5a570bb2..9ad0054e 100644 --- a/Assets/Scripts/UI/Prefab/ResultList/RouteItem.cs +++ b/Assets/Scripts/UI/Prefab/ResultList/RouteItem.cs @@ -130,8 +130,9 @@ public class RouteItem : MonoBehaviour public void Initial(RouteResult result,int index,Transform parent = null) { routeResult = result; - - Utils.DisplayImage(transform.Find("BigLeft/CoverImage").GetComponent(), result.RouteImage, true); + Utils.DisplayImageTempDict(transform.Find("BigLeft/CoverImage").GetComponent(), result.RouteImage, + parent.GetComponent().caches); + //Utils.DisplayImage(transform.Find("BigLeft/CoverImage").GetComponent(), result.RouteImage, true); left.Find("Main").Find("Name").GetComponent().text = result.RouteName; left.Find("Main").Find("Time").GetComponent().text = result.CreateTime.ToString("HH:mm:ss dd-MM-yyyy"); diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index f8446e9e..58b8c691 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -179,7 +179,7 @@ PlayerSettings: applicationIdentifier: Android: com.ZhiXingPai.PowerFunUnity buildNumber: - iPhone: 2.0.6.2 + iPhone: 2.0.7.0 AndroidBundleVersionCode: 9 AndroidMinSdkVersion: 24 AndroidTargetSdkVersion: 30 @@ -256,7 +256,7 @@ PlayerSettings: clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea templatePackageId: com.unity.template.3d@4.2.8 templateDefaultScene: Assets/Scenes/SampleScene.unity - AndroidTargetArchitectures: 1 + AndroidTargetArchitectures: 3 AndroidSplashScreenScale: 0 androidSplashScreen: {fileID: 0} AndroidKeystoreName: '{inproject}: Assets/Plugins/Android/powerfun.keystore' @@ -868,7 +868,7 @@ PlayerSettings: platformArchitecture: iPhone: 1 scriptingBackend: - Android: 0 + Android: 1 Standalone: 0 il2cppCompilerConfiguration: Standalone: 0