Exemplo n.º 1
0
 void OnDestroy()
 {
     onClick?.ResetHandle();
     onClick = null;
     onDoubleClick?.ResetHandle();
     onDoubleClick = null;
     onDown?.ResetHandle();
     onDown = null;
     onEnter?.ResetHandle();
     onEnter = null;
     onExit?.ResetHandle();
     onExit = null;
     onUp?.ResetHandle();
     onUp = null;
     onSelect?.ResetHandle();
     onSelect = null;
     onUpdateSelect?.ResetHandle();
     onUpdateSelect = null;
     onDeSelect?.ResetHandle();
     onDeSelect = null;
     onDrag?.ResetHandle();
     onDrag = null;
     onEndDrag?.ResetHandle();
     onEndDrag = null;
     onDrop?.ResetHandle();
     onDrop = null;
     onScroll?.ResetHandle();
     onScroll = null;
     onMove?.ResetHandle();
     onMove = null;
 }
Exemplo n.º 2
0
        public void SetUIEventListener(enTouchEventType type, OnTouchEventHandle handle, params object[] paramsObj)
        {
            switch (type)
            {
            case enTouchEventType.OnClick:
                if (null == onClick)
                {
                    onClick = new TouchHandle();
                }
                onClick.SetHandle(handle, paramsObj);
                break;

            case enTouchEventType.OnDoubleClick:
                if (null == onDoubleClick)
                {
                    onDoubleClick = new TouchHandle();
                }
                onDoubleClick.SetHandle(handle, paramsObj);
                break;

            case enTouchEventType.OnDown:
                if (onDown == null)
                {
                    onDown = new TouchHandle();
                }
                onDown.SetHandle(handle, paramsObj);
                break;

            case enTouchEventType.OnUp:
                if (onUp == null)
                {
                    onUp = new TouchHandle();
                }
                onUp.SetHandle(handle, paramsObj);
                break;

            case enTouchEventType.OnEnter:
                if (onEnter == null)
                {
                    onEnter = new TouchHandle();
                }
                onEnter.SetHandle(handle, paramsObj);
                break;

            case enTouchEventType.OnExit:
                if (onExit == null)
                {
                    onExit = new TouchHandle();
                }
                onExit.SetHandle(handle, paramsObj);
                break;

            case enTouchEventType.OnDrag:
                if (onDrag == null)
                {
                    onDrag = new TouchHandle();
                }
                onDrag.SetHandle(handle, paramsObj);
                break;

            case enTouchEventType.OnDrop:
                if (onDrop == null)
                {
                    onDrop = new TouchHandle();
                }
                onDrop.SetHandle(handle, paramsObj);
                break;

            case enTouchEventType.OnEndDrag:
                if (onEndDrag == null)
                {
                    onEndDrag = new TouchHandle();
                }
                onEndDrag.SetHandle(handle, paramsObj);
                break;

            case enTouchEventType.OnSelect:
                if (onSelect == null)
                {
                    onSelect = new TouchHandle();
                }
                onSelect.SetHandle(handle, paramsObj);
                break;

            case enTouchEventType.OnUpdateSelect:
                if (onUpdateSelect == null)
                {
                    onUpdateSelect = new TouchHandle();
                }
                onUpdateSelect.SetHandle(handle, paramsObj);
                break;

            case enTouchEventType.OnDeSelect:
                if (onDeSelect == null)
                {
                    onDeSelect = new TouchHandle();
                }
                onDeSelect.SetHandle(handle, paramsObj);
                break;

            case enTouchEventType.OnScroll:
                if (onScroll == null)
                {
                    onScroll = new TouchHandle();
                }
                onScroll.SetHandle(handle, paramsObj);
                break;

            case enTouchEventType.OnMove:
                if (onMove == null)
                {
                    onMove = new TouchHandle();
                }
                onMove.SetHandle(handle, paramsObj);
                break;

            case enTouchEventType.OnBeginDrag:
                if (onBeginDrag == null)
                {
                    onBeginDrag = new TouchHandle();
                }
                onBeginDrag.SetHandle(handle, paramsObj);
                break;

            case enTouchEventType.OnSubmit:
                if (onSubmit == null)
                {
                    onSubmit = new TouchHandle();
                }
                onSubmit.SetHandle(handle, paramsObj);
                break;

            case enTouchEventType.OnCancel:
                if (onCancel == null)
                {
                    onCancel = new TouchHandle();
                }
                onCancel.SetHandle(handle, paramsObj);
                break;
            }
        }