Object reference not set to an instance of an object(unity3D,C#) 这个错误通常意味着您正在访问一个空引用对象。在这种情况下, 确保 对象被正确初始化或赋值。您可以在使用 sound 对象之前检查它是否为空引用,例如: if (sound != null) { sound.value = PlayerPrefs.GetFloat(AudioManager.key_sound, -40);}