Something wierd going on.. help please.
Posted: Thu Aug 29, 2019 7:13 pm
Okay, so something wierd is happening with the public float variables for sound volume of footsteps & riding that I cannot figure out. I'm trying to reduce the volume of the horse sounds since they're so much louder than everything else. When I did the TransportManager I copied the sound volume bit from PlayerFootsteps including a public class variable for the sound volume that is then multiplied by the global volume set by the player.
Footsteps volume is set to 0.7f in the class, but is 0.45 when I run DFU in Unity editor. Riding volume is set to 1.0f in the class and same when I run the editor, regardless of what value I put in the class.
Now I know that public vars are changable in the Unity inspector and that these values persist across sessions. But that's for gameobjects and components, which neither of these manager classes are. They're lazy initialised by GameManager and stored in there as singletons, and while GameManager is a MonoBehaviour and shows up in the inspector, these classes don't since they're not added as components. Still I have no other explanation for the behaviour I see other than Unity is setting the values. I have searched for the value 0.45 in all the files, scenes / prefabs etc and nothing.
Also if I change the variable to private everything works just as I would expect. (can't do that since it would break tedious travel mod)
Help please.
Footsteps volume is set to 0.7f in the class, but is 0.45 when I run DFU in Unity editor. Riding volume is set to 1.0f in the class and same when I run the editor, regardless of what value I put in the class.
Now I know that public vars are changable in the Unity inspector and that these values persist across sessions. But that's for gameobjects and components, which neither of these manager classes are. They're lazy initialised by GameManager and stored in there as singletons, and while GameManager is a MonoBehaviour and shows up in the inspector, these classes don't since they're not added as components. Still I have no other explanation for the behaviour I see other than Unity is setting the values. I have searched for the value 0.45 in all the files, scenes / prefabs etc and nothing.
Also if I change the variable to private everything works just as I would expect. (can't do that since it would break tedious travel mod)
Help please.