コード例 #1
0
    public bool IsOut()
    {
        var pos  = transform.position;
        var size = GetComponent <Collider2D>().bounds.size;

        return(BorderDetector.IsOut(pos, size));
    }
コード例 #2
0
    public bool IsCollised()
    {
        var pos   = transform.position;
        var size  = GetComponent <Collider2D>().bounds.size;
        var isCol = BorderDetector.IsCollised(pos, size);

        IsCollisedDebug = isCol;
        IsOutDebug      = BorderDetector.IsOut(pos, size);
        posDebug        = pos;
        sizeDebug       = size;
        topRightDebug   = BorderDetector.RightTop;
        leftBottomDebug = BorderDetector.LeftBottom;
        return(isCol);
    }