/// <summary> /// Find a Player in the PlayersInstances list /// </summary> /// <param name="playerID">The id of the player to look for</param> /// <returns>The player if it was found</returns> public static bool FindVRDFPlayer(string playerID, out VRDFPlayer VRDFPlayer, bool showErrorLog = true) { foreach (var player in PlayersInstances) { if (string.Equals(player.PhotonPlayer.UserId, playerID)) { VRDFPlayer = player; return(true); } } if (showErrorLog) { Debug.LogErrorFormat("<b>[VRDF] :</b> Couldn't find player with userID {0}.", playerID); } VRDFPlayer = null; return(false); }
protected virtual void Awake() { // we flag as don't destroy on load so that instance survives level synchronization, thus giving a seamless experience when levels load. DontDestroyOnLoad(gameObject); ThisPlayer = new VRDFPlayer(gameObject); }