示例#1
0
 static public int SetValueWithoutNotify(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         UnityEngine.UI.Slider self = (UnityEngine.UI.Slider)checkSelf(l);
         System.Single         a1;
         checkType(l, 2, out a1);
         self.SetValueWithoutNotify(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
示例#2
0
    void Update()
    {
        if (isDragged)
        {
            isDragged = false;
            return;
        }

        int   targ = GetTarget();
        float pos  = GetTargetRelativePosition(targ);

        if (pos == slider.normalizedValue)
        {
            v         = 0f;
            next_slot = -1;
            if (last_active_slot != targ)
            {
                last_active_slot = targ;
                if (FieldActions.Count > targ)
                {
                    FieldActions[targ].Invoke();
                }
            }
            return;
        }

        v += feather_k * (pos - slider.normalizedValue);
        slider.SetValueWithoutNotify(slider.maxValue * (slider.normalizedValue += v * Time.deltaTime));

        last_pos = slider.normalizedValue;
    }
示例#3
0
 private void SetHeightForActiveObject(float value)
 {
     activeObject.Adjustment       = value;
     jsonDataForCurrentObject.text = WriteObjectToJson(activeObject);
     heightSlider.SetValueWithoutNotify(value);
     heightInputText.text = value.ToString();
     defaultHeight        = value;
 }
示例#4
0
 private void SetRadiusForActiveObject(int value)
 {
     activeObject.Radius           = value;
     jsonDataForCurrentObject.text = WriteObjectToJson(activeObject);
     radiusSlider.SetValueWithoutNotify(value);
     radiusInputText.text = value.ToString();
     defaultRadius        = value;
 }
示例#5
0
    private void Start()
    {
        float music = PlayerPrefs.GetFloat("volume", -10);

        Slider musicSlider = GameObject.Find("MusiqueSlider").GetComponent <Slider>();

        musicSlider.SetValueWithoutNotify(music);

        AdjustMusicVolume(music);
    }
示例#6
0
 static int SetValueWithoutNotify(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UnityEngine.UI.Slider obj = (UnityEngine.UI.Slider)ToLua.CheckObject <UnityEngine.UI.Slider>(L, 1);
         float arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
         obj.SetValueWithoutNotify(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#7
0
 public void changeSfxVolumeWidgetValue(float value)
 {
     sfxSlider.SetValueWithoutNotify(value);
 }
示例#8
0
 public void changeMusicVolumeWidgetValue(float value)
 {
     musicSlider.SetValueWithoutNotify(value);
 }