コード例 #1
0
        /// <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);
        }
コード例 #2
0
ファイル: VRDFPlayerManager.cs プロジェクト: ly774508966/VRDF
 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);
 }