Esempio n. 1
0
    private void EnteringEvent(EventInfo info)
    {
        var pos = info.Position;

        var isContains = GlobSetting.ContainsQuadrangle(_leftDown, _leftUp, _rightDown, _rightUp, pos);

        if (isContains)
        {
            if (!_isEnter)
            {
                //Debug.Log("EnteringEvent 进入了该组件" + this.name);
                if (PointEnter != null)
                {
                    PointEnter();
                }
            }

            _isEnter = true;
        }
        else
        {
            if (_isEnter)
            {
                //Debug.Log(_leftDown + " " + _leftUp + " " + _rightDown + " " + _rightUp + " "+ pos);
                // Debug.Log("EnteringEvent  触摸离开了该组件 " +this.name);
                if (PointExit != null)
                {
                    PointExit();
                }
            }
            _isEnter = false;
        }
    }
Esempio n. 2
0
    private void ExitEvent(EventInfo info)
    {
        var pos = info.Position;

        var isContains = GlobSetting.ContainsQuadrangle(_leftDown, _leftUp, _rightDown, _rightUp, pos);

        if (isContains)
        {
            if (_isFirstEnter)
            {
                if (OnClick != null)
                {
                    OnClick();
                }
                Debug.Log("触发了点击事件 " + name);
                _isFirstEnter = false;
            }
        }
        else
        {
            if (_isEnter)
            {
                //Debug.Log("ExitEvent 触摸离开了该组件" + this.name);
                if (PointExit != null)
                {
                    PointExit();
                }
            }
            _isEnter = false;
        }
    }
Esempio n. 3
0
    private void EnterEvent(EventInfo info)
    {
        var pos = info.Position;

        var isContains = GlobSetting.ContainsQuadrangle(_leftDown, _leftUp, _rightDown, _rightUp, pos);

        if (isContains)
        {
            Debug.Log("EnterEvent  触摸进入了该组件" + name);
            _isEnter = true;
            if (PointEnter != null)
            {
                PointEnter();
            }
            _isFirstEnter = true;
        }
        else
        {
            _isEnter = false;
        }
    }