in0finite / SanAndreasUnity

Open source reimplementation of GTA San Andreas game engine in Unity
https://discord.gg/p6jjud5
MIT License
2.13k stars 352 forks source link

Implemented horn sound base functionality #73

Open AdamLacko opened 4 years ago

AdamLacko commented 4 years ago

-Added GetKey method (modified copy of GetKeyDown method already present there) in CustomInput to operate continuous key pressing

-Looping of the horn sound is still not perfect yet. As we discussed before, problem is apparently in the original horn sounds SA engine was most probably modifying at runtime to better blend.

-I do have concerns about the method MakeSubclip() that is used to create loop-able sample for AudioSource, as it hasn't been tested for leaks yet. There are probably none, but it's a good practice to test it anyways. So should be tested horn AudioSource, since it has to be created additionally (due to new radio implementation which already uses one AudioSource), to prevent more of these components being created on, say, scene loads or whenever Awake is additionally called (but I reckon such scenario is not very common in game like this? I'm thinking this further as I work with RPGs where such scenario is quite common). I'll do all this in future commints.

-There is a doppler effect on horn sound. It sounds good in environment, although the effect is also laudable for the player inside car as well. This can be prevented pretty easily though, I'll implement that in next commit.

in0finite commented 4 years ago

TODO:

Bluscream commented 3 years ago

rip P/R

TheBatter32 commented 2 years ago

Umm,,mmmmmm