Sprite.hitTestMouseDispatch C# (CSharp) Method

hitTestMouseDispatch() public method

public hitTestMouseDispatch ( string type, Vector2 vec ) : bool
type string
vec Vector2
return bool
    public override bool hitTestMouseDispatch(string type,Vector2 vec)
    {
        if(!mouseEnable || !_visible){
            return false;
        }
        Vector2 newVec = transformInTreeInverted.transformVector(vec);
        //Debug.Log(id+"/"+ newVec + _selfBoundRect+_textureSelfRect);
        if(!_boundRectInTree.Contains(vec)){
            return false;
        }
        bool isHit = false;
        if(_textureSelfRect.width!=0 && _textureSelfRect.height!=0 && _textureSelfRect.Contains(newVec)){
            isHit = true;
        }

        DisplayObject child;
        for(int i=_childList.Count-1;i>=0;i--){
            child	= _childList[i] as DisplayObject;
            if(child.hitTestMouseDispatch(type,vec)){
                isHit	= true;
                break;
            }

        }
        //Debug.Log(id+"  mouse hit test "+ isHit);
        if(isHit){
            //Debug.Log(id+"/"+type);
            this.dispatchEvent(new MouseEvent(type,newVec,vec));
        }
        return isHit;
    }