12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
-
- 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<SCButton>()) {
- gameObject.AddComponent<SCButton>();
- }
- 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() {
- }
- }
|