private void Update()
        {
            if (!SNet.LocalPlayer.HasPlayerAgent || PlayerChatManager.InChatMode)
            {
                return;
            }
            PlayerAgent playerAgent = SNet.LocalPlayer.PlayerAgent.Cast <PlayerAgent>();

            if (_soundPlayer == null)
            {
                if (_soundPlayerDummy != null)
                {
                    Destroy(_soundPlayerDummy);
                }
                _soundPlayerDummy = new GameObject();
                _soundPlayerDummy.transform.position = playerAgent.Position;
                _soundPlayer = new CellSoundPlayer(playerAgent.Position);
                Log.Info($"Created CSP at Position: [{_soundPlayerDummy.transform.position.x}, {_soundPlayerDummy.transform.position.y}, {_soundPlayerDummy.transform.position.z}]");
                _soundPlayerMarker = GuiManager.NavMarkerLayer.PrepareGenericMarker(_soundPlayerDummy);
                SoundId            = 0;
            }
            if (Input.GetKeyDown(KeyCode.K))
            {
                _soundPlayer.UpdatePosition(playerAgent.Position);
                _soundPlayerDummy.transform.position = playerAgent.Position;
                Log.Info($"Moved CSP to Position: [{_soundPlayerDummy.transform.position.x}, {_soundPlayerDummy.transform.position.y}, {_soundPlayerDummy.transform.position.z}]");
            }
            if (Input.GetKeyDown(KeyCode.L))
            {
                if (_soundPlayer != null)
                {
                    _soundPlayer.Stop();
                }
                else
                {
                    Log.Error($"Attempting to stop sound without a CSP object");
                }
            }
            if (Input.GetKeyDown(KeyCode.P))
            {
                if (_soundPlayer != null)
                {
                    _soundPlayer.Post(SoundId);
                }
                else
                {
                    Log.Error($"Attempting to play sound without a CSP object");
                }
            }
            if (Input.GetKeyDown(KeyCode.Insert))
            {
                _guiEnabled = !_guiEnabled;
                Log.Info($"Toggled GUI to {_guiEnabled}");
            }
        }
Exemplo n.º 2
0
 private void onStateChange(pChainedPuzzleState arg1, int arg2)
 {
     if (arg1.status == eChainedPuzzleStatus.Active && id == arg2)
     {
         DoorSequence();
     }
     if (arg1.status == eChainedPuzzleStatus.Solved && id == arg2)
     {
         Patch_StateChange.TriggerEnd();
         GuiManager.PlayerLayer.m_wardenIntel.ShowSubObjectiveMessage("", "<color=orange><size=200%>PRIORITY WARNING</size></color>\nLarge active bio-mass detected in <color=orange>ZONE_894</color>", false, null);
         try
         {
             foreach (CollectedLight light in lightCollection.collectedLights)
             {
                 light.light.ChangeIntensity(0.8f);
                 light.light.ChangeColor(new Color(1, 1, 1, 1));
             }
         }
         catch { }
         sound.Post(EVENTS.LIGHTS_ON_INTENSITY_1);
     }
 }