蜗牛骑士bug修复,失败蜗牛未到终点停止

This commit is contained in:
GL 2024-12-05 20:00:51 +08:00
parent ce49792625
commit 0f5a45c7fc
3 changed files with 55 additions and 22 deletions

View File

@ -2353,7 +2353,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5372453729458756189, guid: f06fd4485b1c4c54ba7070bde9d2b5d3, type: 3} - target: {fileID: 5372453729458756189, guid: f06fd4485b1c4c54ba7070bde9d2b5d3, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 5 value: 6
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5372453729458756189, guid: f06fd4485b1c4c54ba7070bde9d2b5d3, type: 3} - target: {fileID: 5372453729458756189, guid: f06fd4485b1c4c54ba7070bde9d2b5d3, type: 3}
propertyPath: m_AnchorMax.x propertyPath: m_AnchorMax.x
@ -3944,6 +3944,7 @@ RectTransform:
m_LocalScale: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 1512401060}
- {fileID: 1705891619} - {fileID: 1705891619}
- {fileID: 394840204} - {fileID: 394840204}
- {fileID: 771005323} - {fileID: 771005323}
@ -5338,7 +5339,7 @@ RectTransform:
- {fileID: 178345081} - {fileID: 178345081}
- {fileID: 287674963} - {fileID: 287674963}
m_Father: {fileID: 1705891619} m_Father: {fileID: 1705891619}
m_RootOrder: 7 m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
@ -5644,7 +5645,7 @@ RectTransform:
- {fileID: 1997348953} - {fileID: 1997348953}
- {fileID: 540295172} - {fileID: 540295172}
m_Father: {fileID: 294094431} m_Father: {fileID: 294094431}
m_RootOrder: 1 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
@ -5988,6 +5989,8 @@ MonoBehaviour:
is_NOneedReflash: 0 is_NOneedReflash: 0
snailMoveNum: 0 snailMoveNum: 0
racingPanel: {fileID: 394840207} racingPanel: {fileID: 394840207}
WinNum: 0
gameSession: 0
--- !u!1 &402443204 --- !u!1 &402443204
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -9675,7 +9678,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1574451517034624567, guid: 52525b7ee4a02b947be72267c965e811, type: 3} - target: {fileID: 1574451517034624567, guid: 52525b7ee4a02b947be72267c965e811, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 3 value: 4
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1574451517034624567, guid: 52525b7ee4a02b947be72267c965e811, type: 3} - target: {fileID: 1574451517034624567, guid: 52525b7ee4a02b947be72267c965e811, type: 3}
propertyPath: m_AnchorMax.x propertyPath: m_AnchorMax.x
@ -10078,7 +10081,7 @@ RectTransform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 294094431} m_Father: {fileID: 294094431}
m_RootOrder: 2 m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
@ -11861,7 +11864,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5372453729458756189, guid: f06fd4485b1c4c54ba7070bde9d2b5d3, type: 3} - target: {fileID: 5372453729458756189, guid: f06fd4485b1c4c54ba7070bde9d2b5d3, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 4 value: 5
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5372453729458756189, guid: f06fd4485b1c4c54ba7070bde9d2b5d3, type: 3} - target: {fileID: 5372453729458756189, guid: f06fd4485b1c4c54ba7070bde9d2b5d3, type: 3}
propertyPath: m_AnchorMax.x propertyPath: m_AnchorMax.x
@ -18319,7 +18322,7 @@ RectTransform:
- {fileID: 1643667392} - {fileID: 1643667392}
- {fileID: 1277993770} - {fileID: 1277993770}
m_Father: {fileID: 1705891619} m_Father: {fileID: 1705891619}
m_RootOrder: 4 m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0.5} m_AnchorMin: {x: 1, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5} m_AnchorMax: {x: 1, y: 0.5}
@ -20565,12 +20568,12 @@ RectTransform:
- {fileID: 869027440} - {fileID: 869027440}
- {fileID: 1993090952} - {fileID: 1993090952}
- {fileID: 30141600} - {fileID: 30141600}
m_Father: {fileID: 1705891619} m_Father: {fileID: 294094431}
m_RootOrder: 3 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0.5} m_AnchorMin: {x: 1, y: 0.5}
m_AnchorMax: {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_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1512761193 --- !u!1 &1512761193
@ -23934,7 +23937,7 @@ RectTransform:
- {fileID: 540447343} - {fileID: 540447343}
- {fileID: 884765244} - {fileID: 884765244}
m_Father: {fileID: 1705891619} m_Father: {fileID: 1705891619}
m_RootOrder: 6 m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
@ -24459,13 +24462,12 @@ RectTransform:
- {fileID: 179144105} - {fileID: 179144105}
- {fileID: 73964228} - {fileID: 73964228}
- {fileID: 2146083213} - {fileID: 2146083213}
- {fileID: 1512401060}
- {fileID: 1286761764} - {fileID: 1286761764}
- {fileID: 2015217526} - {fileID: 2015217526}
- {fileID: 1686599134} - {fileID: 1686599134}
- {fileID: 366308368} - {fileID: 366308368}
m_Father: {fileID: 294094431} m_Father: {fileID: 294094431}
m_RootOrder: 0 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
@ -28030,7 +28032,7 @@ RectTransform:
- {fileID: 885686525} - {fileID: 885686525}
- {fileID: 950612176} - {fileID: 950612176}
m_Father: {fileID: 1705891619} m_Father: {fileID: 1705891619}
m_RootOrder: 5 m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5} m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5} m_AnchorMax: {x: 0, y: 0.5}

