Creating a chat client
We're going to put what we've learned about Photon to use, creating a chat client from scratch. Players can choose from a list of running chatrooms, create a new chatroom, or join a random chatroom (if there are none available, one is created). While in a chatroom, players can chat with everybody in the chatroom. From the main menu, players can also manage a list of "friends" (they can add and remove names). They can see the online states of each friend, as well as join friends if they are in a room.
The Connect screen
The first screen the user is presented with is the Connect screen.
Here, they enter their username and connect to Photon. It will automatically remember the last username they entered, since they are likely to want to use it again.
This script accomplishes the Connect screen. This goes on an empty game object. After the user connects, it will disable itself and activate the lobby screen on another game object:
using UnityEngine; using System.Collections;...