コード例 #1
0
    public int GetSortingLayer()
    {
        LightShape.Base shadowShape = GetShadowShape();
        if (shadowShape != null)
        {
            int shadowLayer = shadowShape.GetSortingLayer();

            if (shadowLayer != 0)
            {
                return(shadowLayer);
            }
        }

        LightShape.Base maskShape = GetMaskShape();
        if (maskShape != null)
        {
            int maskLayer = maskShape.GetSortingLayer();

            if (maskLayer != 0)
            {
                return(maskLayer);
            }
        }

        return(0);
    }
コード例 #2
0
    public bool RectOverlap(Rect rect)
    {
        LightShape.Base shadowShape = GetShadowShape();
        LightShape.Base maskShape   = GetMaskShape();

        if (maskShape != null && shadowShape != null)
        {
            if (maskShape == shadowShape)
            {
                return(shadowShape.GetWorldRect().Overlaps(rect));
            }
        }

        if (shadowShape != null)
        {
            bool result = shadowShape.GetWorldRect().Overlaps(rect);

            if (result)
            {
                return(true);
            }
        }

        if (maskShape != null)
        {
            bool result = maskShape.GetWorldRect().Overlaps(rect);

            if (result)
            {
                return(true);
            }
        }

        return(false);
    }
コード例 #3
0
    public List <Polygon2> GetPolygonsWorld()
    {
        LightShape.Base shadowShape = GetShadowShape();
        if (shadowShape != null)
        {
            return(shadowShape.GetPolygonsWorld());
        }

        return(null);
    }
コード例 #4
0
    public List <MeshObject> GetMeshes()
    {
        LightShape.Base maskShape = GetMaskShape();
        if (maskShape != null)
        {
            return(maskShape.GetMeshes());
        }

        return(null);
    }
コード例 #5
0
    public void ResetWorld()
    {
        LightShape.Base shadowShape = GetShadowShape();
        if (shadowShape != null)
        {
            shadowShape.ResetWorld();
        }

        LightShape.Base maskShape = GetMaskShape();
        if (maskShape != null)
        {
            maskShape.ResetWorld();
        }
    }
コード例 #6
0
    public Rect GetIsoWorldRect()
    {
        LightShape.Base shadowShape = GetShadowShape();
        if (shadowShape != null)
        {
            return(shadowShape.GetIsoWorldRect());
        }

        LightShape.Base maskShape = GetMaskShape();
        if (maskShape != null)
        {
            return(maskShape.GetIsoWorldRect());
        }

        return(new Rect());
    }
コード例 #7
0
    public Vector2 GetPivotPoint()
    {
        LightShape.Base shadowShape = GetShadowShape();
        if (shadowShape != null)
        {
            switch (maskPivot)
            {
            case LightCollider2D.MaskPivot.TransformCenter:
                return(shadowShape.GetPivotPoint_TransformCenter());

            case LightCollider2D.MaskPivot.ShapeCenter:
                return(shadowShape.GetPivotPoint_ShapeCenter());

            case LightCollider2D.MaskPivot.LowestY:
                return(shadowShape.GetPivotPoint_LowestY());
            }
        }

        return(Vector2.zero);
    }