70 lines
1.8 KiB
C#
70 lines
1.8 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
using UnityEngine.UI;
|
|
namespace AdamSync
|
|
{
|
|
public class RoomInstructController : MonoBehaviour
|
|
{
|
|
public Text roomID;
|
|
public Text roomName;
|
|
public Text missionModelInfo;
|
|
public Text thinkDataInfo;
|
|
public Text users;
|
|
public Button startGameBtn;
|
|
public Button cancelGameBtn;
|
|
public List<string> usersID = new List<string>();
|
|
public GameObject roomView;
|
|
private void Start()
|
|
{
|
|
SyncCreateRoom.getusersRequset += OnGetAllUsers;
|
|
SyncCreateRoom.send2userRequset += OnJionsRequset;
|
|
startGameBtn.onClick.AddListener(OnStartGame);
|
|
cancelGameBtn.onClick.AddListener(OnCancelGame);
|
|
}
|
|
|
|
private void OnJionsRequset(string obj)
|
|
{
|
|
if (obj.Equals("joins"))
|
|
{
|
|
|
|
}
|
|
}
|
|
|
|
private void OnCancelGame()
|
|
{
|
|
users.text = "";
|
|
}
|
|
|
|
|
|
|
|
private void OnGetAllUsers(string obj)
|
|
{
|
|
Debug.Log("OnGetAllUsers=" + obj);
|
|
}
|
|
|
|
public void OnStartGame()
|
|
{
|
|
string msg = "joins " + roomID.text;
|
|
_ = SyncCreateRoom.SendMessageAsync(msg);
|
|
}
|
|
|
|
|
|
|
|
public void SetRoomViewInfo(int _ID, string _name, string _thinkDataInfo, string _missionModelInfo)
|
|
{
|
|
string msg = "getusers ";
|
|
_ = SyncCreateRoom.SendMessageAsync(msg);
|
|
roomView.SetActive(true);
|
|
roomID.text = _ID.ToString();
|
|
roomName.text = _name;
|
|
missionModelInfo.text = _missionModelInfo;
|
|
thinkDataInfo.text = _thinkDataInfo;
|
|
}
|
|
|
|
}
|
|
}
|