コード例 #1
0
    public List <Polygon2D> GetShapePolygons()
    {
        if (shapePolygons == null)
        {
            shapePolygons = new List <Polygon2D>();

            if (originalSprite == null)
            {
                return(shapePolygons);
            }

                        #if UNITY_2018_1_OR_NEWER
            if (customPhysicsShape == null)
            {
                customPhysicsShape = SpriteAtlasManager.RequesCustomShape(originalSprite);
            }
            shapePolygons = customPhysicsShape.GetShape();
                        #endif
        }
        return(shapePolygons);
    }
コード例 #2
0
    public List <Polygon2D> GetPolygons_Shape_Local()
    {
        if (polygons_shape_local == null)
        {
            LightingDebug.ShadowColliderTotalGenerationsLocal_shape++;

            polygons_shape_local = new List <Polygon2D>();

                        #if UNITY_2018_1_OR_NEWER
            if (customPhysicsShape == null)
            {
                if (originalSprite == null)
                {
                    return(polygons_shape_local);
                }

                customPhysicsShape = GetPhysicsShape();

                polygons_shape_local = customPhysicsShape.GetShape();
            }
                        #endif
        }
        return(polygons_shape_local);
    }