// Token: 0x06004CE3 RID: 19683 RVA: 0x0019BFD6 File Offset: 0x0019A3D6 public void Init(USpeakPlayer owner) { this.m_Owner = owner; USpeakOwnerInfo.USpeakPlayerMap.Add(owner.PlayerID, this); USpeakOwnerInfo.USpeakerMap.Add(this, base.GetComponent <USpeaker>()); UnityEngine.Object.DontDestroyOnLoad(base.gameObject); }
/// <summary> /// Initialize with the given owner /// </summary> public void Init(USpeakPlayer owner) { this.m_Owner = owner; USpeakPlayerMap.Add(owner.PlayerID, this); USpeakerMap.Add(this, GetComponent <USpeaker>()); // we don't need scene loads destroying the game object... it will automatically be handled by players leaving DontDestroyOnLoad(gameObject); }
/// <summary> /// Call this when a new player joins /// </summary> public static void PlayerJoined(string PlayerID) { GameObject uspeaker = (GameObject)Instantiate(Resources.Load("USpeakerPrefab")); USpeakOwnerInfo ownerInfo = uspeaker.AddComponent <USpeakOwnerInfo>(); USpeakPlayer player = new USpeakPlayer(); player.PlayerID = PlayerID; ownerInfo.Init(player); }