Beispiel #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
 }
Beispiel #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;
    }
Beispiel #3
0
 private void SetHeightForActiveObject(float value)
 {
     activeObject.Adjustment       = value;
     jsonDataForCurrentObject.text = WriteObjectToJson(activeObject);
     heightSlider.SetValueWithoutNotify(value);
     heightInputText.text = value.ToString();
     defaultHeight        = value;
 }
Beispiel #4
0
 private void SetRadiusForActiveObject(int value)
 {
     activeObject.Radius           = value;
     jsonDataForCurrentObject.text = WriteObjectToJson(activeObject);
     radiusSlider.SetValueWithoutNotify(value);
     radiusInputText.text = value.ToString();
     defaultRadius        = value;
 }
Beispiel #5
0
    private void Start()
    {
        float music = PlayerPrefs.GetFloat("volume", -10);

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

        musicSlider.SetValueWithoutNotify(music);

        AdjustMusicVolume(music);
    }
Beispiel #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));
     }
 }
Beispiel #7
0
 public void changeSfxVolumeWidgetValue(float value)
 {
     sfxSlider.SetValueWithoutNotify(value);
 }
Beispiel #8
0
 public void changeMusicVolumeWidgetValue(float value)
 {
     musicSlider.SetValueWithoutNotify(value);
 }