static void WriteBackInstance(CSHotFix.Runtime.Enviorment.AppDomain __domain, StackObject *ptr_of_this_method, IList <object> __mStack, ref UnityEngine.AudioConfiguration instance_of_this_method)
        {
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            switch (ptr_of_this_method->ObjectType)
            {
            case ObjectTypes.Object:
            {
                __mStack[ptr_of_this_method->Value] = instance_of_this_method;
            }
            break;

            case ObjectTypes.FieldReference:
            {
                var ___obj = __mStack[ptr_of_this_method->Value];
                if (___obj is ILTypeInstance)
                {
                    ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method;
                }
                else
                {
                    var t = __domain.GetType(___obj.GetType()) as CLRType;
                    t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method);
                }
            }
            break;

            case ObjectTypes.StaticFieldReference:
            {
                var t = __domain.GetType(ptr_of_this_method->Value);
                if (t is ILType)
                {
                    ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method;
                }
                else
                {
                    ((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method);
                }
            }
            break;

            case ObjectTypes.ArrayReference:
            {
                var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as UnityEngine.AudioConfiguration[];
                instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method;
            }
            break;
            }
        }
Exemple #2
0
        static StackObject *Reset_8(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.AudioConfiguration config = (UnityEngine.AudioConfiguration) typeof(UnityEngine.AudioConfiguration).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = UnityEngine.AudioSettings.Reset(config);

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method ? 1 : 0;
            return(__ret + 1);
        }
Exemple #3
0
        static int _m_GetConfiguration_xlua_st_(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



            try {
                {
                    UnityEngine.AudioConfiguration __cl_gen_ret = UnityEngine.AudioSettings.GetConfiguration(  );
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
 static void set_numVirtualVoices_4(ref object o, object v)
 {
     UnityEngine.AudioConfiguration _o = (UnityEngine.AudioConfiguration)o;
     _o.numVirtualVoices = (System.Int32)v;
 }
 static void set_sampleRate_2(ref object o, object v)
 {
     UnityEngine.AudioConfiguration _o = (UnityEngine.AudioConfiguration)o;
     _o.sampleRate = (System.Int32)v;
 }
 static void set_dspBufferSize_1(ref object o, object v)
 {
     UnityEngine.AudioConfiguration _o = (UnityEngine.AudioConfiguration)o;
     _o.dspBufferSize = (System.Int32)v;
 }
 static void set_speakerMode_0(ref object o, object v)
 {
     UnityEngine.AudioConfiguration _o = (UnityEngine.AudioConfiguration)o;
     _o.speakerMode = (UnityEngine.AudioSpeakerMode)v;
 }
Exemple #8
0
        public static void WriteUnitySpecs(Log log)
        {
            try
            {
                log.Write(
                    "Unity Application paths:" + Environment.NewLine +
                    "  Persistent data:  {0}" + Environment.NewLine +
                    "  Application Data: {1}" + Environment.NewLine +
                    "  Temp data:        {2}" + Environment.NewLine +
                    "  Streaming Assets: {3}",
                    UnityEngine.Application.persistentDataPath,
                    UnityEngine.Application.dataPath,
                    UnityEngine.Application.temporaryCachePath,
                    UnityEngine.Application.streamingAssetsPath);

                log.Write(
                    "Unity Screen info:" + Environment.NewLine +
                    "  Output size:        {0}x{1}" + Environment.NewLine +
                    "  Fullscreen:         {2}" + Environment.NewLine +
                    "  Screen Resolution:  {3}" + Environment.NewLine +
                    "  Screen Orientation: {4}" + Environment.NewLine +
                    "  Screen DPI:         {5}",
                    UnityEngine.Screen.width,
                    UnityEngine.Screen.height,
                    UnityEngine.Screen.fullScreen,
                    UnityEngine.Screen.currentResolution,
                    UnityEngine.Screen.orientation,
                    UnityEngine.Screen.dpi);

                log.Write("Unity Display info:");
                log.PushIndent();
                for (int i = 0; i < UnityEngine.Display.displays.Length; i++)
                {
                    UnityEngine.Display display = UnityEngine.Display.displays[i];
                    log.Write(
                        "Display #{0} {1}" + Environment.NewLine +
                        "  Native size:    {2}x{3}" + Environment.NewLine +
                        "  Rendering size: {4}x{5}",
                        i,
                        display == UnityEngine.Display.main ? "(main)" : "",
                        display.systemWidth,
                        display.systemHeight,
                        display.renderingWidth,
                        display.renderingHeight);
                }
                log.PopIndent();

                UnityEngine.AudioConfiguration audioConfig = UnityEngine.AudioSettings.GetConfiguration();
                log.Write(
                    "Unity Audio Device info:" + Environment.NewLine +
                    "  Driver Caps:        {0}" + Environment.NewLine +
                    "  Speaker Mode:       {1}" + Environment.NewLine +
                    "  Output Sample Rate: {2}" + Environment.NewLine +
                    "  DSP Buffer Size:    {3}" + Environment.NewLine +
                    "  # Real Voices:      {4}" + Environment.NewLine +
                    "  # Virtual  Voices:  {5}",
                    UnityEngine.AudioSettings.driverCapabilities,
                    UnityEngine.AudioSettings.speakerMode,
                    UnityEngine.AudioSettings.outputSampleRate,
                    audioConfig.dspBufferSize,
                    audioConfig.numRealVoices,
                    audioConfig.numVirtualVoices);
            }
            catch (Exception e)
            {
                log.WriteWarning("Error logging Unity specs: {0}", LogFormat.Exception(e));
            }
        }