Ejemplo n.º 1
0
        /// <summary>
        /// Read the data using the reader.
        /// </summary>
        /// <param name="reader">Reader.</param>
        public override object Read(ISaveGameReader reader)
        {
            UnityEngine.AudioConfiguration audioConfiguration = new UnityEngine.AudioConfiguration();
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "speakerMode":
                    audioConfiguration.speakerMode = reader.ReadProperty <UnityEngine.AudioSpeakerMode> ();
                    break;

                case "dspBufferSize":
                    audioConfiguration.dspBufferSize = reader.ReadProperty <System.Int32> ();
                    break;

                case "sampleRate":
                    audioConfiguration.sampleRate = reader.ReadProperty <System.Int32> ();
                    break;

                case "numRealVoices":
                    audioConfiguration.numRealVoices = reader.ReadProperty <System.Int32> ();
                    break;

                case "numVirtualVoices":
                    audioConfiguration.numVirtualVoices = reader.ReadProperty <System.Int32> ();
                    break;
                }
            }
            return(audioConfiguration);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Write the specified value using the writer.
 /// </summary>
 /// <param name="value">Value.</param>
 /// <param name="writer">Writer.</param>
 public override void Write(object value, ISaveGameWriter writer)
 {
     UnityEngine.AudioConfiguration audioConfiguration = (UnityEngine.AudioConfiguration)value;
     writer.WriteProperty("speakerMode", audioConfiguration.speakerMode);
     writer.WriteProperty("dspBufferSize", audioConfiguration.dspBufferSize);
     writer.WriteProperty("sampleRate", audioConfiguration.sampleRate);
     writer.WriteProperty("numRealVoices", audioConfiguration.numRealVoices);
     writer.WriteProperty("numVirtualVoices", audioConfiguration.numVirtualVoices);
 }
Ejemplo n.º 3
0
        static public void SetDSPBufferSize(int bufferLength, int numBuffers)
        {
            Debug.LogWarning("AudioSettings.SetDSPBufferSize is deprecated and has been replaced by audio project settings and the AudioSettings.GetConfiguration/AudioSettings.Reset API.");
            AudioConfiguration config = GetConfiguration();

            config.dspBufferSize = bufferLength;
            if (!SetConfiguration(config))
            {
                Debug.LogWarning("SetDSPBufferSize failed");
            }
        }
    static bool AudioSettings_Reset__AudioConfiguration(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 1)
        {
            UnityEngine.AudioConfiguration arg0 = (UnityEngine.AudioConfiguration)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
            JSApi.setBooleanS((int)JSApi.SetType.Rval, (System.Boolean)(UnityEngine.AudioSettings.Reset(arg0)));
        }

        return(true);
    }
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.AudioConfiguration o;
			o=new UnityEngine.AudioConfiguration();
			pushValue(l,true);
			pushValue(l,o);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.AudioConfiguration o;
         o = new UnityEngine.AudioConfiguration();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 public static int constructor(IntPtr l)
 {
     try {
         UnityEngine.AudioConfiguration o;
         o=new UnityEngine.AudioConfiguration();
         pushValue(l,o);
         return 1;
     }
     catch(Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return 0;
     }
 }
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.AudioConfiguration o;
         o = new UnityEngine.AudioConfiguration();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
 static void AudioConfiguration_numRealVoices(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.AudioConfiguration _this = (UnityEngine.AudioConfiguration)vc.csObj;
         var result = _this.numRealVoices;
         JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(result));
     }
     else
     {
         System.Int32 arg0 = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
         UnityEngine.AudioConfiguration _this = (UnityEngine.AudioConfiguration)vc.csObj;
         _this.numRealVoices = arg0;
         JSMgr.changeJSObj(vc.jsObjID, _this);
     }
 }
// fields
    static void AudioConfiguration_speakerMode(JSVCall vc)
    {
        if (vc.bGet)
        {
            UnityEngine.AudioConfiguration _this = (UnityEngine.AudioConfiguration)vc.csObj;
            var result = _this.speakerMode;
            JSApi.setEnum((int)JSApi.SetType.Rval, (int)result);
        }
        else
        {
            UnityEngine.AudioSpeakerMode   arg0  = (UnityEngine.AudioSpeakerMode)JSApi.getEnum((int)JSApi.GetType.Arg);
            UnityEngine.AudioConfiguration _this = (UnityEngine.AudioConfiguration)vc.csObj;
            _this.speakerMode = arg0;
            JSMgr.changeJSObj(vc.jsObjID, _this);
        }
    }
 static int _CreateAudioConfiguration(IntPtr L)
 {
     LuaScriptMgr.CheckArgsCount(L, 0);
     AudioConfiguration obj = new AudioConfiguration();
     LuaScriptMgr.PushValue(L, obj);
     return 1;
 }
