1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- 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() {
- }
- }
|