Example #1
0
 private void OnDestroy()
 {
     if (object.ReferenceEquals(CoopVoice.LocalVoice, this))
     {
         CoopVoice.LocalVoice = null;
     }
 }
Example #2
0
 private void Awake()
 {
     if (!BoltNetwork.isRunning)
     {
         base.enabled = false;
     }
     else if (this.IsLocal)
     {
         CoopVoice.LocalVoice = this;
         base.enabled         = true;
     }
 }
Example #3
0
 private void Awake()
 {
     if (!BoltNetwork.isRunning)
     {
         base.enabled = false;
     }
     else if (this.IsLocal)
     {
         CoopVoice.LocalVoice = this;
         base.enabled = true;
     }
 }
Example #4
0
    public override void StreamDataReceived(BoltConnection connection, UdpStreamData data)
    {
        int        o          = 0;
        BoltEntity boltEntity = BoltNetwork.FindEntity(new NetworkId(Blit.ReadU64(data.Data, ref o)));

        if (boltEntity.IsAttached())
        {
            CoopVoice component = boltEntity.GetComponent <CoopVoice>();
            if (component)
            {
                component.ReceiveVoiceData(data.Data, o);
            }
        }
    }
Example #5
0
        private IEnumerator OldSaveCompat()
        {
            if (!CoopPeerStarter.DedicatedHost && LocalPlayer.Inventory)
            {
                yield return(null);

                yield return(null);

                if (LocalPlayer.PassengerManifest)
                {
                    if (!LocalPlayer.PassengerManifest.gameObject.activeSelf)
                    {
                        LocalPlayer.PassengerManifest.gameObject.SetActive(true);
                    }
                    if (GameSetup.IsSavedGame)
                    {
                        LocalPlayer.PassengerManifest.SendMessage("OnDeserialized");
                    }
                }
                if (!LocalPlayer.GameObject.GetComponent <targetStats>())
                {
                    targetStats targetStats = LocalPlayer.GameObject.AddComponent <targetStats>();
                    targetStats.setPlayerType = true;
                }
                if (!LocalPlayer.GameObject.GetComponent <visRangeSetup>())
                {
                    visRangeSetup visRangeSetup = LocalPlayer.GameObject.AddComponent <visRangeSetup>();
                    visRangeSetup.host         = true;
                    visRangeSetup.testDist     = 32f;
                    visRangeSetup.offsetFactor = 1.05f;
                    this._vis       = visRangeSetup;
                    LocalPlayer.Vis = visRangeSetup;
                }
                while (!LocalPlayer.Inventory.enabled)
                {
                    yield return(null);
                }
                if (!LocalPlayer.GameObject.GetComponent <CoopVoice>())
                {
                    CoopVoice coopVoice = LocalPlayer.GameObject.AddComponent <CoopVoice>();
                    int       id        = ItemDatabase.ItemByName("WalkyTalky")._id;
                    coopVoice.WalkieTalkie = LocalPlayer.Inventory.InventoryItemViewsCache[id][0]._held.GetComponent <BatteryBasedTalkyWalky>();
                }
            }
            yield break;
        }
Example #6
0
 private void OnDestroy()
 {
     if (object.ReferenceEquals(CoopVoice.LocalVoice, this))
     {
         CoopVoice.LocalVoice = null;
     }
 }