Ejemplo n.º 12
0
 private static extern bool INTERNAL_CALL_Reset(ref AudioConfiguration config);
Ejemplo n.º 13
0
 public static bool Reset(AudioConfiguration config)
 {
     return(AudioSettings.INTERNAL_CALL_Reset(ref config));
 }
Ejemplo n.º 14
0
 private static extern void INTERNAL_CALL_GetConfiguration(out AudioConfiguration value);
Ejemplo n.º 15
0
 public static bool Reset(AudioConfiguration config)
 {
     return INTERNAL_CALL_Reset(ref config);
 }
Ejemplo n.º 16
0
 private static extern bool SetConfiguration_Injected(ref AudioConfiguration config);
Ejemplo n.º 17
0
    void LoadSettings()
    {
        // Set default values if there are no settings yet
        if (!PlayerPrefs.HasKey("Speaker Config"))
        {
            speakerInit = 0;
        }

        if (!PlayerPrefs.HasKey("Mouse Sensitivity"))
        {
            EventManager.inst.lookSensitivity = 5;
            PlayerPrefs.SetFloat("Mouse Sensitivity", 5);
            lookSensitivity = 5;
        }

        if (!PlayerPrefs.HasKey("Master Volume"))
        {
            EventManager.inst.masterVolume = 0.8f;
            PlayerPrefs.SetFloat("Master Volume", 0.8f);
            volumeLevel = 0.8f;
        }

        if (!PlayerPrefs.HasKey("Fullscreen"))
        {
            fullscreenToggle.isOn = true;
        }

        // Load saved settings
        speakerConfig = AudioSettings.GetConfiguration();
        screenResKey = PlayerPrefs.GetInt("Screen Res");
        speakerKey = PlayerPrefs.GetInt("Speaker Config");
        fullScreenKey = PlayerPrefs.GetInt("Fullscreen");
        invertYKey = PlayerPrefs.GetInt("Invert Toggle");
        volSlider.value = PlayerPrefs.GetFloat("Master Volume");
        sensSlider.value = PlayerPrefs.GetInt("Look Sensitivity");

        Invoke("FullScreenCheck", 0.01f);
    }
Ejemplo n.º 18
0
 private static extern void INTERNAL_CALL_GetConfiguration(out AudioConfiguration value);
Ejemplo n.º 19
0
 /// <summary>
 /// <para>Performs a change of the device configuration. In response to this the AudioSettings.OnAudioConfigurationChanged delegate is invoked with the argument deviceWasChanged=false. It cannot be guaranteed that the exact settings specified can be used, but the an attempt is made to use the closest match supported by the system.</para>
 /// </summary>
 /// <param name="config">The new configuration to be used.</param>
 /// <returns>
 /// <para>True if all settings could be successfully applied.</para>
 /// </returns>
 public static bool Reset(AudioConfiguration config) =>
 INTERNAL_CALL_Reset(ref config);
Ejemplo n.º 20
0
 private static bool SetConfiguration(AudioConfiguration config)
 {
     return(AudioSettings.SetConfiguration_Injected(ref config));
 }
Ejemplo n.º 21
0
 private static extern void GetConfiguration_Injected(out AudioConfiguration ret);
Ejemplo n.º 22
0
 private static extern bool INTERNAL_CALL_Reset(ref AudioConfiguration config);
Ejemplo n.º 23
0
 extern static private bool SetConfiguration(AudioConfiguration config);
Ejemplo n.º 24
0
 public static bool Reset(AudioConfiguration config)
 {
     return(AudioSettings.SetConfiguration(config));
 }
Ejemplo n.º 25
0
 static public bool Reset(AudioConfiguration config)
 {
     return(SetConfiguration(config));
 }
Ejemplo n.º 26
0
 private static bool INTERNAL_CALL_Reset(ref AudioConfiguration config)
 {
     throw new NotImplementedException("なにこれ");
 }