revert Merge branch 'main' of http://shu.sheziwanglo.cn:3000/wulongxiao/_TheStrongestSnail
This commit is contained in:
shurongsen 2024-11-16 02:23:05 +08:00
parent b3ae3c096b
commit 571c7e5bdf
10 changed files with 723 additions and 918 deletions

File diff suppressed because it is too large Load Diff

View File

@ -4044,29 +4044,6 @@ MonoBehaviour:
station:
cuteNo:
memberTime:
response:
code: 0
message:
data:
carrySeconds: 0
gameEscapeRoomResponseVoList: []
gameEscapeModel:
id: 0
gameNo:
demonMode: 0
startTime:
betTime:
countTime:
settleTime:
status: 0
roomNoKill:
roomNoRemain:
beansCoinAll: 0
beansCoinKill: 0
beansCoinRemain: 0
beansCoinFee: 0
beansCoinRank: 0
beansCoinDivide: 0
--- !u!1 &1358692575
GameObject:
m_ObjectHideFlags: 0

View File

@ -5,7 +5,6 @@ using System.Threading.Tasks;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Windows;
using static UnityEditor.Progress;
using static UnityEngine.UIElements.UxmlAttributeDescription;
@ -17,7 +16,6 @@ public class AllHouseContro : MonoBehaviour
public GameObject text;
public GameObject detailsText;
public HouseBtn house;
public List<GameObject> bossobj;
// Start is called before the first frame update
async void Start()
{
@ -43,7 +41,7 @@ public class AllHouseContro : MonoBehaviour
string response511 = await web.SendRequest(web.URL + "/snail/gameEscape/queryLatest", "POST", "{}", head511);
Debug.Log("5.1.1查询最近一场大屠杀" + response511);
// 解析服务器返回的数据
Global.global.response = JsonConvert.DeserializeObject<ServerResponse>(response511);
Global.global.response = JsonConvert.DeserializeObject<Response>(response511);
escapeId = Global.global.response.data.gameEscapeModel.id;
int index = 0;
foreach (GameEscapeRoomResponseVo item in Global.global.response.data.gameEscapeRoomResponseVoList)
@ -75,7 +73,7 @@ public class AllHouseContro : MonoBehaviour
body.escapeId = escapeId;
string response = await web.SendRequest(web.URL+"/snail/gameEscape/queryEscapeRoomList", "POST", JsonUtility.ToJson(body), Global.global.CreateHeaders());
Debug.Log("5.1.2查询逃亡房间详情响应: " + response);
//Debug.Log("5.1.2²éѯÌÓÍö·¿¼äÏêÇéÏìÓ¦: " + response);
ServerResponse serverResponse = JsonConvert.DeserializeObject<ServerResponse>(response);
int index = 0;
foreach (var item in serverResponse.data.gameEscapeRoomResponseVoList){
@ -104,29 +102,7 @@ public class AllHouseContro : MonoBehaviour
response = await web.SendRequest(web.URL + "/snail/gameEscape/queryKill", "POST", JsonUtility.ToJson(body), Global.global.CreateHeaders());
Debug.Log("5.1.4: " + response);
ServerResponse514 serverResponse_514 = JsonConvert.DeserializeObject<ServerResponse514>(response);
string[] parts = serverResponse_514.data.roomNoKill.Split(","); // 根据 ',' 分割字符串d
int index_ = 0;
foreach (string part in parts) {
if (parts.Length > index_)
{
int a = 0;
foreach (HouseBtn item in HouseBtnList)
{
if (a == int.Parse(parts[index_])) {
bossobj[index_].GetComponent<BossContro>().BossMove(int.Parse(parts[index_]));
bossobj[index_].GetComponent<PlayerMove>().room_id = parts[index_];
}
a++;
}
index_++;
}
}
}
}
else if (serverResponse.data.carrySeconds > 50) {
@ -138,7 +114,6 @@ public class AllHouseContro : MonoBehaviour
response = await web.SendRequest(web.URL + "/snail/gameEscape/queryUserBetResult", "POST", JsonUtility.ToJson(body), Global.global.CreateHeaders());
Debug.Log("5.1.5: " + response);
}
}
}

View File

