diff --git a/TheStrongestSnail/Assets/Scenes/RacingPanel.unity b/TheStrongestSnail/Assets/Scenes/RacingPanel.unity index 97ac168..ffd590b 100644 --- a/TheStrongestSnail/Assets/Scenes/RacingPanel.unity +++ b/TheStrongestSnail/Assets/Scenes/RacingPanel.unity @@ -2353,7 +2353,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5372453729458756189, guid: f06fd4485b1c4c54ba7070bde9d2b5d3, type: 3} propertyPath: m_RootOrder - value: 5 + value: 6 objectReference: {fileID: 0} - target: {fileID: 5372453729458756189, guid: f06fd4485b1c4c54ba7070bde9d2b5d3, type: 3} propertyPath: m_AnchorMax.x @@ -3944,6 +3944,7 @@ RectTransform: m_LocalScale: {x: 0, y: 0, z: 0} m_ConstrainProportionsScale: 0 m_Children: + - {fileID: 1512401060} - {fileID: 1705891619} - {fileID: 394840204} - {fileID: 771005323} @@ -5338,7 +5339,7 @@ RectTransform: - {fileID: 178345081} - {fileID: 287674963} m_Father: {fileID: 1705891619} - m_RootOrder: 7 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -5644,7 +5645,7 @@ RectTransform: - {fileID: 1997348953} - {fileID: 540295172} m_Father: {fileID: 294094431} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -5988,6 +5989,8 @@ MonoBehaviour: is_NOneedReflash: 0 snailMoveNum: 0 racingPanel: {fileID: 394840207} + WinNum: 0 + gameSession: 0 --- !u!1 &402443204 GameObject: m_ObjectHideFlags: 0 @@ -9675,7 +9678,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 1574451517034624567, guid: 52525b7ee4a02b947be72267c965e811, type: 3} propertyPath: m_RootOrder - value: 3 + value: 4 objectReference: {fileID: 0} - target: {fileID: 1574451517034624567, guid: 52525b7ee4a02b947be72267c965e811, type: 3} propertyPath: m_AnchorMax.x @@ -10078,7 +10081,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 294094431} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -11861,7 +11864,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5372453729458756189, guid: f06fd4485b1c4c54ba7070bde9d2b5d3, type: 3} propertyPath: m_RootOrder - value: 4 + value: 5 objectReference: {fileID: 0} - target: {fileID: 5372453729458756189, guid: f06fd4485b1c4c54ba7070bde9d2b5d3, type: 3} propertyPath: m_AnchorMax.x @@ -18319,7 +18322,7 @@ RectTransform: - {fileID: 1643667392} - {fileID: 1277993770} m_Father: {fileID: 1705891619} - m_RootOrder: 4 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 1, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} @@ -20565,12 +20568,12 @@ RectTransform: - {fileID: 869027440} - {fileID: 1993090952} - {fileID: 30141600} - m_Father: {fileID: 1705891619} - m_RootOrder: 3 + m_Father: {fileID: 294094431} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 1, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} - m_AnchoredPosition: {x: 553, y: 0} + m_AnchoredPosition: {x: -110, y: 0} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1512761193 @@ -23934,7 +23937,7 @@ RectTransform: - {fileID: 540447343} - {fileID: 884765244} m_Father: {fileID: 1705891619} - m_RootOrder: 6 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -24459,13 +24462,12 @@ RectTransform: - {fileID: 179144105} - {fileID: 73964228} - {fileID: 2146083213} - - {fileID: 1512401060} - {fileID: 1286761764} - {fileID: 2015217526} - {fileID: 1686599134} - {fileID: 366308368} m_Father: {fileID: 294094431} - m_RootOrder: 0 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -28030,7 +28032,7 @@ RectTransform: - {fileID: 885686525} - {fileID: 950612176} m_Father: {fileID: 1705891619} - m_RootOrder: 5 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 0, y: 0.5} diff --git a/TheStrongestSnail/Assets/Scripts/RacingPanel/AllManeger.cs b/TheStrongestSnail/Assets/Scripts/RacingPanel/AllManeger.cs index 9f30065..9d19bf3 100644 --- a/TheStrongestSnail/Assets/Scripts/RacingPanel/AllManeger.cs +++ b/TheStrongestSnail/Assets/Scripts/RacingPanel/AllManeger.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Threading.Tasks; using UnityEngine; using UnityEngine.UI; +using DG.Tweening; using TMPro; public class AllManeger : MonoBehaviour { @@ -50,6 +51,8 @@ public class AllManeger : MonoBehaviour public int snailMoveNum;//蜗牛出动数量 public RacingPanel racingPanel; + public int WinNum;//到达终点蜗牛数量 + public int gameSession;//游戏场次 // Start is called before the first frame update async void Start() { @@ -136,12 +139,12 @@ public class AllManeger : MonoBehaviour { if (!is_jisha) { - MoveBg.instance.StartMove(); + TextMPtime.text = "GO!"; wordText.text = ""; Fuck524(); - AllMove(); + is_jisha = true; } @@ -220,7 +223,7 @@ public class AllManeger : MonoBehaviour } } } - + AllMove(); } public async void Fuck525() @@ -273,7 +276,20 @@ public class AllManeger : MonoBehaviour public void GetKillInfo521(GameKnightModel GameKnightModel)//获取击杀马匹与留存马匹 { + gameSession = GameKnightModel.GameSession;//游戏场次 + if (gameSession==1) + { + WinNum = 4;//8进4 + } + else if (gameSession == 2) + { + WinNum = 2;//4进2 + } + else if (gameSession == 3) + { + WinNum = 1;//2进1 + } if (GameKnightModel.HorseNoAll!="") { string[] parts = GameKnightModel.HorseNoAll.Split(","); @@ -331,6 +347,7 @@ public class AllManeger : MonoBehaviour snail.startMove(); } + MoveBg.instance.StartMove(); } public void Allreturn()//所有蜗牛回去 { @@ -351,5 +368,14 @@ public class AllManeger : MonoBehaviour } } + public void StopAllSanil()//停止所有蜗牛 + { + DOTween.KillAll(); // 停止所有的 DOTween 动画 + foreach (snailRider snail in snailRiders) + { + + snail.animator.SetInteger("State", 0); + } + } } diff --git a/TheStrongestSnail/Assets/Scripts/RacingPanel/snailRider.cs b/TheStrongestSnail/Assets/Scripts/RacingPanel/snailRider.cs index 9d1f415..bcd1a33 100644 --- a/TheStrongestSnail/Assets/Scripts/RacingPanel/snailRider.cs +++ b/TheStrongestSnail/Assets/Scripts/RacingPanel/snailRider.cs @@ -55,18 +55,17 @@ public class snailRider : MonoBehaviour { //palye.enabled = !is_die; - if (!is_die) - { + animator.SetInteger("State",1);//切换为移动动画 float suiji = 0;//时间时间 if (is_victory) { - suiji = UnityEngine.Random.Range(4, 6); + suiji = UnityEngine.Random.Range(5, 7); } else { - suiji = UnityEngine.Random.Range(5, 10); + suiji = UnityEngine.Random.Range(8, 10); } @@ -74,10 +73,15 @@ public class snailRider : MonoBehaviour transform.DOMoveX(end.transform.position.x, suiji).SetEase(Ease.Linear).OnComplete(()=> { animator.SetInteger("State", 0); Debug.Log("动画完成,切换为待机动画"); + AllManeger.instance.WinNum--; + if (AllManeger.instance.WinNum <= 0) + { + AllManeger.instance.StopAllSanil(); + } }) //切换为待机动画 ; mySequence.OnKill(()=> { AllManeger.instance.snailMoveNum++; }); - } + } public void returnStart() @@ -116,6 +120,7 @@ public class snailRider : MonoBehaviour { Debug.Log("碰到"); animator.SetInteger("State", 0); + } } }