russo
New Member
Posts: 8
Posts: 8
|
Post by russo on Dec 9, 2015 20:03:53 GMT
I'm having a weird error and maybe it's not related to my code. It doesn't happens all the times.. Output log: hastebin.com/idiruzolek.avrasmMicroUIWindowOptionsAction.cspublic void VolumeChanged()
{
Toolbox.Instance.VolumeSFX = SoundVolumeScrollbar.value;
Toolbox.Instance.VolumeMusic = MusicVolumeScrollbar.value;
PlayerPrefs.SetFloat("SoundVolume", SoundVolumeScrollbar.value);
PlayerPrefs.SetFloat("MusicVolume", MusicVolumeScrollbar.value);
if (VolumeListener != null)
VolumeListener.VolumeChanged();
else
VolumeListener = FindObjectOfType<VolumeListener>();
} VolumeListener.csusing UnityEngine;
using DarkTonic.MasterAudio;
public class VolumeListener : MonoBehaviour
{
internal MasterAudio MasterAudio;
void Awake()
{
MasterAudio = GetComponent<MasterAudio>();
}
public void VolumeChanged()
{
if (!MasterAudio.SoundsReady) return;
MasterAudio.PlaylistMasterVolume = Toolbox.Instance.VolumeMusic;
MasterAudio.MasterVolumeLevel = Toolbox.Instance.VolumeSFX;
}
}
I can't replicate this scenario too. It's happening with a tester.. Also, please note that on VolumeListener I'm getting the MasterAudio component without need it. I'm giving you the exact code of the version that is throwing the error
|
|
|
Post by DarkTonic Dev on Dec 10, 2015 0:07:12 GMT
You're going to need to send me a sample project that reproduces the error. Please see the stickied post on bug reporting at top of this forum. I don't know when said code fires and lots of other things.
|
|
russo
New Member
Posts: 8
Posts: 8
|
Post by russo on Dec 10, 2015 12:22:38 GMT
You're going to need to send me a sample project that reproduces the error. Please see the stickied post on bug reporting at top of this forum. I don't know when said code fires and lots of other things. Sure, Will try to rip the project. Meanwhile, I could reproduce 100% of time. Items to be considered: 1) It doesnt happens on editor, only on standalone versions. 2) With a little debug, I found out that when changing volume, somewhere it force-calls Awake() On PlaylistController and: 2.1) Inside Awake(), useGUILayout is NULL(!?), throwing the null exception error. 2.2) If I comment the useGUILayout, the next error happens on line 168, returning ZERO components. Then I give up var audios = GetComponents<AudioSource>(); PS: The above scenario happens only on standalone AND when I change scenes. For example: I start the game and at the mainscreen there is an options dialog with scrollbar, change volume, no errors. Go to next scene, Back to mainscreen, open dialog, change volume, Error.
|
|
|
Post by DarkTonic Dev on Dec 10, 2015 16:23:48 GMT
That's very strange. I'm not sure where the error would be. Are you on the very latest version of Master Audio?
|
|