_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/RacingPanel/AllManeger.cs

140 lines
4.0 KiB
C#
Raw Normal View History

2024-11-27 23:40:28 +08:00
using System.Collections;
using System.Collections.Generic;
2024-11-28 01:09:32 +08:00
using System.Linq;
2024-11-27 23:40:28 +08:00
using UnityEngine;
public class AllManeger : MonoBehaviour
{
public queryClosestKnight521 queryClosestKnight521=new queryClosestKnight521();
public ClosestKnight closestKnight521 = new ClosestKnight();
2024-11-28 01:09:32 +08:00
public queryKnightRoomList522 queryKnightRoomList522 = new queryKnightRoomList522();
public KnightRoomBetList knightRoomBetList = new KnightRoomBetList();
2024-11-27 23:40:28 +08:00
public int id;//<2F><>Ϸid
public string gameNo;//<2F><>Ϸ<EFBFBD><CFB7><EFBFBD><EFBFBD>
public int GameSession;//<2F><>Ϸ<EFBFBD><CFB7><EFBFBD><EFBFBD>
public List<HorseInfo> horseInfos = new List<HorseInfo>();
2024-11-28 01:09:32 +08:00
public List<snailRider> snailRiders = new List<snailRider>();
2024-11-27 23:40:28 +08:00
2024-11-28 01:09:32 +08:00
public List<int> KillNos=new List<int>();
public List<int> WinNos = new List<int>();
2024-11-27 23:40:28 +08:00
// Start is called before the first frame update
async void Start()
{
closestKnight521 = await queryClosestKnight521.queryClosestKnight();
2024-11-28 01:09:32 +08:00
id=closestKnight521.Data.GameKnightModel.Id;
gameNo = closestKnight521.Data.GameKnightModel.GameNo;
GameSession = closestKnight521.Data.GameKnightModel.GameSession;
GetHorseInfo521(closestKnight521.Data.GameKnightRoomResponseVoList);
GetKillInfo521(closestKnight521.Data.GameKnightModel);
AllMove();
InvokeRepeating("Fuck522", 2, 2);
2024-11-27 23:40:28 +08:00
}
// Update is called once per frame
void Update()
{
}
2024-11-28 01:09:32 +08:00
void OnDestroy()
{
CancelInvoke("Fuck522");
}
public void Fuck522(List<GameKnightRoomResponseVo> GameKnightRoomResponseVoList)
{
foreach (GameKnightRoomResponseVo item in GameKnightRoomResponseVoList)
{
foreach (HorseInfo horse in horseInfos)
{
if (horse.HorseNo == item.HorseNo)
{
horse.numText.text = item.HorseBeansCoin.ToString();
}
}
}
}
public void GetHorseInfo521(List<GameKnightRoomResponseVo> GameKnightRoomResponseVoList)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>Ϣ
2024-11-27 23:40:28 +08:00
{
foreach (GameKnightRoomResponseVo item in GameKnightRoomResponseVoList)
{
2024-11-28 01:09:32 +08:00
2024-11-27 23:40:28 +08:00
foreach (HorseInfo horse in horseInfos)
{
2024-11-28 01:09:32 +08:00
if (horse.HorseNo==item.HorseNo)
{
horse.KnightId = item.KnightId;
horse.HorseUserNo = item.HorseUserNo;
horse.HorseBeansCoin = item.HorseBeansCoin;
horse.numText.text = item.HorseBeansCoin.ToString();
}
2024-11-27 23:40:28 +08:00
}
}
}
2024-11-28 01:09:32 +08:00
public void GetKillInfo521(GameKnightModel GameKnightModel)//<2F><>ȡ<EFBFBD><C8A1>ɱ<EFBFBD><C9B1>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ
{
Debug.Log("<22><>ȡ<EFBFBD><C8A1>ɱ<EFBFBD><C9B1>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ");
if (GameKnightModel.HorseNoKill!="")
{
string[] parts = GameKnightModel.HorseNoKill.Split(","); // <20><><EFBFBD><EFBFBD> ',' <20>ָ<EFBFBD><D6B8>ַ<EFBFBD><D6B7><EFBFBD>d
KillNos = parts.Select(int.Parse).ToList();
foreach (int killno in KillNos)
{
foreach (HorseInfo horse in horseInfos)
{
if (horse.HorseNo == killno)
{
horse.snail.is_die = true;
}
}
}
}
if (GameKnightModel.HorseNoRemain!="")
{
string[] parts_2 = GameKnightModel.HorseNoRemain.Split(",");
WinNos = parts_2.Select(int.Parse).ToList();
foreach (int winno in WinNos)
{
foreach (HorseInfo horse in horseInfos)
{
if (horse.HorseNo == winno)
{
horse.snail.is_victory = true;
}
}
}
}
}
public void AllMove()//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD><C5A3><EFBFBD><EFBFBD>
{
Debug.Log(<><D7BC>");
foreach (snailRider snail in snailRiders)
{
Debug.Log("<22><><EFBFBD><EFBFBD>");
snail.startMove();
}
}
2024-11-27 23:40:28 +08:00
}