using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using AX.InputSystem; [RequireComponent(typeof(BaseGameObjInfo))] [RequireComponent(typeof(CreateStaticObjID))] public abstract class BaseDropDown : 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(int value) { var arg = new UIDropDownValueCmdArgs(); arg.chooseValue = 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 = ((UIDropDownValueCmdArgs)arg).chooseValue; //GetComponent().RefreshShownValue(); } public abstract void RespondFun(int value); }