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); } }
//On start up void Awake() { animator = transform.Find("Sprite").GetComponent <Animator> (); rb2d = GetComponent <Rigidbody2D> (); shotSpawn = GetComponentInChildren <ShotSpawn> (); shotSpawn.player = gameObject; isoSorting = transform.Find("Sprite").GetComponent <IsoDynamicObject> (); sprite = transform.Find("Sprite").GetComponent <SpriteRenderer> (); playerName = SessionInfo.GetInstance().GetSessionOwner(); attackTrigger.enabled = false; }
public void Toggle() { if (toggle.isOn) { SessionInfo.GetInstance().IncTokenNumber(); } else { toDoList.RemoveToDo(this); } //print (toDoList.Size ()); }
void Start() { sessionInfo = SessionInfo.GetInstance(); }
public override void OnJoinedLobby() { Debug.Log("Joined Lobby"); Invoke("refreshRooms", 0.1f); PhotonNetwork.player.NickName = SessionInfo.GetInstance().GetSessionOwner(); }
public void startGame() { // PhotonNetwork.LoadLevel ("Main"); SessionInfo.GetInstance().DecTokenNumber(); SceneManager.LoadSceneAsync("Tutorial", LoadSceneMode.Single); }
void Start() { sessionInfo = SessionInfo.GetInstance(); text.text = preText + sessionInfo.GetSessionOwner() + postText; }