public CustomPhysicsShape GetPhysicsShape()
 {
     if (customPhysicsShape == null)
     {
         customPhysicsShape = SpriteAtlasManager.RequesCustomShape(originalSprite);
     }
     return(customPhysicsShape);
 }
示例#2
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);
    }