/// <summary> /// 设置添加一个事件功能 /// </summary> /// <param name="_type"></param> /// <param name="_handle"></param> /// <param name="_params"></param> public void SetEventListener(E_TouchType _type, OnTouchHandle _handle, params object[] _params) { TouchHandle handle = GetHandle(_type); if (handle == null) { handle = new TouchHandle(); dicHandles.Add(_type, handle); } dicHandles[_type].TouchType = _type; dicHandles[_type].SetHandle(_handle, _params); }
static public void RemoveClickListener(OnTouchHandle handle) { Instance.RemoveClickHandle(handle); }
/// <summary> /// 移除鼠标结束事件监听 /// </summary> /// <param name="handle"></param> static public void RemoveTouchEndListener(OnTouchHandle handle) { Instance.RemoveTouchEndHandle(handle); }
static public void AddClickListener(OnTouchHandle handle) { Instance.AddClickHandle(handle); }
/// <summary> /// 添加鼠标离开事件监听 /// </summary> /// <param name="handle"></param> static public void AddTouchEndListener(OnTouchHandle handle) { Instance.AddTouchEndHandle(handle); }
/// <summary> /// 移除鼠标开始事件监听 /// </summary> /// <param name="handle"></param> static public void RemoveTouchBeginListener(OnTouchHandle handle) { Instance.RemoveTouchBeginHandle(handle); }
/// <summary> /// 添加鼠标开始事件监听 /// </summary> /// <param name="handle"></param> static public void AddTouchBeginListener(OnTouchHandle handle) { Instance.AddTouchBeginHandle(handle); }
private void AddTouchMoveHandle(OnTouchHandle handle) { touchMoveHandle += handle; }
private void AddClickHandle(OnTouchHandle handle) { clickHandle += handle; }
private void RemoveClickHandle(OnTouchHandle handle) { clickHandle -= handle; }
private void RemoveTouchEndHandle(OnTouchHandle handle) { touchEndHandle -= handle; }
private void RemoveTouchBeginHandle(OnTouchHandle handle) { touchBeginHandle -= handle; }
private void AddTouchEndHandle(OnTouchHandle handle) { touchEndHandle += handle; }
public TouchHandle(OnTouchHandle _handle, params object[] _params) { eventHandle += _handle; handParams = _params; }
/// <summary> /// 添加鼠标移动事件监听 /// </summary> /// <param name="handle"></param> static public void AddTouchMoveListener(OnTouchHandle handle) { Instance.AddTouchMoveHandle(handle); }
/// <summary> /// 设置数据,注意会清除之前设置的信息 /// </summary> /// <param name="_handle"></param> /// <param name="_params"></param> public void SetHandle(OnTouchHandle _handle, params object[] _params) { DestoryHandle(); eventHandle += _handle; handParams = _params; }
private void AddTouchBeginHandle(OnTouchHandle handle) { touchBeginHandle += handle; }