123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.EventSystems;
- using UnityEngine.UI;
- 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<Button>()) {
- gameObject.AddComponent<Button>();
- }
- OBEEventManager.RemoveAllTriggerListener(gameObject);
- OBEEventManager.AddTriggerListener(gameObject, EventTriggerType.PointerEnter, OnEnter);
- OBEEventManager.AddTriggerListener(gameObject, EventTriggerType.PointerDown, OnDown);
- OBEEventManager.AddTriggerListener(gameObject, EventTriggerType.PointerUp, OnUp);
- OBEEventManager.AddTriggerListener(gameObject, EventTriggerType.PointerExit, OnExit);
- OBEEventManager.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() {
- }
- }
|