mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
fix(TopDownShooter): simplify Flashlight code
This commit is contained in:
parent
38a05a0925
commit
136bf579e2
@ -183,15 +183,7 @@ IEnumerator GunShotEffect()
|
||||
[Command]
|
||||
public void CmdFlashLight()
|
||||
{
|
||||
if (flashLightStatus == true)
|
||||
{
|
||||
flashLightStatus = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
flashLightStatus = true;
|
||||
}
|
||||
RpcFlashLight();
|
||||
flashLightStatus = !flashLightStatus;
|
||||
}
|
||||
|
||||
// our sync var hook, which sets flashlight status to the same on all clients for this player
|
||||
@ -199,13 +191,6 @@ void OnFlashLightChanged(bool _Old, bool _New)
|
||||
{
|
||||
#if !UNITY_SERVER
|
||||
flashLight.enabled = _New;
|
||||
#endif
|
||||
}
|
||||
|
||||
[ClientRpc]
|
||||
void RpcFlashLight()
|
||||
{
|
||||
#if !UNITY_SERVER
|
||||
soundFlashLight.Play();
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user