对外的监听消息,可以通过MessageDispatcher.SendMessage(MessageName.XXX.ToString());来实现对应功能 /// /// 消息名称 /// public enum MessageName { /// /// 小地图缩小 /// MiniMapShrink, /// /// 小地图放大 /// MiniMapEnlarge, /// /// 小地图缩放 /// MiniMapZoom, /// /// 复位相机 /// RestCamera, /// /// 小地图右键点击 /// MiniMapRightClick Inspector 可修改参数 //缩放速度 public float zoomSpeed = 10; //相机最小值 public float zoomMin = 50; //相机最大值 public float zoomMax = 300; //当前相机大小 private float currentSize = 50; //相机视野边界最大值 public Vector2 PosToWorldMax = new Vector2(700f,450); //相机视野边界最小值 public Vector2 PosToWorldMin = new Vector2(-1700f,-1700); }