Esempio n. 1
0
    public void createRoomFromInput()
    {
        SessionInfo sessionInfo = SessionInfo.GetInstance();

        if (sessionInfo.IsGuest())
        {
            LobbyErrorText.SetErrorCode(SessionInfo.GUESTCREATE);
            return;
        }
        if (sessionInfo.CanPlayGame())
        {
            string roomName  = roomNameInput.text;
            int    maxPlayer = 0;
            if (Int32.TryParse(maxPlayerInput.text, out maxPlayer))
            {
                Debug.Log("Max player input is " + maxPlayer);
                PhotonNetwork.CreateRoom(roomName, new RoomOptions()
                {
                    MaxPlayers = (byte)maxPlayer
                }, TypedLobby.Default);
            }
            else
            {
                LobbyErrorText.SetErrorCode(SessionInfo.MAXNOTINT);
            }
        }
        else
        {
            LobbyErrorText.SetErrorCode(SessionInfo.NOTOKENS);
        }
    }
Esempio n. 2
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
     text      = errorText.GetComponent <Text> ();
     text.text = "";
 }
Esempio n. 3
0
    public void ImportXML()
    {
        RemoveAll();
        XDocument xDocument = new XDocument();

        if (importString != "")
        {
            try {
                xDocument = XDocument.Parse(importString);
                List <string> strings = (from str in xDocument.Descendants("todo") select str.Value).ToList();
                toDos = new List <ToDoToggle> ();
                foreach (string str in strings)
                {
                    AddItem(str);
                }
            } catch (XmlException e) {
                LobbyErrorText.SetErrorCode(SessionInfo.BADXMLCODE);
            }
        }
    }