using AX.InputSystem; using UnityEngine; using UnityEngine.UI; [RequireComponent(typeof(BaseGameObjInfo))] [RequireComponent(typeof(CreateStaticObjID))] public abstract class BaseSlider : MonoBehaviour { public virtual void OnEnable() { GetComponent().onValueChanged.AddListener(OnValueChanged); } public virtual void OnDisable() { GetComponent().onValueChanged.RemoveListener(OnValueChanged); } public virtual void OnDestroy() { GetComponent().onValueChanged.RemoveListener(OnValueChanged); } public void OnValueChanged(float value) { var arg = new UISliderArgs(); arg.value = value; arg.currentCursorPos = Input.mousePosition; RegisterUIInputEvent.RegisterUIInputHistory(gameObject, this.GetType().Name, "ValueChanged", arg); //ValueChanged(arg); RespondFun(value); } public void ValueChanged(CmdArgs arg) { if (GameSettings.othersSettings.isReplayMode) { if (!GameSettings.othersSettings.isReplayPause && !GameSettings.othersSettings.isReplayOver) { CursorManager.GetInstance.SetClick(arg); } } GetComponent().value = ((UISliderArgs)arg).value; } public abstract void RespondFun(float value); }