December 2013
Beginner
242 pages
4h 23m
English
Let's say your game features a friends list, and you want to know if a friend is online or offline, or perhaps even want to join your friend if they are playing in a room. Luckily Photon Cloud recently added easy support for this via the FindFriends feature, which allows you to query the online states of a given list of users, as well the rooms the users are currently in, if any. The following example will locate and display a list of friends as defined in the inspector (in a real use case, these would likely be fetched from a database or some other source):
using UnityEngine; using System.Collections; public class Example_FindFriends : MonoBehaviour { public string[] Friends = new string[ 0 ]; void OnJoinedLobby() { // Set our ...Read now
Unlock full access