@ -84,20 +84,39 @@ public class BettingBtn : MonoBehaviour
}
}
public void GiveMoney(string room_id)
public void GiveMoney()
{
float AllMoney = text1.GetComponent<TextBox>().ReturnText() + text2.GetComponent<TextBox>().ReturnText() + text3.GetComponent<TextBox>().ReturnText()
+ text4.GetComponent<TextBox>().ReturnText() + text5.GetComponent<TextBox>().ReturnText() + text6.GetComponent<TextBox>().ReturnText();
foreach (GameObject item in list)
switch (BossContro.instance.HouseId)
{
if (item.GetComponent<TextBox>().ParentHouse.GetComponent<HouseBtn>().roomNo == int.Parse(room_id))
{
item.GetComponent<TextBox>().PlayAni();
ControMoney(item);
}
case 1:
text1.GetComponent<TextBox>().PlayAni();
ControMoney(text1);
break;
case 2:
text2.GetComponent<TextBox>().PlayAni();
ControMoney(text2);
break;
case 3:
text3.GetComponent<TextBox>().PlayAni();
ControMoney(text3);
break;
case 4:
text4.GetComponent<TextBox>().PlayAni();
ControMoney(text4);
break;
case 5:
text5.GetComponent<TextBox>().PlayAni();
ControMoney(text5);
break;
case 6:
text6.GetComponent<TextBox>().PlayAni();
ControMoney(text6);
break;
}

View File

@ -8,7 +8,7 @@ public class BossContro : MonoBehaviour
public Transform Parent;
public Transform originalParent;
public Transform BoosStartPos;
//public static BossContro instance;
public static BossContro instance;
public Transform StartPos;
public Animator BossAni;//boos动画
@ -17,11 +17,10 @@ public class BossContro : MonoBehaviour
public Transform BoosHouse;//boos房间
public AllHouseContro allHouseContro;
public GameObject bg;
// Start is called before the first frame update
void Start()
{
//instance = this;
instance = this;
originalParent = transform.parent;
}
@ -53,42 +52,30 @@ public class BossContro : MonoBehaviour
public void BossMove(int Index)
public void BossMove()
{
Debug.Log("===========--------------");
foreach (HouseBtn item in allHouseContro.HouseBtnList)
{
Debug.Log(item.roomNo.ToString() + "|" + Index.ToString());
if (item.roomNo == Index)
{
GetComponent<PlayerMove>().EndPos = item.post.transform;
}
int Index=Random.Range(0,5);
switch (Index)
{
case 0:
GetComponent<PlayerMove>().EndPos = GetComponent<PlayerMove>().TypeEndPos1;
break;
case 1:
GetComponent<PlayerMove>().EndPos = GetComponent<PlayerMove>().TypeEndPos2;
break;
case 2:
GetComponent<PlayerMove>().EndPos = GetComponent<PlayerMove>().TypeEndPos3;
break;
case 3:
GetComponent<PlayerMove>().EndPos = GetComponent<PlayerMove>().TypeEndPos4;
break;
case 4:
GetComponent<PlayerMove>().EndPos = GetComponent<PlayerMove>().TypeEndPos5;
break;
case 5:
GetComponent<PlayerMove>().EndPos = GetComponent<PlayerMove>().TypeEndPos6;
break;
}
//GetComponent<PlayerMove>().TypeEndPos1
//switch (Index)
//{
// case 1:
// GetComponent<PlayerMove>().EndPos = GetComponent<PlayerMove>().TypeEndPos1;
// break;
// case 2:
// GetComponent<PlayerMove>().EndPos = GetComponent<PlayerMove>().TypeEndPos2;
// break;
// case 3:
// GetComponent<PlayerMove>().EndPos = GetComponent<PlayerMove>().TypeEndPos3;
// break;
// case 4:
// GetComponent<PlayerMove>().EndPos = GetComponent<PlayerMove>().TypeEndPos4;
// break;
// case 5:
// GetComponent<PlayerMove>().EndPos = GetComponent<PlayerMove>().TypeEndPos5;
// break;
// case 6:
// GetComponent<PlayerMove>().EndPos = GetComponent<PlayerMove>().TypeEndPos6;
// break;
// case 0:
// GetComponent<PlayerMove>().EndPos = GetComponent<PlayerMove>().TypeEndPos0;
// break;
//}
//MoveParent();
BossAni.SetInteger("State", 1); // 动画转为移动
GetComponent<PlayerMove>().StartMove(); // 开始移动

View File

@ -8,7 +8,6 @@ public class FailPanel : BasePanel
public Button ReturnBtn;
public GameObject moveObject;
public static FailPanel instance;
public GameObject bg;
public override void Start()
{
instance = this;
@ -34,10 +33,6 @@ public class FailPanel : BasePanel
public override void ShowPanel()
{
base.ShowPanel();
foreach (GameObject item in bg.GetComponent<AllHouseContro>().bossobj)
{
item.GetComponent<BossContro>().ReturnParent();
}
//dic[room_id].GetComponent<BossContro>().ReturnParent();
BossContro.instance.ReturnParent();
}
}

View File

@ -12,7 +12,6 @@ public class HouseBtn : MonoBehaviour
public GameObject Mask;
public RectTransform door;
public GameObject text;
public GameObject post;
//public selectLatest511.GameEscapeRoomResponseVo gameEscapeRoomResponseVo;
public bool DoorIsOpen;
// Start is called before the first frame update

View File

@ -11,11 +11,10 @@ public class PlayerMove : MonoBehaviour
public bool isLooping = false; // 是否循环路径
int startIndex = 0;
int endIndex = 0;
public string room_id;
public float Speed;
public Transform EndPos;
public Transform TypeEndPos0;
public Transform TypeEndPos1;
public Transform TypeEndPos2;
public Transform TypeEndPos3;
@ -75,7 +74,7 @@ public class PlayerMove : MonoBehaviour
}
else
{
GetComponent<BossContro>().HouseId = 1;
BossContro.instance.HouseId = 1;
}
}
else if (EndPos == TypeEndPos2)
@ -88,7 +87,7 @@ public class PlayerMove : MonoBehaviour
}
else
{
GetComponent<BossContro>().HouseId = 2;
BossContro.instance.HouseId = 2;
}
}
else if(EndPos == TypeEndPos3)
@ -100,7 +99,7 @@ public class PlayerMove : MonoBehaviour
}
else
{
GetComponent<BossContro>().HouseId = 3;
BossContro.instance.HouseId = 3;
}
}
else if (EndPos == TypeEndPos4)
@ -112,7 +111,7 @@ public class PlayerMove : MonoBehaviour
}
else
{
GetComponent<BossContro>().HouseId = 4;
BossContro.instance.HouseId = 4;
}
}
else if (EndPos == TypeEndPos5)
@ -124,7 +123,7 @@ public class PlayerMove : MonoBehaviour
}
else
{
GetComponent<BossContro>().HouseId = 5;
BossContro.instance.HouseId = 5;
}
}
else if (EndPos == TypeEndPos6)
@ -136,7 +135,7 @@ public class PlayerMove : MonoBehaviour
}
else
{
GetComponent<BossContro>().HouseId = 6;
BossContro.instance.HouseId = 6;
}
}
@ -212,7 +211,7 @@ public class PlayerMove : MonoBehaviour
Debug.Log("Startindex"+i);
}
else if (IsBoos && GetComponent<BossContro>().BoosStartPos== pathPoints[i])
else if (IsBoos && BossContro.instance.BoosStartPos== pathPoints[i])
{
startIndex = i;
Debug.Log("Startindex" + i);
@ -291,17 +290,17 @@ public class PlayerMove : MonoBehaviour
else
{
JudgeEnd();
GetComponent<BossContro>().BossAni.SetInteger("State", 0);//Í£Ö¹Òƶ¯
allHouseContro.ControOneDoorOpen(GetComponent<BossContro>().HouseId,() => {//¿ªÃÅ
GetComponent<BossContro>().BossAni.SetInteger("State", 1);
BossContro.instance.BossAni.SetInteger("State", 0);//Í£Ö¹Òƶ¯
allHouseContro.ControOneDoorOpen(BossContro.instance.HouseId,() => {//¿ªÃÅ
BossContro.instance.BossAni.SetInteger("State", 1);
objectToMove.DOMoveY(objectToMove.position.y + 100, 0.5f).OnComplete(() => {//进房间
SetParentToHouse();
StartCoroutine(BoosAttack());
GetComponent<BossContro>().BoosStartPos = EndPos;
BossContro.instance.BoosStartPos = EndPos;
//JudgeSuccOrFail();
});
@ -325,11 +324,11 @@ public class PlayerMove : MonoBehaviour
IEnumerator BoosAttack()
{
GetComponent<BossContro>().BossAni.SetInteger("State", 2);
BossContro.instance.BossAni.SetInteger("State", 2);
yield return new WaitForSeconds(3f);
GetComponent<BossContro>().BossAni.SetInteger("State", 0);
BossContro.instance.BossAni.SetInteger("State", 0);
BettingBtn.instance.GiveMoney(room_id);
BettingBtn.instance.GiveMoney();
yield return new WaitForSeconds(2f);
JudgeSuccOrFail();
}
@ -337,14 +336,13 @@ public class PlayerMove : MonoBehaviour
public void JudgeSuccOrFail()
{
Debug.Log("=000000000000000000000000000000000000000000000000");
if (GetComponent<BossContro>().BoosStartPos == PlayerMovePos.instance.StartPos && PlayerMovePos.instance.HadChoise)
if (BossContro.instance.BoosStartPos == PlayerMovePos.instance.StartPos && PlayerMovePos.instance.HadChoise)
{
//BossContro.instance.BossAni.SetInteger("State", 2);//boos攻击
Debug.Log("失败");//失败
FailPanel.instance.ShowPanel();
}
else if (GetComponent<BossContro>().BoosStartPos != PlayerMovePos.instance.StartPos && PlayerMovePos.instance.HadChoise)
else if (BossContro.instance.BoosStartPos != PlayerMovePos.instance.StartPos && PlayerMovePos.instance.HadChoise)
{
Debug.Log("胜利");//胜利
SucceePanel.instance.ShowPanel();
@ -352,10 +350,7 @@ public class PlayerMove : MonoBehaviour
else
{
Debug.Log("没有失败和胜利");//胜利
foreach (GameObject item in allHouseContro.bossobj)
{
item.GetComponent<BossContro>().ReturnParent();
}
}
//HegemonTime.instance.StartCoroutine(HegemonTime.instance.StartGame());//重新计算时间
}
@ -388,15 +383,15 @@ public class PlayerMove : MonoBehaviour
Vector3 nextWaypoint = waypoints[index + 1];
if (IsBoos)
{
if (nextWaypoint.x < currentWaypoint.x && !GetComponent<BossContro>().IsLeft)
if (nextWaypoint.x < currentWaypoint.x && !BossContro.instance.IsLeft)
{
GetComponent<BossContro>().IsLeft = true;
BossContro.instance.IsLeft = true;
// 旋转物体使其面向左侧绕Y轴旋转180度
Rotate();
}
else if (nextWaypoint.x > currentWaypoint.x && GetComponent<BossContro>().IsLeft)
else if (nextWaypoint.x > currentWaypoint.x && BossContro.instance.IsLeft)
{
GetComponent<BossContro>().IsLeft = false;
BossContro.instance.IsLeft = false;
Rotate();
}
}

View File

@ -8,7 +8,6 @@ public class SucceePanel : BasePanel
public Button ReturnBtn;
public GameObject moveObject;
public static SucceePanel instance;
public GameObject bg;
public override void Start()
{
instance = this;
@ -34,10 +33,6 @@ public class SucceePanel : BasePanel
public override void ShowPanel()
{
base.ShowPanel();
foreach (GameObject item in bg.GetComponent<AllHouseContro>().bossobj)
{
item.GetComponent<BossContro>().ReturnParent();
}
//FailPanel.instance.dic[room_id].GetComponent<BossContro>().ReturnParent();
BossContro.instance.ReturnParent();
}
}

View File

@ -7,7 +7,7 @@ public class Global : MonoBehaviour
{
public logoPanel.ServerResponse serverResponse;
public ServerResponse response;
public Response response;
public static Global global ;
// Start is called before the first frame update
@ -58,43 +58,12 @@ public class Data
public object gameEscapeUserModel; // 游戏逃亡用户模型 (目前未处理)
}
[Serializable]
public class Data514
{
public int id;
public string gameNo;
public int demonMode;
public string startTime;
public string betTime;
public string countTime;
public string settleTime;
public int status;
public string roomNoKill;
public string roomNoRemain;
public float beansCoinAll;
public float beansCoinKill;
public float beansCoinRemain;
public float beansCoinFee;
public float beansCoinRank;
public float beansCoinDivide;
}
[Serializable]
public class ServerResponse: Response
{
public Data data; // Êý¾Ý¶ÔÏó
}
[Serializable]
public class ServerResponse514: Response
{
public Data514 data; // Êý¾Ý¶ÔÏó
}
public class Response
public class ServerResponse
{
public int code; // 响应状态码
public string message; // 提示语
public Data data; // 数据对象
}
// 数据类
[Serializable]
@ -117,3 +86,12 @@ public class GameEscapeModel
public float beansCoinRank; // 排名奖励豆币
public float beansCoinDivide; // 分成豆币
}
[Serializable]
public class Response
{
public int code; // 状态码
public string message; // 返回信息
public Data data; // 数据对象
}