Copying and Pasting cs Code

In cs, like in almost any computer programming language, reading data from a file can be tricky. You add extra lines of code to tell the computer what to do. Sometimes you can copy and paste these lines from other peoples’ code.

For example, you can follow the pattern in this listing:

     void Start()
     {
         // If a user should be "findable", the client must set a playerName before connecting.
         // This is then used during connect and the client can be found by others.
         // Setting the playerName before connect, enables others to locate your game:
         PhotonNetwork.playerName = "usr" + (int)Random.Range(0, 9);


         // Photon Cloud does not implement community features for users but can work with external friends lists.
         // We assume you get some list of IDs of your friends.
         friendListOfSomeCommunity = FetchFriendsFromCommunity();


         GuiRect = new Rect(Screen.width / 4, 80, Screen.width / 2, Screen.height - 100);
     }