开始房间

This commit is contained in:
huyulong 2024-12-29 20:25:37 +08:00
parent 0c7f8fa2ad
commit 6defaa66fe
3 changed files with 18 additions and 6 deletions

View File

@ -780,7 +780,7 @@ public class test : MonoBehaviour
} }
if (userJoinResponse.MessageType == 11)//·¿¼ä¿ªÊ¼ if (userJoinResponse.MessageType == 11)//·¿¼ä¿ªÊ¼
{ {
test111.instance.Oppanel();
} }
break; break;

View File

@ -145,6 +145,7 @@ public class Starthost : MonoBehaviour
image.gameObject.SetActive(true); image.gameObject.SetActive(true);
ready.gameObject.SetActive(false); ready.gameObject.SetActive(false);
test.JoinRoom(ReadRoom.instance.roomid); test.JoinRoom(ReadRoom.instance.roomid);
test.PlayerReady(ReadRoom.instance.roomid, true);
} }
// 停止计时并重置时间显示的方法 // 停止计时并重置时间显示的方法
public void StopTimer() public void StopTimer()

View File

@ -4,6 +4,7 @@ using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
public class test111 : MonoBehaviour public class test111 : MonoBehaviour
{ {
public static test111 instance;
// Start is called before the first frame update // Start is called before the first frame update
public Canvas canvas1; public Canvas canvas1;
public Camera camera; public Camera camera;
@ -12,24 +13,34 @@ public class test111 : MonoBehaviour
void Start() void Start()
{ {
if (ReadRoom.instance.isenter) instance = this;
{
Debug.Log(ReadRoom.instance.isenter);
canvas1.gameObject.SetActive(false); canvas1.gameObject.SetActive(false);
camera.gameObject.SetActive(false); camera.gameObject.SetActive(false);
canvas2.gameObject.SetActive(true); canvas2.gameObject.SetActive(true);
camera1.gameObject.SetActive(true); camera1.gameObject.SetActive(true);
}
public void Oppanel()
{
Debug.LogError("·¿¼ä¿ªÊ¼ÓÎÏ·");
if (ReadRoom.instance.isenter)
{
Debug.Log(ReadRoom.instance.isenter);
canvas1.gameObject.SetActive(false);
camera.gameObject.SetActive(true);
canvas2.gameObject.SetActive(false);
camera1.gameObject.SetActive(false);
} }
else else
{ {
canvas1.gameObject.SetActive(false); canvas1.gameObject.SetActive(false);
camera.gameObject.SetActive(false); camera.gameObject.SetActive(false);
canvas2.gameObject.SetActive(true); canvas2.gameObject.SetActive(true);
camera1.gameObject.SetActive(true); camera1.gameObject.SetActive(true);
} }
} }
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {