123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- using System;
- using System.Collections;
- using UnityEngine;
- public class SpinBox : MonoBehaviour
- {
- private void Start()
- {
- SpinBoxButton component = base.transform.Find("Up").GetComponent<SpinBoxButton>();
- SpinBoxButton component2 = base.transform.Find("Down").GetComponent<SpinBoxButton>();
- UILabel component3 = base.transform.Find("Box").GetComponent<UILabel>();
- UILabel component4 = GameObject.Find("ProfilePanel/CharacterInfo/ProfileBase/StatusPoints/MaidPoint").GetComponent<UILabel>();
- this.amountPerPoint = 20;
- SpinBoxParam spinBoxParam = this.InitParam();
- component.Init(spinBoxParam, component3, component4);
- component2.Init(spinBoxParam, component3, component4);
- this.SetEnableButton();
- }
- private SpinBoxParam InitParam()
- {
- return new SpinBoxParam
- {
- m_maxNumber = this.maxNumber,
- m_minNumber = this.minNumber,
- amountPerPoint = this.amountPerPoint
- };
- }
- private void SetEnableButton()
- {
- bool enabledInput = BaseMgr<ProfileMgr>.Instance.m_enabledInput;
- IEnumerator enumerator = base.transform.GetEnumerator();
- try
- {
- while (enumerator.MoveNext())
- {
- object obj = enumerator.Current;
- Transform transform = (Transform)obj;
- if (transform.name == "Up" || transform.name == "Down")
- {
- transform.gameObject.SetActive(enabledInput);
- }
- }
- }
- finally
- {
- IDisposable disposable;
- if ((disposable = (enumerator as IDisposable)) != null)
- {
- disposable.Dispose();
- }
- }
- }
- [SerializeField]
- private int maxNumber = 9999;
- [SerializeField]
- private int minNumber;
- [SerializeField]
- private int amountPerPoint;
- private const string POINT_PATH = "ProfilePanel/CharacterInfo/ProfileBase/StatusPoints/MaidPoint";
- }
|