mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-04 02:47:22 +00:00
add flashlight sounds
This commit is contained in:
parent
fdf88e0cb3
commit
6ee84bce7a
@ -37,6 +37,12 @@ namespace QSB.Audio
|
||||
public void PlayUnequipTool()
|
||||
=> _oneShotExternalSource.PlayOneShot(AudioType.ToolTranslatorUnequip, 1f);
|
||||
|
||||
public void PlayTurnOnFlashlight()
|
||||
=> _oneShotExternalSource.PlayOneShot(AudioType.ToolFlashlightOn, 1f);
|
||||
|
||||
public void PlayTurnOffFlashlight()
|
||||
=> _oneShotExternalSource.PlayOneShot(AudioType.ToolFlashlightOff, 1f);
|
||||
|
||||
private OWAudioSource CreateBaseAudio(
|
||||
string name,
|
||||
bool loop,
|
||||
|
@ -15,7 +15,9 @@ namespace QSB.Tools.FlashlightTool
|
||||
var oldComponent = flashlightRoot.GetComponent<Flashlight>();
|
||||
var component = flashlightRoot.AddComponent<QSBFlashlight>();
|
||||
|
||||
component.Player = player;
|
||||
component.Init(oldComponent);
|
||||
|
||||
oldComponent.enabled = false;
|
||||
|
||||
flashlightRoot.transform.parent = player.CameraBody.transform;
|
||||
|
@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using QSB.Player;
|
||||
using UnityEngine;
|
||||
|
||||
namespace QSB.Tools.FlashlightTool
|
||||
{
|
||||
@ -14,6 +15,7 @@ namespace QSB.Tools.FlashlightTool
|
||||
private LightSourceVolume _lightSourceVolume;
|
||||
|
||||
public bool FlashlightOn;
|
||||
public PlayerInfo Player;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
@ -73,6 +75,7 @@ namespace QSB.Tools.FlashlightTool
|
||||
}
|
||||
|
||||
FlashlightOn = true;
|
||||
Player.AudioController.PlayTurnOnFlashlight();
|
||||
var rotation = _root.rotation;
|
||||
_basePivot.rotation = rotation;
|
||||
_baseRotation = rotation;
|
||||
@ -93,6 +96,7 @@ namespace QSB.Tools.FlashlightTool
|
||||
}
|
||||
|
||||
FlashlightOn = false;
|
||||
Player.AudioController.PlayTurnOffFlashlight();
|
||||
_lightSourceVolume.SetVolumeActivation(FlashlightOn);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user