exUIPanel.OnEvent C# (CSharp) Method

OnEvent() public method

public OnEvent ( exUIEvent _e ) : bool
_e exUIEvent
return bool
    public override bool OnEvent( exUIEvent _e )
    {
        exUIMng uimng = exUIMng.instance;

        if ( _e.category == exUIEvent.Category.Mouse ) {
            if ( _e.type == exUIEvent.Type.MouseEnter ) {
                if ( hoverInSlots.Count > 0 ) {
                    OnHoverIn (_e);
                    return true;
                }
                return false;
            }
            else if ( _e.type == exUIEvent.Type.MouseExit ) {
                if ( uimng.GetMouseFocus() == this ) {
                    uimng.SetMouseFocus(null);
                }

                if ( hoverOutSlots.Count > 0 ) {
                    OnHoverOut(_e);
                    return true;
                }
                return false;
            }
            else if ( _e.type == exUIEvent.Type.MouseDown ) {
                if ( uimng.GetMouseFocus() == null )
                    uimng.SetMouseFocus( this );

                if ( pressSlots.Count > 0 ) {
                    OnPress(_e);
                    return true;
                }
                return false;
            }
            else if ( _e.type == exUIEvent.Type.MouseUp ) {
                if ( uimng.GetMouseFocus() == this ) {
                    uimng.SetMouseFocus( null );
                }

                if ( releaseSlots.Count > 0 ) {
                    OnRelease(_e);
                    return true;
                }
                return false;
            }
            else if ( _e.type == exUIEvent.Type.MouseMove ) {
                if ( moveSlots.Count > 0 ) {
                    OnPointerMove(_e);
                    return true;
                }
                return false;
            }
        }
        else if ( _e.category == exUIEvent.Category.Touch ) {
            if ( _e.type == exUIEvent.Type.TouchEnter ) {
                if ( hoverInSlots.Count > 0 ) {
                    OnHoverIn (_e);
                    return true;
                }
                return false;
            }
            else if ( _e.type == exUIEvent.Type.TouchExit ) {
                if ( uimng.GetTouchFocus(_e.touchID) == this ) {
                    uimng.SetTouchFocus( _e.touchID, null );
                }

                if ( hoverOutSlots.Count > 0 ) {
                    OnHoverOut(_e);
                    return true;
                }
                return false;
            }
            else if ( _e.type == exUIEvent.Type.TouchDown ) {
                if ( uimng.GetTouchFocus(_e.touchID) == null ) {
                    uimng.SetTouchFocus( _e.touchID, this );
                }

                if ( pressSlots.Count > 0 ) {
                    OnPress(_e);
                    return true;
                }
                return false;
            }
            else if ( _e.type == exUIEvent.Type.TouchUp ) {
                if ( uimng.GetTouchFocus(_e.touchID) == this ) {
                    uimng.SetTouchFocus( _e.touchID, null );
                }

                bool used = false;
                if ( releaseSlots.Count > 0 ) {
                    OnRelease(_e);
                    used = true;
                }
                if ( hoverOutSlots.Count > 0 ) {
                    OnHoverOut(_e);
                    used = true;
                }
                return used;
            }
            else if ( _e.type == exUIEvent.Type.TouchMove ) {
                if ( moveSlots.Count > 0 ) {
                    OnPointerMove(_e);
                    return true;
                }
                return false;
            }
        }

        //
        return false;
    }