| | 1 | | using DCL.Components; |
| | 2 | | using System; |
| | 3 | | using System.Collections; |
| | 4 | | using System.Collections.Generic; |
| | 5 | | using TMPro; |
| | 6 | | using UnityEngine; |
| | 7 | |
|
| | 8 | | public class SmartItemIntegerParameter : SmartItemUIParameterAdapter |
| | 9 | | { |
| | 10 | | public TMP_InputField textParameterInputField; |
| | 11 | |
|
| 0 | 12 | | private void Start() { textParameterInputField.onEndEdit.AddListener(OnValueChange); } |
| | 13 | |
|
| | 14 | | public override void SetInfo() |
| | 15 | | { |
| 0 | 16 | | base.SetInfo(); |
| | 17 | |
|
| 0 | 18 | | textParameterInputField.gameObject.SetActive(true); |
| | 19 | |
|
| 0 | 20 | | textParameterInputField.contentType = TMP_InputField.ContentType.IntegerNumber; |
| 0 | 21 | | textParameterInputField.text = GetParameterValue().ToString(); |
| 0 | 22 | | } |
| | 23 | |
|
| 0 | 24 | | public void OnValueChange(string text) { SetParameterValue(Convert.ToInt32(text)); } |
| | 25 | | } |