Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
UISlider.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4using UnityEngine.UI;
5
6public class UISlider : Slider
7{
9
11
13
15
16 public void SetList<TValue>(TValue index, IList<TValue> list, Action<int, TValue> onChange, Func<TValue, string> getInfo = null)
17 {
18 SetList(list.IndexOf(index), list, onChange, getInfo);
19 }
20
21 public void SetList<TValue>(int index, IList<TValue> list, Action<int, TValue> onChange, Func<TValue, string> getInfo = null)
22 {
23 base.minValue = 0f;
24 base.maxValue = list.Count - 1;
25 index = Mathf.Clamp(index, 0, list.Count - 1);
26 base.onValueChanged.RemoveAllListeners();
27 base.onValueChanged.AddListener(delegate(float a)
28 {
29 int num = Mathf.Clamp((int)a, 0, list.Count - 1);
30 onChange(num, list[num]);
31 if (getInfo != null)
32 {
33 textInfo.text = getInfo(list[num]);
34 }
35 });
36 if (getInfo != null)
37 {
38 textInfo.text = getInfo(list[index]);
39 }
40 value = index;
41 }
42
43 public void Prev()
44 {
45 value--;
46 }
47
48 public void Next()
49 {
50 value++;
51 }
52}
UIText textMain
Definition: UISlider.cs:8
void Prev()
Definition: UISlider.cs:43
UIButton buttonNext
Definition: UISlider.cs:12
UIText textInfo
Definition: UISlider.cs:10
void Next()
Definition: UISlider.cs:48
UIButton buttonPrev
Definition: UISlider.cs:14
void SetList< TValue >(TValue index, IList< TValue > list, Action< int, TValue > onChange, Func< TValue, string > getInfo=null)
Definition: UISlider.cs:16
Definition: UIText.cs:6