Assets/Prefabs/UI/Final/FinalPanelItemNew.prefab | ●●●●● patch | view | raw | blame | history | |
Assets/Resources/UI/Final/FinalPanel.prefab | ●●●●● patch | view | raw | blame | history | |
Assets/Scripts/Guide/TestButton.cs | ●●●●● patch | view | raw | blame | history | |
Assets/Scripts/TowerDefense/UI/EndlessSettlement.cs | ●●●●● patch | view | raw | blame | history | |
Assets/Scripts/UI/FinalPanel/FinalHttp.cs | ●●●●● patch | view | raw | blame | history | |
Assets/Scripts/UI/FinalPanel/FinalPanel.cs | ●●●●● patch | view | raw | blame | history | |
Assets/Scripts/UI/FinalPanel/FinalPanelItem.cs | ●●●●● patch | view | raw | blame | history | |
Assets/Tools/EnhancedScroller v2/Plugins/EnhancedScroller.cs | ●●●●● patch | view | raw | blame | history |
Assets/Prefabs/UI/Final/FinalPanelItemNew.prefab
@@ -431,6 +431,7 @@ otherBackGround: {fileID: 21300000, guid: 9df73fc2707065445a2444a4356d59a3, type: 3} tmpColor: {r: 0.22745098, g: 0.64705884, b: 0.9019608, a: 1} otherColor: {r: 1, g: 1, b: 1, a: 1} rankUpbj: {fileID: 0} --- !u!1 &9124014055846406572 GameObject: m_ObjectHideFlags: 0 Assets/Resources/UI/Final/FinalPanel.prefab
@@ -65,7 +65,7 @@ m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 516299250} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: -0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 332274925} @@ -74,8 +74,8 @@ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 1} m_AnchorMax: {x: 0.5, y: 1} m_AnchoredPosition: {x: -1.5, y: -1151} m_SizeDelta: {x: 796, y: 338.06946} m_AnchoredPosition: {x: 0, y: -1199} m_SizeDelta: {x: 796, y: 435} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &516299256 CanvasRenderer: @@ -102,7 +102,7 @@ padding: m_Left: 0 m_Right: 0 m_Top: 30 m_Top: 15 m_Bottom: 10 loop: 0 scrollbarVisibility: 0 @@ -329,6 +329,142 @@ m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!1 &893718499162205457 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 893718499162205458} - component: {fileID: 893718499162205452} - component: {fileID: 893718499162205459} m_Layer: 5 m_Name: RankUp m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!224 &893718499162205458 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 893718499162205457} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 7891939465911265848} m_Father: {fileID: 7909169244235860091} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 0, y: 0.5} m_AnchoredPosition: {x: -47.77, y: 0} m_SizeDelta: {x: 85.05, y: 37.87} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &893718499162205452 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 893718499162205457} m_CullTransparentMesh: 0 --- !u!114 &893718499162205459 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 893718499162205457} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] m_text: 3000 m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 572adb1c73f88e441a1bf998ca9f4ea5, type: 2} m_sharedMaterial: {fileID: -3548855653558765056, guid: 572adb1c73f88e441a1bf998ca9f4ea5, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] m_fontColor32: serializedVersion: 2 rgba: 4294967295 m_fontColor: {r: 1, g: 1, b: 1, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: topLeft: {r: 1, g: 1, b: 1, a: 1} topRight: {r: 1, g: 1, b: 1, a: 1} bottomLeft: {r: 1, g: 1, b: 1, a: 1} bottomRight: {r: 1, g: 1, b: 1, a: 1} m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 m_StyleSheet: {fileID: 0} m_TextStyleHashCode: -1183493901 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 m_fontSize: 28 m_fontSizeBase: 28 m_fontWeight: 400 m_enableAutoSizing: 0 m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 3 m_HorizontalAlignment: 2 m_VerticalAlignment: 512 m_textAlignment: 65535 m_characterSpacing: -10.9 m_wordSpacing: 0 m_lineSpacing: 0 m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 m_isRichText: 1 m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0.6976433, w: 0.30635062} m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 m_hasFontAssetChanged: 0 @@ -922,6 +1058,7 @@ - {fileID: 315842912913623777} - {fileID: 1320872773829918336} - {fileID: 4927369617353463650} - {fileID: 216845836563390721} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -2993,6 +3130,81 @@ m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 --- !u!1 &5847193188200068307 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 7891939465911265848} - component: {fileID: 8962244064285520653} - component: {fileID: 5852525208847433630} m_Layer: 5 m_Name: Image m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!224 &7891939465911265848 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5847193188200068307} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 893718499162205458} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 0, y: 0.5} m_AnchoredPosition: {x: -20.5, y: 0} m_SizeDelta: {x: 41, y: 36} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &8962244064285520653 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5847193188200068307} m_CullTransparentMesh: 0 --- !u!114 &5852525208847433630 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5847193188200068307} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] m_Sprite: {fileID: 21300000, guid: 80e0fd86f1033be4e9326430f4573d85, type: 3} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 --- !u!1 &5922831300634792229 GameObject: m_ObjectHideFlags: 0 @@ -4508,12 +4720,13 @@ - {fileID: 1906524803679589849} - {fileID: 7549551234397364973} - {fileID: 3950903702536346173} - {fileID: 893718499162205458} m_Father: {fileID: 5825945650563712391} m_RootOrder: 12 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0} m_AnchorMax: {x: 0.5, y: 0} m_AnchoredPosition: {x: 3.5, y: 524} m_AnchorMin: {x: 0.5, y: 1} m_AnchorMax: {x: 0.5, y: 1} m_AnchoredPosition: {x: 3.5, y: -1480} m_SizeDelta: {x: 822, y: 93} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &139394436063301678 @@ -4684,3 +4897,133 @@ type: 3} m_PrefabInstance: {fileID: 1625455559549752584} m_PrefabAsset: {fileID: 0} --- !u!1001 &6153872151219136874 PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: m_TransformParent: {fileID: 5825945650563712391} m_Modifications: - target: {fileID: 1347244762514560074, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} propertyPath: m_Layer value: 5 objectReference: {fileID: 0} - target: {fileID: 1368931772909306750, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} propertyPath: m_Layer value: 5 objectReference: {fileID: 0} - target: {fileID: 1738408556510604893, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} propertyPath: m_Layer value: 5 objectReference: {fileID: 0} - target: {fileID: 3647412479058007782, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} propertyPath: m_Layer value: 5 objectReference: {fileID: 0} - target: {fileID: 6116729124393499060, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} propertyPath: m_Layer value: 5 objectReference: {fileID: 0} - target: {fileID: 6225265779541526635, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} propertyPath: m_LocalPosition.x value: 0 objectReference: {fileID: 0} - target: {fileID: 6225265779541526635, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} propertyPath: m_LocalPosition.y value: 667 objectReference: {fileID: 0} - target: {fileID: 6225265779541526635, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - target: {fileID: 6225265779541526635, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - target: {fileID: 6225265779541526635, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} propertyPath: m_LocalRotation.y value: 0 objectReference: {fileID: 0} - target: {fileID: 6225265779541526635, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - target: {fileID: 6225265779541526635, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - target: {fileID: 6225265779541526635, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} propertyPath: m_RootOrder value: 17 objectReference: {fileID: 0} - target: {fileID: 6225265779541526635, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} propertyPath: m_LocalEulerAnglesHint.x value: 0 objectReference: {fileID: 0} - target: {fileID: 6225265779541526635, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - target: {fileID: 6225265779541526635, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - target: {fileID: 6225265779541526635, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} propertyPath: m_LocalScale.x value: 10 objectReference: {fileID: 0} - target: {fileID: 6225265779541526635, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} propertyPath: m_LocalScale.y value: 10 objectReference: {fileID: 0} - target: {fileID: 6225265779541526635, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} propertyPath: m_LocalScale.z value: 10 objectReference: {fileID: 0} - target: {fileID: 7173591909925423277, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} propertyPath: m_Layer value: 5 objectReference: {fileID: 0} - target: {fileID: 7374385483955633644, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} propertyPath: m_Name value: Effect_UI_JieSuanShengLi objectReference: {fileID: 0} - target: {fileID: 7374385483955633644, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} propertyPath: m_Layer value: 5 objectReference: {fileID: 0} - target: {fileID: 7386973775121742243, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} propertyPath: m_Layer value: 5 objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} --- !u!4 &216845836563390721 stripped Transform: m_CorrespondingSourceObject: {fileID: 6225265779541526635, guid: 475bea2daa2edd9489bdf4733073ff7d, type: 3} m_PrefabInstance: {fileID: 6153872151219136874} m_PrefabAsset: {fileID: 0} Assets/Scripts/Guide/TestButton.cs
@@ -49,6 +49,13 @@ SendGet(); } if (GUILayout.Button("清理本地存储", GUILayout.Width(150), GUILayout.Height(70))) { PlayerPrefs.DeleteAll(); Debug.Log("清理本地存储"); } GUILayout.EndArea(); } @@ -168,22 +175,11 @@ JsonData rank = getData["rank"]; List<HttpGetInfo> allHttpGetInfoLis = new List<HttpGetInfo>(); HttpGetInfo info; foreach (JsonData item in rank) { allHttpGetInfoLis.Add( new HttpGetInfo { id = int.Parse(item["id"].ToString()), username = item["username"].ToString(), nickname = item["nickname"].ToString(), score = int.Parse(item["score"].ToString()), level = int.Parse(item["level"].ToString()), extra = item["nickname"], waveInfo = item["extra"].ToString(), create_time = int.Parse(item["create_time"].ToString()), } ); info = new HttpGetInfo(item); allHttpGetInfoLis.Add(info); } foreach (HttpGetInfo item in allHttpGetInfoLis) @@ -218,10 +214,11 @@ void TestFinalPanel() { GameObject go = Instantiate(Resources.Load<GameObject>("UI/Final/FinalPanel"), transform); GameObject a = Resources.Load<GameObject>("UI/Final/FinalPanel"); GameObject go = Instantiate(a, transform); FinalPanel panelUI = go.GetComponent<FinalPanel>(); panelUI.SetData("25关 3波", 101); panelUI.SetPlayEffectAC(null); panelUI.SetData("1关 1波", 401); //panelUI.SetPlayEffectAC(null); } @@ -348,14 +345,4 @@ } public class HttpGetInfo { public int id; public string username; public string nickname; public int score; public int level; public JsonData extra; public string waveInfo; public int create_time; } Assets/Scripts/TowerDefense/UI/EndlessSettlement.cs
@@ -81,7 +81,7 @@ GameObject go = Instantiate(Resources.Load<GameObject>("UI/Final/FinalPanel"), GameObject.Find("UICamera/BottomCanvas").transform); FinalPanel panelUI = go.GetComponent<FinalPanel>(); panelUI.SetData($"{EndlessLevelManager.instance.CurrentLevel}关 {EndlessLevelManager.instance.WaveManager.CurrentWaveIndex}波", EndlessScoreData.CurrentSocre); panelUI.SetPlayEffectAC(PlayEffect); //panelUI.SetPlayEffectAC(PlayEffect); //GameObject.Find("UICamera/BottomCanvas").GetComponent<Canvas>().enabled = false; EndlessUIStart.instance.GameOver(); Assets/Scripts/UI/FinalPanel/FinalHttp.cs
@@ -7,9 +7,9 @@ public class FinalHttp : MonoBehaviour { Action<List<HttpGetInfo>, int> callBack; Action<List<HttpGetInfo>, int, HttpGetInfo> callBack; int _limit; public void Init(Action<List<HttpGetInfo>, int> ac, int limit) public void Init(Action<List<HttpGetInfo>, int, HttpGetInfo> ac, int limit) { isSending = false; callBack = ac; @@ -27,7 +27,9 @@ } else if (Application.platform == RuntimePlatform.WindowsEditor) { GameConfig.Imei = "MyTestGemBattle1233333"; //GameConfig.Imei = "MyTestGemBattle1233333"; GameConfig.Imei = "MyTestRank2"; } Debug.Log("设置imei0:" + GameConfig.Imei); } @@ -43,6 +45,7 @@ { LoadImei(); Debug.Log("开始Post" + nickname); string url = "http://9377-big-data.sbk-h5.com:8600/users/addrank"; Dictionary<string, object> keyValues = new Dictionary<string, object>(); keyValues.Add("username", GameConfig.Imei); @@ -59,7 +62,7 @@ else { Debug.LogError("连接错误"); callBack?.Invoke(null, 0); callBack?.Invoke(null, 0, null); } }, HttpHelper.DownloadHanlderType.kHttpTEXT); @@ -98,7 +101,7 @@ else { Debug.LogError("连接错误"); callBack?.Invoke(null, 0); callBack?.Invoke(null, 0, null); } }, HttpHelper.DownloadHanlderType.kHttpTEXT); @@ -110,32 +113,64 @@ int myrank = int.Parse(getData["myrank"].ToString()); Debug.Log("当前排名:" + myrank); JsonData mydata = getData["mydata"]; HttpGetInfo mydataHttpInfo = new HttpGetInfo(mydata); JsonData rank = getData["rank"]; List<HttpGetInfo> allHttpGetInfoLis = new List<HttpGetInfo>(); HttpGetInfo info; string tmpStr; //string tmpStr; foreach (JsonData item in rank) { info = new HttpGetInfo(); info.id = int.Parse(item["id"].ToString()); info.username = item["username"].ToString(); info.nickname = item["nickname"].ToString(); info.score = int.Parse(item["score"].ToString()); info.level = int.Parse(item["level"].ToString()); info = new HttpGetInfo(item); // info.id = int.Parse(item["id"].ToString()); // info.username = item["username"].ToString(); // info.nickname = item["nickname"].ToString(); // info.score = int.Parse(item["score"].ToString()); // info.level = int.Parse(item["level"].ToString()); tmpStr = item["extra"].ToString(); tmpStr = tmpStr.Remove(0, 1); tmpStr = tmpStr.Remove(tmpStr.Length - 1, 1); // tmpStr = item["extra"].ToString(); // tmpStr = tmpStr.Remove(0, 1); // tmpStr = tmpStr.Remove(tmpStr.Length - 1, 1); info.waveInfo = tmpStr; info.create_time = int.Parse(item["create_time"].ToString()); // info.waveInfo = tmpStr; // info.create_time = int.Parse(item["create_time"].ToString()); allHttpGetInfoLis.Add(info); } if (callBack != null) { callBack(allHttpGetInfoLis, myrank); callBack(allHttpGetInfoLis, myrank, mydataHttpInfo); } } } public class HttpGetInfo { public int id; public string username; public string nickname; public int score; public int level; public JsonData extra; public string waveInfo; public int create_time; public HttpGetInfo(JsonData data) { string tmpStr; id = int.Parse(data["id"].ToString()); username = data["username"].ToString(); nickname = data["nickname"].ToString(); score = int.Parse(data["score"].ToString()); level = int.Parse(data["level"].ToString()); tmpStr = data["extra"].ToString(); tmpStr = tmpStr.Remove(0, 1); tmpStr = tmpStr.Remove(tmpStr.Length - 1, 1); waveInfo = tmpStr; create_time = int.Parse(data["create_time"].ToString()); } } Assets/Scripts/UI/FinalPanel/FinalPanel.cs
@@ -38,26 +38,19 @@ Text scoreText; GameObject image_NewRecord; bool isNewH = false; int hScore; int hScore;//最高分 int tmpRank;//当前排名 int tmpRankUp;//排名上升了多少 //string hwaveInfo; CanvasGroup scrollerCanvasGroup; CanvasGroup itemCanvasGroup; Action playEffectAC = null; /// <summary> /// 设置播放胜利特效 /// </summary> /// <param name="ac"></param> public void SetPlayEffectAC(Action ac) { playEffectAC = ac; } ParticleSystem endPs;//最终特效 string playerPrefs_HScore = "GemBattleHScore"; //string playerPrefs_HWaveInfo = "GemBattleHWaveInfo"; string playerPrefs_HRank = "GemBattleHRank"; string playerPrefs_NickName = "GemBattlePlayerNickName"; @@ -73,6 +66,8 @@ FinalPanelItem itemThird;//第三 Text txt_Name, txt_Wave; TextMeshProUGUI txt_HScore, txt_Index; TextMeshProUGUI rankUpbj; /// <summary> /// 入口函数 /// </summary> @@ -86,6 +81,8 @@ Debug.Log($"_myScore:{_myScore} _waveInfo:{_waveInfo}"); hScore = PlayerPrefs.GetInt(playerPrefs_HScore); tmpRank = PlayerPrefs.GetInt(playerPrefs_HRank); tmpRankUp = 0; //hwaveInfo = PlayerPrefs.GetString(playerPrefs_HWaveInfo); scrollerCanvasGroup = transform.Find("Scroller").GetComponent<CanvasGroup>(); scrollerCanvasGroup.alpha = 0; @@ -117,14 +114,14 @@ scoreText.text = ""; waveText.text = ""; waveText.gameObject.SetActive(false); scoreText.gameObject.SetActive(false); //scoreText.gameObject.SetActive(false); image_NewRecord = transform.Find("Image_NewRecord").gameObject; image_NewRecord.SetActive(false); finalHttp = GetComponent<FinalHttp>(); _limit = 100; _limitUp = 100; _limit = 10; _limitUp = 10; finalHttp.Init(GetHttpData, _limit);//重置状态,设置回调和拉取的所有数据 itemFirst = transform.Find("ItemPanel/FinalPanelItemFirst").GetComponent<FinalPanelItem>(); @@ -135,6 +132,11 @@ countDownReplayBtn = transform.Find("HttpCountDownPanel/ReplayBtn").GetComponent<Button>(); countDownTxt = transform.Find("HttpCountDownPanel/WarningTxt").GetComponent<Text>(); httpCountDownPanel.SetActive(false); rankUpbj = transform.Find("Image_HScore/RankUp").GetComponent<TextMeshProUGUI>(); rankUpbj.gameObject.SetActive(false); endPs = transform.Find("Effect_UI_JieSuanShengLi/03").GetComponent<ParticleSystem>(); //PlayerPrefs.DeleteKey("GemBattlePlayerNickName"); @@ -161,7 +163,6 @@ private void StartHttp() { //OpenHttpCountDown(true); Debug.Log($"_myScore:{_myScore} _waveInfo:{_waveInfo}"); finalHttp.SendPost(playerNickName, _myScore, 1, _waveInfo); } @@ -220,29 +221,18 @@ SceneManager.LoadScene(loadingScene); } private void GetHttpData(List<HttpGetInfo> allHttpGetInfoLis, int myrank) private void GetHttpData(List<HttpGetInfo> allHttpGetInfoLis, int myrank, HttpGetInfo mydataHttpInfo) { scroller = transform.Find("Scroller").GetComponent<EnhancedScroller>(); scroller.Delegate = this; RefreshHttpData(allHttpGetInfoLis, myrank); RefreshHttpData(allHttpGetInfoLis, myrank, mydataHttpInfo); if (allHttpGetInfoLis == null) return; HttpGetInfo tmpData = allHttpGetInfoLis[myrank - 1]; txt_Name.text = tmpData.nickname; txt_HScore.text = tmpData.score.ToString(); txt_Wave.text = tmpData.waveInfo; if (myrank > 3000) { txt_Index.text = "3000+"; } else { txt_Index.text = myrank.ToString(); } txt_Name.text = mydataHttpInfo.nickname; txt_HScore.text = mydataHttpInfo.score.ToString(); txt_Wave.text = mydataHttpInfo.waveInfo; PlayDoTween(); } @@ -264,8 +254,6 @@ agentTweenSeq.Append(Image2.transform.DOScale(Vector3.one, 0.2f));//变化图片大小 agentTweenSeq.Join(Image2.DOFade(1, 0.2f)); agentTweenSeq.AppendCallback(StartLoadLargeData); Image Image3 = transform.Find("Image3").GetComponent<Image>(); agentTweenSeq.Append(Image3.transform.DOScale(Vector3.one, 0.2f));//变化图片大小 agentTweenSeq.Join(Image3.DOFade(1, 0.2f)); @@ -274,6 +262,7 @@ var temp = Math.Floor(value); scoreText.text = temp + ""; }, 0, _myScore, 1.0f)); agentTweenSeq.AppendCallback(StartLoadLargeData); tsLight = transform.Find("ImageLight"); Image ImageLight = tsLight.GetComponent<Image>(); @@ -304,8 +293,6 @@ /// </summary> protected void StartLoadLargeData() { scoreText.gameObject.SetActive(true); StartCoroutine(PlayerItemDoTween()); } @@ -334,12 +321,27 @@ if (isNewH) { image_NewRecord.SetActive(true); if (tmpRankUp > 0) { Debug.Log("排名上升了:" + tmpRankUp); if (!rankUpbj.gameObject.activeSelf) { rankUpbj.gameObject.SetActive(true); DOTween.To(delegate (float value) { var temp = Math.Floor(value); rankUpbj.text = temp + ""; }, 0, tmpRankUp, 0.5f); } } else { Debug.Log("排名下降了"); } } if (playEffectAC != null) { playEffectAC(); } endPs?.Play(); closeBtn.interactable = true; } @@ -391,16 +393,16 @@ { FinalPanelItem cellView = scroller.GetCellView(cellViewPrefab) as FinalPanelItem; cellView.SetData(_data[dataIndex]); //cellView.CheckRank(tmpRankUp); if (dataIndex == _data.Count - 2) { Debug.Log("是否可以刷新新列表了"); Debug.Log($"是否可以刷新新列表了 _limit:{_limit} _data.Count:{_data.Count}"); if (_limit >= 3000) { Debug.Log("数据下载量最大3000"); } else if (_limit >= _data.Count) else if (_limit > _data.Count + 3)//从第三名开始无限滚动 { Debug.Log("当前服务器没有那么多数据"); } @@ -415,7 +417,7 @@ return cellView; } private void RefreshHttpData(List<HttpGetInfo> allHttpGetInfoLis, int myrank) private void RefreshHttpData(List<HttpGetInfo> allHttpGetInfoLis, int myrank, HttpGetInfo mydataHttpInfo) { if (allHttpGetInfoLis == null) { @@ -434,6 +436,28 @@ if (allHttpGetInfoLis.Count > 0) { //排名发生了变化 if (tmpRank != myrank) { tmpRankUp = tmpRank - myrank; tmpRank = myrank; PlayerPrefs.SetInt(playerPrefs_HRank, tmpRank); } else { } if (myrank > 3000) { txt_Index.text = "3000+"; } else { txt_Index.text = myrank.ToString(); } if (allHttpGetInfoLis.Count >= 1) { data = new FinalPanelItemData(); @@ -441,6 +465,7 @@ data.index = 1; itemFirst.gameObject.SetActive(true); itemFirst.SetData(data); //itemFirst.CheckRank(tmpRankUp); } else { @@ -456,6 +481,7 @@ data.index = 2; itemSecond.gameObject.SetActive(true); itemSecond.SetData(data); //itemFirst.CheckRank(tmpRankUp); } else { @@ -470,6 +496,7 @@ data.index = 3; itemThird.gameObject.SetActive(true); itemThird.SetData(data); //itemFirst.CheckRank(tmpRankUp); } else { @@ -478,6 +505,7 @@ } if (allHttpGetInfoLis.Count > 3) { _data.Clear(); for (int i = 3; i < allHttpGetInfoLis.Count; i++) { data = new FinalPanelItemData(); @@ -487,10 +515,13 @@ } scroller.ReloadData(); } } } #endregion } Assets/Scripts/UI/FinalPanel/FinalPanelItem.cs
@@ -23,6 +23,10 @@ private RectTransform rt; //public TextMeshProUGUI rankUpbj; //bool isSelfPlayer; /// <summary> /// Start is called on the frame when a script is enabled just before /// any of the Update methods is called the first time. @@ -47,6 +51,7 @@ if (data.httpInfo.username.Equals(GameConfig.Imei)) { //isSelfPlayer = true; //是自己 if (backGround.sprite != tmpBackGround) backGround.sprite = tmpBackGround; @@ -59,6 +64,8 @@ } else { //isSelfPlayer = false; if (backGround.sprite != otherBackGround) backGround.sprite = otherBackGround; if (playerNameTxt.color != otherColor) @@ -77,6 +84,27 @@ } } // /// <summary> // /// 检查排名上升 // /// </summary> // /// <param name="rankUp"></param> // public void CheckRank(int rankUp) // { // if (rankUp > 0) // { // Debug.Log($"排名上升:{rankUp} isSelfPlayer:{isSelfPlayer} rankUpbj.gameObject.activeSelf:{rankUpbj.gameObject.activeSelf}"); // if (isSelfPlayer && !rankUpbj.gameObject.activeSelf) // { // rankUpbj.gameObject.SetActive(true); // rankUpbj.text = rankUp.ToString(); // } // } // else if (rankUpbj.gameObject.activeSelf) // { // rankUpbj.gameObject.SetActive(false); // } // } public void SetPos() { backGround.rectTransform.anchoredPosition = new UnityEngine.Vector2(720, 0); Assets/Tools/EnhancedScroller v2/Plugins/EnhancedScroller.cs
@@ -1412,6 +1412,9 @@ go.AddComponent<HorizontalLayoutGroup>(); _container = go.GetComponent<RectTransform>(); _container.localEulerAngles = Vector3.zero; Vector3 pos3D = _container.anchoredPosition3D; pos3D.z = 0; _container.anchoredPosition3D = pos3D; // set the containers anchor and pivot if (scrollDirection == ScrollDirectionEnum.Vertical)