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

radio #69

Closed jaan242 closed 4 years ago

jaan242 commented 4 years ago

Implemented playing radio stations in vehicles. Sounds are played in the order they are stored in files. Only driver ped can change station using the same buttons which are used for switching weapons (E and Q on a PC, arrows at bottom of screen when using touch input). Selected radio station is not currently synced between players.

in0finite commented 4 years ago
jaan242 commented 4 years ago

Driver has different touch input, so no changes there, but improved other things.

in0finite commented 4 years ago

So, GameManager.prefab can be reverted now ?

jaan242 commented 4 years ago

Reverted GameManager.prefab Added not null check to Ped.Instance Radio station and time randomized in Vehicle.Start

in0finite commented 4 years ago

Let me tell you how I imagined radio station times. Each vehicle has it's own active station. But, stations in all vehicles have the same current time (song and song's time). So, if ped changes vehicles, and plays the same station, he should hear the same song.

With your setup, each vehicle has it's own current time for station. Plus, all stations have the same current position. It should not be like this. It should mimic the real world.

jaan242 commented 4 years ago

Radio station playback position is kept across vehicles and station switches.

in0finite commented 4 years ago

Ok. Will test this tomorrow.