Compare commits
2 Commits
7c9407a02e
...
a26c485de2
Author | SHA1 | Date |
---|---|---|
|
a26c485de2 | |
|
f0b21888a4 |
|
@ -154,6 +154,8 @@ public class Taskpanel : MonoBehaviour
|
||||||
string _msg = "leaveroom ";
|
string _msg = "leaveroom ";
|
||||||
_ = SyncCreateRoom.SendMessageAsync(_msg);
|
_ = SyncCreateRoom.SendMessageAsync(_msg);
|
||||||
}
|
}
|
||||||
|
if (GameManager.Instance.isPlayer)
|
||||||
|
SceneManager.LoadScene("SampleScene");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -161,7 +163,6 @@ public class Taskpanel : MonoBehaviour
|
||||||
{
|
{
|
||||||
Debug.Log("Leaveroom");
|
Debug.Log("Leaveroom");
|
||||||
_ = SyncCreateRoom.SendMessageAsync($"send2room offline,{GlobalFlag.currentUser.user_id}");
|
_ = SyncCreateRoom.SendMessageAsync($"send2room offline,{GlobalFlag.currentUser.user_id}");
|
||||||
SceneManager.LoadScene("SampleScene");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -248,23 +248,12 @@ public class View_Panel2 : XUIPanel
|
||||||
|
|
||||||
public void OnRegisterFunction()
|
public void OnRegisterFunction()
|
||||||
{
|
{
|
||||||
//AdamSync.SyncCreateRoom.joinRoomRequset -= OnJoinRoom;
|
|
||||||
//AdamSync.SyncCreateRoom.createRoomRequset += OnCreateRoom;
|
|
||||||
AdamSync.SyncCreateRoom.joinRoomRequset += OnJoinRoom;
|
AdamSync.SyncCreateRoom.joinRoomRequset += OnJoinRoom;
|
||||||
//AdamSync.SyncCreateRoom.getRoomsRequset += OnGetRooms;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//public void OnGetRooms(string msg)
|
|
||||||
//{
|
|
||||||
// Debug.Log("OnGetRooms====" + msg);
|
|
||||||
//}
|
|
||||||
//public void OnCreateRoom(string msg)
|
|
||||||
//{
|
|
||||||
// Debug.Log("OnCreateRoom====" + msg);
|
|
||||||
//}
|
|
||||||
public void OnJoinRoom(string msg)
|
public void OnJoinRoom(string msg)
|
||||||
{
|
{
|
||||||
Debug.Log("OnJoinRoom===" + msg);
|
Debug.Log("OnJoinRoom ViewPanel===" + msg);
|
||||||
SceneManager.LoadScene("AdamTraining_pilot_terminal_panl 1");
|
SceneManager.LoadScene("AdamTraining_pilot_terminal_panl 1");
|
||||||
}
|
}
|
||||||
public async void GetAllRoomData()
|
public async void GetAllRoomData()
|
||||||
|
@ -486,6 +475,7 @@ public class View_Panel2 : XUIPanel
|
||||||
GameMain.model = false;
|
GameMain.model = false;
|
||||||
//SceneManager.LoadScene("AdamTraining_pilot_terminal_panl 1");
|
//SceneManager.LoadScene("AdamTraining_pilot_terminal_panl 1");
|
||||||
//加入房间
|
//加入房间
|
||||||
|
Debug.Log("进入训练");
|
||||||
string RoomName = "joinroom " + currentRoomName;
|
string RoomName = "joinroom " + currentRoomName;
|
||||||
_ = AdamSync.SyncCreateRoom.SendMessageAsync(RoomName);
|
_ = AdamSync.SyncCreateRoom.SendMessageAsync(RoomName);
|
||||||
});
|
});
|
||||||
|
@ -856,14 +846,14 @@ public class View_Panel2 : XUIPanel
|
||||||
{
|
{
|
||||||
Debug.Log("OnDisable");
|
Debug.Log("OnDisable");
|
||||||
//AdamSync.SyncCreateRoom.createRoomRequset -= OnCreateRoom;
|
//AdamSync.SyncCreateRoom.createRoomRequset -= OnCreateRoom;
|
||||||
//AdamSync.SyncCreateRoom.joinRoomRequset -= OnJoinRoom;
|
AdamSync.SyncCreateRoom.joinRoomRequset -= OnJoinRoom;
|
||||||
//AdamSync.SyncCreateRoom.getRoomsRequset += OnGetRooms;
|
//AdamSync.SyncCreateRoom.getRoomsRequset += OnGetRooms;
|
||||||
}
|
}
|
||||||
private void OnDestory()
|
private void OnDestory()
|
||||||
{
|
{
|
||||||
Debug.Log("OnDestory");
|
Debug.Log("OnDestory");
|
||||||
//AdamSync.SyncCreateRoom.createRoomRequset -= OnCreateRoom;
|
//AdamSync.SyncCreateRoom.createRoomRequset -= OnCreateRoom;
|
||||||
//AdamSync.SyncCreateRoom.joinRoomRequset -= OnJoinRoom;
|
AdamSync.SyncCreateRoom.joinRoomRequset -= OnJoinRoom;
|
||||||
//AdamSync.SyncCreateRoom.getRoomsRequset -= OnGetRooms;
|
//AdamSync.SyncCreateRoom.getRoomsRequset -= OnGetRooms;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ public class GameManager : MonoSingleton<GameManager>
|
||||||
public DragController wxdDrag;
|
public DragController wxdDrag;
|
||||||
public GameObject Teacher;
|
public GameObject Teacher;
|
||||||
public GameObject student;
|
public GameObject student;
|
||||||
|
public bool isPlayer = true;
|
||||||
public System.Collections.Generic.List<SyncPlayerTransform> players = new System.Collections.Generic.List<SyncPlayerTransform>();
|
public System.Collections.Generic.List<SyncPlayerTransform> players = new System.Collections.Generic.List<SyncPlayerTransform>();
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
private void Awake()
|
private void Awake()
|
||||||
|
@ -46,7 +47,7 @@ public class GameManager : MonoSingleton<GameManager>
|
||||||
spt.gameObject.SetActive(true);
|
spt.gameObject.SetActive(true);
|
||||||
spt.gameObject.transform.position = spawnPos.position;
|
spt.gameObject.transform.position = spawnPos.position;
|
||||||
spt.gameObject.transform.eulerAngles = spawnPos.eulerAngles;
|
spt.gameObject.transform.eulerAngles = spawnPos.eulerAngles;
|
||||||
spt.SetPlayerInfo(ulong.Parse(GlobalFlag.currentUser.user_id), GlobalFlag.currentUser.login_name, ulong.Parse(GlobalFlag.roomID), true);
|
spt.SetPlayerInfo(ulong.Parse(GlobalFlag.currentUser.user_id), GlobalFlag.currentUser.login_name, ulong.Parse(GlobalFlag.roomID), isPlayer);
|
||||||
AddPlayers(spt);
|
AddPlayers(spt);
|
||||||
ToolsBootstrap.Instance.SetCameraInfo(spt);
|
ToolsBootstrap.Instance.SetCameraInfo(spt);
|
||||||
//0 red 1 blue
|
//0 red 1 blue
|
||||||
|
@ -163,7 +164,7 @@ public class GameManager : MonoSingleton<GameManager>
|
||||||
spt.gameObject.SetActive(true);
|
spt.gameObject.SetActive(true);
|
||||||
spt.gameObject.transform.position = spawnPos.position;
|
spt.gameObject.transform.position = spawnPos.position;
|
||||||
spt.gameObject.transform.eulerAngles = spawnPos.eulerAngles;
|
spt.gameObject.transform.eulerAngles = spawnPos.eulerAngles;
|
||||||
spt.SetPlayerInfo(ulong.Parse(data[1]), data[2], ulong.Parse(data[3]), false);
|
spt.SetPlayerInfo(ulong.Parse(data[1]), data[2], ulong.Parse(data[3]), !isPlayer);
|
||||||
AddPlayers(spt);
|
AddPlayers(spt);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -237,7 +238,7 @@ public class GameManager : MonoSingleton<GameManager>
|
||||||
{
|
{
|
||||||
SyncPlayerTransform spt = Instantiate(playerTransformPrefab);
|
SyncPlayerTransform spt = Instantiate(playerTransformPrefab);
|
||||||
spt.gameObject.SetActive(true);
|
spt.gameObject.SetActive(true);
|
||||||
spt.SetPlayerInfo(ulong.Parse(userInfo[0]), userInfo[1], ulong.Parse(userInfo[2]), false);
|
spt.SetPlayerInfo(ulong.Parse(userInfo[0]), userInfo[1], ulong.Parse(userInfo[2]), !isPlayer);
|
||||||
spt.transform.position = new Vector3(spawnPos.position.x + index * 0.5f, spawnPos.position.y, spawnPos.position.z + index * 0.5f);
|
spt.transform.position = new Vector3(spawnPos.position.x + index * 0.5f, spawnPos.position.y, spawnPos.position.z + index * 0.5f);
|
||||||
spt.transform.eulerAngles = spawnPos.eulerAngles;
|
spt.transform.eulerAngles = spawnPos.eulerAngles;
|
||||||
AddPlayers(spt);
|
AddPlayers(spt);
|
||||||
|
|
Loading…
Reference in New Issue