예제 #1
0
        /// <summary>
        /// Set the RTPC and PlayerPrefs value for the volume when the value on a slider has changed
        /// </summary>
        /// <param name="newValue">The new value for the RTPC</param>
        public void SetVolumeFromValue(float newValue)
        {
            float realVolume = Mathf.Clamp01(newValue);

            Debug.Log(volumeRTPC + " set to " + realVolume);
            volumeSlider.SetValueWithoutNotify(realVolume * volumeSlider.maxValue);
            PlayerPrefs.SetFloat(volumeRTPC, realVolume);
            AkSoundEngine.SetRTPCValue(volumeRTPC, realVolume);
        }
예제 #2
0
        static StackObject *SetValueWithoutNotify_14(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, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Single @input = *(float *)&ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.UI.Slider instance_of_this_method = (UnityEngine.UI.Slider) typeof(UnityEngine.UI.Slider).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.SetValueWithoutNotify(@input);

            return(__ret);
        }
        int UnityEngineUISlider_m_SetValueWithoutNotify(RealStatePtr L, int gen_param_count)
        {
            ObjectTranslator translator = this;


            UnityEngine.UI.Slider gen_to_be_invoked = (UnityEngine.UI.Slider)translator.FastGetCSObj(L, 1);


            {
                float _input = (float)LuaAPI.lua_tonumber(L, 2);

                gen_to_be_invoked.SetValueWithoutNotify(_input);



                return(0);
            }
        }
예제 #4
0
        // Start is called before the first frame update
        public void Awake()
        {
            Value.OnValueChangedHandler += (x) =>
            {
                Debug.Log("field " + x);
                slider.SetValueWithoutNotify(x);
                inputField.SetTextWithoutNotify(x.ToString());
            };

            inputField.onValueChanged.AddListener(
                (x) => Value.Value = int.TryParse(inputField.text, out int integer) ? integer : Value.Value);

            slider.onValueChanged.AddListener(
                (x) =>
            {
                Value.Value = (int)slider.value;
            }
                );
        }
        static int _m_SetValueWithoutNotify(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                UnityEngine.UI.Slider gen_to_be_invoked = (UnityEngine.UI.Slider)translator.FastGetCSObj(L, 1);



                {
                    float _input = (float)LuaAPI.lua_tonumber(L, 2);

                    gen_to_be_invoked.SetValueWithoutNotify(_input);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }