using System.Collections; using System.Collections.Generic; using UnityEngine; namespace ZXKFramework { public abstract class View : MonoBehaviour { //名字标识 public abstract string Name { get; } //事件关心列表 [HideInInspector] public List AttentionList = new List(); public virtual void RegisterAttentionEvent() { } //处理事件 public virtual void HandleEvent(string name, object data) { } //发送事件 protected void SendEvent(string eventName, object data = null) { MVC.SendEvent(eventName, data); } //获取模型 protected T GetModel() where T : Model { return MVC.GetModel() as T; } } }