View File

@ -4,6 +4,7 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using DG.Tweening;
using TMPro; using TMPro;
public class AllManeger : MonoBehaviour public class AllManeger : MonoBehaviour
{ {
@ -50,6 +51,8 @@ public class AllManeger : MonoBehaviour
public int snailMoveNum;//蜗牛出动数量 public int snailMoveNum;//蜗牛出动数量
public RacingPanel racingPanel; public RacingPanel racingPanel;
public int WinNum;//到达终点蜗牛数量
public int gameSession;//游戏场次
// Start is called before the first frame update // Start is called before the first frame update
async void Start() async void Start()
{ {
@ -136,12 +139,12 @@ public class AllManeger : MonoBehaviour
{ {
if (!is_jisha) if (!is_jisha)
{ {
MoveBg.instance.StartMove();
TextMPtime.text = "GO!"; TextMPtime.text = "GO!";
wordText.text = ""; wordText.text = "";
Fuck524(); Fuck524();
AllMove();
is_jisha = true; is_jisha = true;
} }
@ -220,7 +223,7 @@ public class AllManeger : MonoBehaviour
} }
} }
} }
AllMove();
} }
public async void Fuck525() public async void Fuck525()
@ -273,7 +276,20 @@ public class AllManeger : MonoBehaviour
public void GetKillInfo521(GameKnightModel GameKnightModel)//获取击杀马匹与留存马匹 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!="") if (GameKnightModel.HorseNoAll!="")
{ {
string[] parts = GameKnightModel.HorseNoAll.Split(","); string[] parts = GameKnightModel.HorseNoAll.Split(",");
@ -331,6 +347,7 @@ public class AllManeger : MonoBehaviour
snail.startMove(); snail.startMove();
} }
MoveBg.instance.StartMove();
} }
public void Allreturn()//所有蜗牛回去 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);
}
}
} }

View File

@ -55,18 +55,17 @@ public class snailRider : MonoBehaviour
{ {
//palye.enabled = !is_die; //palye.enabled = !is_die;
if (!is_die)
{
animator.SetInteger("State",1);//切换为移动动画 animator.SetInteger("State",1);//切换为移动动画
float suiji = 0;//时间时间 float suiji = 0;//时间时间
if (is_victory) if (is_victory)
{ {
suiji = UnityEngine.Random.Range(4, 6); suiji = UnityEngine.Random.Range(5, 7);
} }
else 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(()=> { transform.DOMoveX(end.transform.position.x, suiji).SetEase(Ease.Linear).OnComplete(()=> {
animator.SetInteger("State", 0); animator.SetInteger("State", 0);
Debug.Log("动画完成,切换为待机动画"); Debug.Log("动画完成,切换为待机动画");
AllManeger.instance.WinNum--;
if (AllManeger.instance.WinNum <= 0)
{
AllManeger.instance.StopAllSanil();
}
}) //切换为待机动画 }) //切换为待机动画
; ;
mySequence.OnKill(()=> { AllManeger.instance.snailMoveNum++; }); mySequence.OnKill(()=> { AllManeger.instance.snailMoveNum++; });
}
} }
public void returnStart() public void returnStart()
@ -116,6 +120,7 @@ public class snailRider : MonoBehaviour
{ {
Debug.Log("碰到"); Debug.Log("碰到");
animator.SetInteger("State", 0); animator.SetInteger("State", 0);
} }
} }
} }