using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; public abstract class BaseView :BaseWindow { public object config; public bool isSelect; public int index; public override void Start() { base.Start(); isSelect = false; AddEvent(); } public override void Init() { } public void AddEvent() { if (!gameObject.GetComponent()) { gameObject.AddComponent(); } EventManagerPatch.RemoveAllTriggerListener(gameObject); EventManagerPatch.AddTriggerListener(gameObject, EventTriggerType.PointerEnter, OnEnter); EventManagerPatch.AddTriggerListener(gameObject, EventTriggerType.PointerDown, OnDown); EventManagerPatch.AddTriggerListener(gameObject, EventTriggerType.PointerUp, OnUp); EventManagerPatch.AddTriggerListener(gameObject, EventTriggerType.PointerExit, OnExit); EventManagerPatch.AddTriggerListener(gameObject, EventTriggerType.PointerClick, OnClick); } public virtual void OnEnter(BaseEventData data) { } public virtual void OnDown(BaseEventData data) { } public virtual void OnUp(BaseEventData data) { } public virtual void OnExit(BaseEventData data) { } public virtual void OnClick(BaseEventData data) { } public virtual void Refresh() { } }