Encountered invalid entry while reading serialization data for Unity object of type 'SoundGameManager'.
Issue #444
resolved
Unity 2018.3
Data dump:
Reader type: SerializationNodeDataReader
Nodes dump:
- Name:
Entry: Invalid
Data:
- Name:
Entry: Invalid
Data:
Comments (5)
-
-
reporter I use Unity 2018.3
this is problem script
using EazyTools.SoundManager; using Sirenix.OdinInspector; using System.Collections; using System.Collections.Generic; using UnityEngine; public class SoundGameManager : SerializedMonoBehaviour { public static SoundGameManager ins; public Dictionary<string, AudioData> bgm; public Dictionary<string, AudioData> sfx; private void Awake() { ins = this; } public void PlayBGM(string soundName) { AudioData audioData = bgm[soundName]; if (audioData.audio != null && audioData.audio.paused) { print("resume BGM"); audioData.audio.Resume(); } else { int audioID = SoundManager.PlayMusic(audioData.audioClip, audioData.volume, true, false); bgm[soundName].audio = SoundManager.GetAudio(audioID); } } public void PlaySFX(string soundName) { AudioData audioData = sfx[soundName]; SoundManager.PlaySound(audioData.audioClip, audioData.volume); } public void PauseBGM(string soundName) { AudioData audioData = bgm[soundName]; if (audioData.audio != null && audioData.audio.playing) audioData.audio.Pause(); } } [System.Serializable] public class AudioData { [HideInInspector] public Audio audio; public AudioClip audioClip; [Range(0f, 1f)] public float volume = 1; }
It cannot serialize AudioData class.
-
reporter the result
-
-
assigned issue to
-
assigned issue to
-
- changed status to resolved
I recently came back to this, and have been unable to replicate the issue. Since no clear reproduction steps were given, and the code sample doesn't in fact compile when copy pasted into a project, I'm not sure what else I can do about this. The modifications I had to make to the code to get it to compile might have made a difference. If you ever get more information about the issue, or figure out the proper reproduction steps to give us, please don't hesitate to reopen the issue at that time :)
- Log in to comment
Please provide us with as much as possible of the following information:
When attaching ZIP files then please remember to remove Odin from the archive.