-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented horn sound base functionality #73
base: dev
Are you sure you want to change the base?
Conversation
-added method GetKey (modified copy of GetKeyDown method already present there) in CustomInput to operate continuous key pressing
TODO:
|
@@ -1,6 +1,7 @@ | |||
using UnityEngine; | |||
using SanAndreasUnity.Utilities; | |||
using SanAndreasUnity.Net; | |||
using System; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary using
@@ -191,7 +198,7 @@ void Start() | |||
|
|||
currentRadioStationIndex = Random.Range(0, RadioStation.stations.Length); | |||
|
|||
Debug.LogFormat("Created vehicle - id {0}, name {1}, time: {2}", this.Definition.Id, | |||
Debug.LogFormat("Created vehicle - id {0}, name {1}, time: {2}", this.Definition.Id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't do style changes
rip P/R |
Umm,,mmmmmm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
-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.