Compare commits

..

No commits in common. "a26c485de2ff4a10f6c003f5d0fb608043599df7" and "7c9407a02eb5d950d4ff688f04b354907fa333c8" have entirely different histories.

3 changed files with 21 additions and 13 deletions

View File

@ -154,8 +154,6 @@ public class Taskpanel : MonoBehaviour
string _msg = "leaveroom ";
_ = SyncCreateRoom.SendMessageAsync(_msg);
}
if (GameManager.Instance.isPlayer)
SceneManager.LoadScene("SampleScene");
}
@ -163,6 +161,7 @@ public class Taskpanel : MonoBehaviour
{
Debug.Log("Leaveroom");
_ = SyncCreateRoom.SendMessageAsync($"send2room offline,{GlobalFlag.currentUser.user_id}");
SceneManager.LoadScene("SampleScene");
}
}

View File

@ -248,12 +248,23 @@ public class View_Panel2 : XUIPanel
public void OnRegisterFunction()
{
//AdamSync.SyncCreateRoom.joinRoomRequset -= OnJoinRoom;
//AdamSync.SyncCreateRoom.createRoomRequset += OnCreateRoom;
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)
{
Debug.Log("OnJoinRoom ViewPanel===" + msg);
Debug.Log("OnJoinRoom===" + msg);
SceneManager.LoadScene("AdamTraining_pilot_terminal_panl 1");
}
public async void GetAllRoomData()
@ -475,7 +486,6 @@ public class View_Panel2 : XUIPanel
GameMain.model = false;
//SceneManager.LoadScene("AdamTraining_pilot_terminal_panl 1");
//加入房间
Debug.Log("进入训练");
string RoomName = "joinroom " + currentRoomName;
_ = AdamSync.SyncCreateRoom.SendMessageAsync(RoomName);
});
@ -846,14 +856,14 @@ public class View_Panel2 : XUIPanel
{
Debug.Log("OnDisable");
//AdamSync.SyncCreateRoom.createRoomRequset -= OnCreateRoom;
AdamSync.SyncCreateRoom.joinRoomRequset -= OnJoinRoom;
//AdamSync.SyncCreateRoom.joinRoomRequset -= OnJoinRoom;
//AdamSync.SyncCreateRoom.getRoomsRequset += OnGetRooms;
}
private void OnDestory()
{
Debug.Log("OnDestory");
//AdamSync.SyncCreateRoom.createRoomRequset -= OnCreateRoom;
AdamSync.SyncCreateRoom.joinRoomRequset -= OnJoinRoom;
//AdamSync.SyncCreateRoom.joinRoomRequset -= OnJoinRoom;
//AdamSync.SyncCreateRoom.getRoomsRequset -= OnGetRooms;
}
}

View File

@ -24,7 +24,6 @@ public class GameManager : MonoSingleton<GameManager>
public DragController wxdDrag;
public GameObject Teacher;
public GameObject student;
public bool isPlayer = true;
public System.Collections.Generic.List<SyncPlayerTransform> players = new System.Collections.Generic.List<SyncPlayerTransform>();
// Start is called before the first frame update
private void Awake()
@ -47,7 +46,7 @@ public class GameManager : MonoSingleton<GameManager>
spt.gameObject.SetActive(true);
spt.gameObject.transform.position = spawnPos.position;
spt.gameObject.transform.eulerAngles = spawnPos.eulerAngles;
spt.SetPlayerInfo(ulong.Parse(GlobalFlag.currentUser.user_id), GlobalFlag.currentUser.login_name, ulong.Parse(GlobalFlag.roomID), isPlayer);
spt.SetPlayerInfo(ulong.Parse(GlobalFlag.currentUser.user_id), GlobalFlag.currentUser.login_name, ulong.Parse(GlobalFlag.roomID), true);
AddPlayers(spt);
ToolsBootstrap.Instance.SetCameraInfo(spt);
//0 red 1 blue
@ -164,7 +163,7 @@ public class GameManager : MonoSingleton<GameManager>
spt.gameObject.SetActive(true);
spt.gameObject.transform.position = spawnPos.position;
spt.gameObject.transform.eulerAngles = spawnPos.eulerAngles;
spt.SetPlayerInfo(ulong.Parse(data[1]), data[2], ulong.Parse(data[3]), !isPlayer);
spt.SetPlayerInfo(ulong.Parse(data[1]), data[2], ulong.Parse(data[3]), false);
AddPlayers(spt);
}
break;
@ -238,7 +237,7 @@ public class GameManager : MonoSingleton<GameManager>
{
SyncPlayerTransform spt = Instantiate(playerTransformPrefab);
spt.gameObject.SetActive(true);
spt.SetPlayerInfo(ulong.Parse(userInfo[0]), userInfo[1], ulong.Parse(userInfo[2]), !isPlayer);
spt.SetPlayerInfo(ulong.Parse(userInfo[0]), userInfo[1], ulong.Parse(userInfo[2]), false);
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;
AddPlayers(spt);