Initial commit

This commit is contained in:
AbstractConcept 2022-09-13 00:36:34 -05:00
commit 3c7cc0c973
8391 changed files with 704313 additions and 0 deletions

View file

@ -0,0 +1,226 @@
# Changelog
## [3.0.14] - 2020-08-31
### Fixed
- 1271231 Sprite Variant Window does not appear in Sprite Shape Controller Component when selecting a Spline
- 1268305 Unable to add item on Resetting the Preset of the SpriteShapeProfile
## [3.0.13] - 2020-07-17
### Changed
- If Geometry is baked using SpriteShapeGeometryCache, do not check for dirty once data is updated to prevent GC.
- Updated Help Section to point to the correct URLs.
### Fixed
- 1242910 Unable to add item on Resetting the Preset of the SpriteShapeProfile
- 1260990 Exception thrown continuously when Undo operation is performed with sprites are assigned earlier
- 1263318 BakeCollider requires GC every frame even when there are no changes in SpriteShape
## [3.0.12] - 2020-05-28
### Added
- Added BakeMesh to save generated geometry data.
- Sample script GenerateSpriteShapes.cs to demonstrate force generating invisible SpriteShapes on runtime scene load.
### Fixed
- 1248171 Error occurs when unselecting Cache Geometry for Sprite Shape prefab
- 1240380 OnGUI in SpriteShapeController creates GC allocs.
- 1242531 InvalidOperationException thrown continuously on adding "Sprite Shape Controller" Component to a Sprite object
- 1242533 "A Native Collection has not been disposed, resulting in a memory leak" is thrown when 2D Sprite Shape Controller is added.
## [3.0.11] - 2020-04-20
### Changed
- Added warning when a valid SpriteShape profile is not set.
- Code cleanup.
## [3.0.10] - 2020-03-06
### Fixed
- 1220091 SpriteShapeController leaks memory when zero control points are used
- 1216990 Colliders should also respect Pivot property of Edge Sprites.
- 1225366 Ensure SpriteShape are not generated when not in view on Runtime.
## [3.0.9] - 2020-02-11
### Changed
- Improved Memory Allocations.
### Fixed
- Fixed OnDrawGizmos to Get/Release RenderTexture through CommandBuffer.
## [3.0.8] - 2019-12-02
### Changed
- Updated License file
- Updated Third Party Notices file
- Changed how Samples are installed into user's project
### Fixed
- Fixed where the last point of the Sprite Shape does not behave correctly when using Continuous Points in a closed shape (case 1184721)
## [3.0.7] - 2019-10-27
### Fixed
- Added missing meta file
### Changed
- Update com.unity.2d.path package dependency
## [3.0.6] - 2019-09-27
### Added
- Added support to set CornerAngleThreshold.
- Burst is now enabled for performance boost.
### Fixed
- Fix (Case 1041062) Inputting Point Position manually causes mesh to not conform to the spline
- Fix GC in confirming Spline Extras sample.
- Fix hash Validation errors.
- Removed resources from Packages.
## [3.0.5] - 2019-09-05
### Fixed
- Fix (Case 1159767) Error generated when using a default sprite for Corner sprite or Angle Range sprite in Sprite Shape Profile
- Fix (Case 1178579) "ArgumentOutofRangeException" is thrown and SpriteShapeProfile freezes on reset
## [3.0.4] - 2019-08-09
### Added
- Added tangent channel support for proper 2D lighting in URP.
## [3.0.3] - 2019-07-24
### Added
- Add related test packages
## [3.0.2] - 2019-07-13
### Changed
- Update to latest Mathematics package version
## [3.0.1] - 2019-07-13
### Changed
- Mark package to support Unity 2019.3.0a10 onwards.
## [3.0.0] - 2019-06-19
### Changed
- Stable Version.
- Remove experimental namespace.
## [2.1.0-preview.8] - 2019-06-12
### Changed
- Fix (Case 1152342) The first point of the Sprite Shape does not behave correctly when using Continuous Points
- Fix (Case 1160009) Edge and Polygon Collider does not seem to follow the spriteshape for some broken mirrored tangent points
- Fix (Case 1157201) Edge Sprite Material changed when using a fill texture that is already an edge sprite on spriteshape
- Fix (Case 1162134) Open ended Spriteshape renders the fill texture instead of the range sprite
## [2.1.0-preview.7] - 2019-06-02
### Changed
- Fix Variant Selection.
## [2.1.0-preview.6] - 2019-06-02
### Changed
- Fix Null reference exception caused by SplineEditorCache changes.
- Fill Inspector changes due to Path integration.
## [2.1.0-preview.4] - 2019-05-28
### Changed
- Upgrade Mathematics package.
- Use path editor.
## [2.1.0-preview.2] - 2019-05-13
### Changed
- Initial version for 2019.2
- Update for common package.
## [2.0.0-preview.8] - 2019-05-16
### Fixed
- Fixed issue when sprites are re-ordered in Angle Range.
- Updated Samples.
## [2.0.0-preview.7] - 2019-05-10
### Fixed
- Version Update and fixes.
## [2.0.0-preview.6] - 2019-05-08
### Fixed
- Added Sprite Variant Selector.
- Fix Variant Bug (https://forum.unity.com/threads/spriteshape-preview-package.522575/page-6#post-4480936)
- Fix (Case 1146747) SpriteShape generating significant GC allocations every frame (OnWillRenderObject)
## [2.0.0-preview.5] - 2019-04-18
### Fixed
- Shape angle does not show the accurate sprite on certain parts of the shape.
- SpriteShape - Unable to use the Depth buffer (https://forum.unity.com/threads/spriteshape-preview-package.522575/page-6#post-4413142)
## [2.0.0-preview.4] - 2019-03-28
### Changed
- Disable burst for now until we have a final release.
## [2.0.0-preview.3] - 2019-03-25
### Fixed
- Update Common version.
## [2.0.0-preview.2] - 2019-03-08
### Fixed
- Fix Edge Case Scenario where Vertices along Continuous segment could be duplicated..
- Ensure that Collider uses a valid Sprite on Generation.
## [2.0.0-preview.1] - 2019-02-27
### Changed
- Updated version.
## [1.1.0-preview.1] - 2019-02-10
### Added
- Spriteshape tessellation code is re-implemented in C# Jobs and utilizes Burst for Performance.
- Added Mirrored and Non-Mirrored continous Tangent mode.
- Simplified Collider Generation support and is part of C# Job/Burst for performance.
- Added Shortcut Keys (for setting Tangentmode, Sprite Variant and Mirror Tangent).
- Ability to drag Spriteshape Profile form Project view to Hierarchy to create Sprite Shape in Scene.
- Simplified Corner mode for Points and is now enabled by default.
- Added Stretch UV support for Fill Area.
- Added Color property to SpriteShapeRenderer.
### Fixed
- SpriteShapeController shows wrong Sprites after deleting a sprite from the top angle range.
- Empty SpriteShapeController still seem to show the previous Spriteshape drawcalls
- Streched Sprites are generated in between non Linked Points
- Corners sprites are no longer usable if user only sets the corners for the bottom
- Sprites in SpriteShape still shows even after user deletes the SpriteShape Profile
- SpriteShape doesn't update Point Positions visually at runtime for Builds
- Spriteshape Colliders does not update in scene immediately
- Fixed constant Mesh baking (https://forum.unity.com/threads/spriteshape-preview-package.522575/page-4#post-3925789)
- Fixed Bounds generation issue (https://forum.unity.com/threads/spriteshape-preview-package.522575/page-5#post-4079857)
- Sprite Shape Profile component breaks when creating range
- Fixed when sprite is updated in the sprite editor, the spriteshape is not updated.
- Fixed cases where Spline Edit is disabled even when points are selected. (https://forum.unity.com/threads/spriteshape-preview-package.522575/#post-3436940)
- Sprite with SpriteShapeBody Shader gets graphical artifacts when rotating the camera.
- When multiple SpriteShapes are selected, Edit Spline button is now disabled. (https://forum.unity.com/threads/spriteshape-preview-package.522575/page-3#post-3764413)
- Fixed texelSize property (https://forum.unity.com/threads/spriteshape-preview-package.522575/page-4#post-3877081)
- Fixed Collider generation for different quality levels. (https://forum.unity.com/threads/spriteshape-preview-package.522575/page-4#post-3956062)
- Fixed Framing Issues (https://forum.unity.com/threads/spriteshape-preview-package.522575/page-5#post-4137214)
- Fixed Collider generation for Offsets (https://forum.unity.com/threads/spriteshape-preview-package.522575/page-5#post-4149841)
- Fixed Collider generation for different Heights (https://forum.unity.com/threads/spriteshape-preview-package.522575/page-5#post-4190116)
### Changed
- SpriteShape Asset parameters WorldSpace UV, PixelPerUnit have been moved to SpriteShapeController properties.
- Collider generation has been simplified and aligns well with the generated geometry (different height, corners etc.)
### Removed
- Remove redundant parameters BevelCutoff and BevelSize that can be done by simply modifying source spline.
## [1.0.12-preview.1] - 2018-08-03
### Added
- Fix issue where Point Positions do not update visually at runtime for Builds
## [1.0.11-preview] - 2018-06-20
### Added
- Fix Spriteshape does not update when Sprites are reimported.
- Fix SpriteShapeController in Scene view shows a different sprite when user reapplies a Sprite import settings
- Fix Editor Crashed when user adjusts the "Bevel Cutoff" value
- Fix Crash when changing Spline Control Points for a Sprite Shape Controller in debug Inspector
- Fix SpriteShape generation when End-points are Broken.
- Fix cases where the UV continuity is broken even when the Control point is continous.
## [1.0.10-preview] - 2018-04-12
### Added
- Version number format changed to -preview
## [0.1.0] - 2017-11-20
### Added
- Bezier Spline Shape
- Corner Sprites
- Edge variations
- Point scale
- SpriteShapeRenderer with support for masking
- Auto update collision shape

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 3909d2eb8b6444c6f972a20db7914b89
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,14 @@
# Enabling Collision
Attach a __Collider 2D__ component to your Sprite Shape to enable the Collider properties in the __Sprite Shape Controller.__ Only the __Edge__ and __Polygon Collider 2D__ components can be used with __Sprite Shapes__.
![Attaching a Collider component](images/v1.1-Collider.png)
The Collider mesh automatically updates itself to the shape of the Sprite Shape when attached. See the Collider section of the [Sprite Shape Controller](SSController.md) page for more details about the Sprite Shape Collider options.
By default, the Collider mesh is automatically reshaped to match the Sprite Shape every time it is edited. To make manual edits to the Collider mesh directly, first disable both __Update Collider__ and __Optimize Collider__ in the __Sprite Shape Controller's__ Collider settings to prevent the Controller from updating the Collider mesh automatically and overriding your manual edits.
![Disabling the Collider options](images/v1.1-ColliderOptionsDisable.png)
You can now edit the Collider mesh independent of the shape of the __Sprite Shape.__

View file

@ -0,0 +1,103 @@
# Sprite Shape Controller
The __Sprite Shape Controller__ component is automatically attached to the GameObject created when a __Sprite Shape Profile__ is dragged into the Scene. You edit the shape of the Sprite Shape's outline through the Controller's settings. The Controller displays different settings depending on different conditions.
## Property Settings - Default
The default component settings below are displayed when Edit Spline is not enabled.
![Sprite Shape Controller property settings](images/2019_3_SSController_noedit.png)
| __Property__ | __Function__ |
| ------------------------------------------------------------ | ------------------------------------------------------------ |
| __Profile__ | Select the __Sprite Shape Profile__ used by this Sprite Shape. |
| __Edit Spline__ | Enable ![](images/PropertyImage1.png) to make the Control Points of the Sprite Shape visible and editable. |
| __Spline__ | - |
| __Detail__ | Select the tessellation quality of the rendered Sprite Shape mesh. High/Medium/Low Quality options available. |
| __Open Ended__ | Disable to connect both ends of the Sprite Shape together to form an enclosed Shape. Enable to leave both ends of the Sprite Shape unconnected. |
| __Adaptive UV__ | Enabled by default. When enabled, Unity attempts to seamlessly tile the Sprites along the Sprite Shape path by deforming the Sprites to between Control Points. Disable this property to tile Sprites with no deformation and at their exact width. Sprites may appear cutoff if the space between Control Points is shorter than the width of the Sprite. |
| __Fill__ | - |
| __Stretch UV__ | Enable this setting to have Unity stretch the UV of the Fill texture across the Full Rect of the Sprite Shape. |
| __Pixels Per Unit__ (only available when Stretch UV is disabled) | This values affect the appearance of the Fill texture of the Sprite Shape. This value affects the scale of the Fill texture, with higher values reducing the size of the texture. The default value is 100. |
| __World Space UV__ (only available when __Stretch UV__ is disabled) | Enable to apply the Fill texture according to the World Space UV, instead of per GameObject UV. |
### With Edit Spline enabled and a Control Point selected
Enable __Edit Spline__ in the Controller settings to make Control Points on the Sprite Shape visible and editable. Selecting a Control Point enables the following additional Controller settings.
![With a Control Point selected](images/enable_tangents.png)
| __Point__ | - |
| ------------------------------------------------------- | ------------------------------------------------------------ |
| __Tangent Mode__ | Select one of three __Point Modes__ to change the way tangents on Control Points are edited. |
| ![](images/2D_SpriteShape_7.png)__Linear__ | No curve is formed between the Control Point and its neighboring points. |
| ![](images/2D_SpriteShape_8.png)__Continuous Mirrored__ | Two tangents appear on opposite sides of the Control Point, and the spline between the Control Point and its neighbors becomes curved. Adjust the tangents to change the shape of the curve. The angle between the two tangents is always 180 degrees in this mode. |
| ![](images/2D_SpriteShape_9.png)__Broken Mirrored__ | Two tangents appear on opposite sides of the Control Point, and the spline between the Control Point and its neighbors becomes curved. Adjust the tangents to change the shape of the curve. The length and angle of the tangents can be adjusted independently in this mood. |
| __Position__ | The local x and y coordinates of a selected Control Point. |
| __Height__ | Increase or decrease the height of Sprites at the Control Point by a factor of 0.1 to 4. |
| __Corner__ | Sets whether Corner Sprites are rendered at Control Points. Set to __Automatic__ by default. |
| __Disabled__ | The selected Control Point does not automatically render a Control Point. |
| __Automatic__ | The Control Point displays the assigned Corner Sprite, if both it and its neighbors are in __Linear Point Mode__. |
| __Sprite Variant__ | Select the __Sprite Variant__ from the visual Variant selector. Press __N__ to cycle through all available Variants for the Control Point. |
| __Snapping__ | Enable to snap Control Points according the Project's Snap settings. |
### Additional Collider settings
Add either the __Polygon Collider 2D__ or __Edge Collider 2D__ component to the __Sprite Shape__ to enable additional __Collider__ settings in the __Sprite Shape Controller__. See the [Enabling Collision](SSCollision.md) page for more details about enabling Colliders with Sprite Shapes.
![Collider settings](images/2019_3_SSController_collider.png)
| Collider | - |
| --------------------- | ------------------------------------------------------------ |
| __Update Collider__ | Enabled by Default. Enable this option to have the Collider mesh be updated to the Sprite Shape's current shape as the Sprite Shape is edited. Disable if you are editing the Collider mesh separately from the Sprite Shape and to use a custom Collider mesh. |
| __Offset__ | Select the amount to extrude the Collider mesh towards the edge of the Sprite Shape. The range is from -0.5 to 0.5, starting at 0 by default. |
| __Optimize Collider__ | Enabled by default. Enable to have Unity optimize the Collider mesh by cleaning up extra control points that are co-linear. Disable this option when editing the Collider mesh separately from the Sprite Shape to prevent Unity from affecting the custom Collider mesh. |
| __Detail__ | Sets the tessellation quality of the rendered Collider. High/Medium/Low Quality options available. |
## Editing the Spline
To edit the mesh outline of the __Sprite Shape__, click the __Edit Spline__ button to make the Shape's spline and its __Control Points__ become visible and editable.
![Edit Spline enabled](images/UpdatedEditSpline_2019-3.png)
When __Edit Spline__ is enabled, move the Control Points of the Sprite Shape to adjust its overall shape and size. Add additional Control Points by clicking on the spline in between Control Points. Press the __Del/Delete__ key to remove the currently selected Control Point.
![Control Point added to spline](images/2D_SpriteShape_032.png)
With a Control Point selected, cycle through the __Point Modes __by pressing the __M__ key. To change the __Mode__ of multiple Control Points at once, ensure that all selected Control Points are the same __Mode__ first before cycling or selecting another __Mode__.
To change the Sprite Variant currently displayed at a selected Control Point, press the __N__ key to cycle through all available Variants.
All shortcut keys can be rebound under the Shortcut menu (menu: __Edit > Shortcuts... > SpriteShape Editing__).
## Point Modes
When a Control Point is selected, its __Point Mode__ can be one of three modes- __Linear__, __Mirrored__, and __Non-Mirrored__.
The __Point Mode__ determines the behavior of the tangents that are used to adjust the spline between Control Points. Each Control Point can be set to a specific Point Mode and contain its own settings.
### Linear Point Mode
In __Linear Point Mode__, there are no tangents to control the curve between the Control Point and its neighbors, curves are not formed between Control Points and Sprites may overlap if they intersect.
Adjust which Sprite is displayed when two or more intersect by adjusting their __Order__ value in the [Sprite Shape Profile's](SSProfile.md) __Angle Range__ settings.
![Linear Point Mode](images/2D_SpriteShape_034.png)
### Continuous Mirrored Point Mode
In __Continuous Mirrored Point Mode__, tangents appear on both sides of the selected Control Point to create a curve between the Control Point and its neighbors. Adjust the shape of the curve with the tangents. In this mode, the angle between the tangents is always maintained at 180 degrees although their lengths from the can vary.
Press __B__ to mirror the length of the last edited tangent onto the opposite tangent.
![Mirrored Point Mode](images/2D_SpriteShape_033.png)
### Broken Mirrored Point Mode
In __Broken Mirrored Point Mode__, tangents appear on both sides of the selected Control Point to create a curve between the Control Point and its neighbors. Adjust the shape of the curve with the tangents. In this mode, the length and angle of each tangent can be adjusted independently.
Press __B__ to mirror the length of the last edited tangent onto the opposite tangent. In this mode, pressing __B__ also causes the angle of the opposite tangent to become exactly 180 degrees from the last edited tangent.
![Non-Mirrored Mode](images/2D_SpriteShape_036.png)

View file

@ -0,0 +1,95 @@
# Sprite Shape Profile
The __Sprite Shape Profile__ contains the settings that determine which Sprites that appear on a Sprite Shape at specific Angle Ranges, as well as other display settings. You can use the same Profile for multiple __Sprite Shapes__ in a Scene.
Create a __Sprite Shape Profile__ from the Editor main menu (menu: __Assets > Create > Sprite Shape Profile__), and select from the two available options: __Open Shape__ and __Closed Shape__.
![](images/v1.1-SSProfile.png)
| **Property** | **Function** |
| ------------------------------------------------------------ | ------------------------------------------------------------ |
| **Control Points** | - |
| **Use Sprite Borders** | Enable to draw the **Sprite Borders** of a Sprite at the Control Point. Define the **Sprite Borders** in the **Sprite Editor**. |
| **Fill** | - |
| **Texture** | Set the Texture to be used as a Fill to this field. Has no effect if the **Open Ended** property in the **Sprite Shape Controller** settings is enabled. |
| **Offset** | Determines the border offset at the edges of the Fill texture. |
| ![Angle Range tool](images/v1.1-AngleRange.png)**Angle Ranges (tool)** | Use this tool to create Angle Ranges and assign Sprites to those ranges. |
| **Start (degrees)** | Enter the starting angle for the selected Angle Range in degrees. |
| **End (degrees)** | Enter the ending angle for the selected Angle Range in degrees. |
| **Order** | Determines the display priority when Sprites intersect. Sprites with higher values are rendered above lower ones. |
| **Sprites** | List of Sprites assigned to the selected Angle Range. Displays a list of all Sprites assigned to the selected Angle Range. The order of Sprites in the list determines their **Sprite Variant** number, starting from zero at the top of the list. The first Sprite at the top of the list is the Sprite displayed by default at a Control Point. |
| **Corners** | - |
| *** All Corner options** | Assign specific Sprites to be displayed on the Sprite Shape at the respective corners. Refer to the documentation on [Corner Sprites]() for more information. |
## Open Shape
![Open Shape Profile preset](C:\Users\Sam\Documents\GitHub\com.unity.2d.spriteshape\Documentation~\images\OpenShapeProfile.png)
Use the __Open Shape__ preset Profile to create Shapes made from a single edge outline with tiled Sprites along its edge. This preset is ideal for creating level elements such as platforms.
![Example of an Open Shape](images/2D_SpriteShape_024.png)
Drag the Open Shape Profile into the Scene view to automatically generate a Sprite Shape with __Open Ended__ enabled in its __Sprite Shape Controller__ settings.
## Closed Shape
![Closed Shape Profile preset](images/ClosedShapeProfile.png)
Use the __Closed Shape__ preset Profile to create Shapes that encompass an enclosed area. The Closed Sprite Shape can display and tile a Fill texture in the enclosed area, if a Fill texture is set in its Profile settings. Use this preset to create large solid filled Shapes that are ideal for backgrounds or large platforms.
![Closed Shape square](images/v1.1-ClosedShapeSquare.png)
Drag the Closed Shape Profile into the Scene view to automatically generate a Sprite Shape with __Open Ended__ disabled in its __Sprite Shape Controller__ settings. The Closed Shape Profile's preset Angle Ranges create a square Sprite Shape by default.
A key feature of the __Sprite Shape Profile__ is the Angle Ranges tool. Assigning an Angle Range determines what Sprite is displayed at specific angles, as the Sprite Shape is deformed in the Scene.
## Creating Angle Ranges
### Method 1:
To create an Angle Range, click the __Create Range__ button at the bottom of the Angle Ranges tool:
![The 'Create Range'button](images/2D_SpriteShape_014.png)
The __Create Range__ button is only visible if the __Preview Handle__ is over an area without an Angle Range (see the example image below).
![Selecting the preview handle](images/2D_SpriteShape_015.png)
### Method 2:
Another way is to hover your cursor over an empty area of the Angle Range circle. An outline appears to show the possible default angle range. Click to create this Angle Range.
![Angle Range outline](images/2D_SpriteShape_017.png)
### Editing the Angle Range degrees
The range covered by the currently selected Angle Range is displayed at the bottom of the tool.
![Enter Angle Range values](images/2D_SpriteShape_018.png)
You can edit a range by entering new values into __Start__ and __End__, or drag either endpoint of the tool to the desired angles. A range cannot be extended into an existing neighboring range. To delete an Angle Range, select the range and then press the __Del/Delete__ key.
## Assigning Sprites
After creating the Angle Ranges, the next step is to assign Sprites to those ranges. The __Sprites__ list is found beneath the __Angle Ranges__ tool. It lists all the Sprites assigned to the selected range.
![Sprite List](images/2D_SpriteShape_019.png)
To add Sprites to the list, click the __+__ icon to insert a new row to the list. Click the circle icon next to the empty row to open the __Object Picker__ window, which displays all available Sprites in the project.
![Adding a row to the list](images/2D_SpriteShape_020.png)
You can also drag a Sprite directly onto a row to add it to the list. The Sprite at the top of the list is the default Sprite displayed on the Sprite Shape. Refer to the other Sprites in the list by their [Sprite Variant](SSController.md) number. See the [Sprite Shape Controller](SSController.md) page for more details.
![Drag and drop Sprites to the row to add to the list](images/2D_SpriteShape_021.png)
Drag the leftmost ends of the rows up or down to reorder the list, which changes the __Sprite Variant__ numbers of the Sprites accordingly.
## Previewing Sprites of multiple Angle Ranges
After assigning Sprites to multiple __Angle Ranges__, rotate the Preview Handle around the Angle Range tool to preview the Sprites assigned those ranges.
![Previewing one range](images/2D_SpriteShape_022.png)
![Previewing the other range](images/2D_SpriteShape_023.png)

View file

@ -0,0 +1,5 @@
* [Overview](index.md)
* [Sprite Shape Profile](SSProfile.md)
* [Sprite Shape Controller](SSController.md)
* [Enabling Collision](SSCollision.md)

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 749 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 742 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -0,0 +1,39 @@
# 2D Sprite Shape
## Overview
The __Sprite Shape__ is a flexible and powerful world building Asset that features Sprite tiling along a shape's outline that automatically deforms and swaps Sprites based on the angle of the outline. Additionally, you can assign a Fill texture to a Sprite Shape to create filled shapes with tiled textures as backgrounds or other large level-building props.
The following are examples of Sprite Shapes used to construct different parts of various levels.
![](images/2D_SpriteShape_1.png)
![](images/2D_SpriteShape_2.png)
![](images/2D_SpriteShape_3.png)
Sprite Shapes comprise of two parts - the [Sprite Shape Profile](SSProfile.md) Asset, and the [Sprite Shape Controller](SSController.md) component. The Sprite Shape Profile contains the angle settings and Sprites used by the Sprite Shape, and you edit the Sprite Shape's outline with the Sprite Shape Controller component.
## Importing Sprites for Sprite Shapes
We recommend using the following settings when importing Sprites for a Sprite Shape:
1. [Texture Type](https://docs.unity3d.com/Manual/TextureTypes.html#Sprite) - Set this to __Sprite (2D and UI)__. Other texture types are not supported for Sprite Shapes.
2. __Sprite Mode__ - Set this to __Single__ if the texture contains only a single Sprite.
3. __Mesh Type__ - Set this to __Full Rect__.
## Sprite Shape Workflow
Create __Sprite Shapes__ in following the steps:
1. Create a __Sprite Shape Profile__ from the main menu (menu: __Assets > Create > Sprite Shape Profile__). Select from the two available options:
- [Open Shape](SSProfile.html#open-shape)
- [Closed Shape](SSProfile.html#closed-shape)
2. Create [Angle Ranges](SSProfile.html#creating-angle-ranges) and [assign Sprites](SSProfile.html#assigning-sprites) in the __Sprite Shape Profile__.
3. Drag the __Sprite Shape Profile__ into the Scene to automatically generate a __Sprite Shape__ GameObject based on that Profile.
- You can create a Sprite Shape GameObject without a Profile from the main menu (menu: __GameObject > 2D Object > Sprite Shape__). Then select a Sprite Shape Profile in the __Sprite Shape Controller__'s __Profile__ settings. The same Profile can be used by multiple Sprite Shapes.
4. Edit the outline of the Sprite Shape with the [Sprite Shape Controller](SSController.md) component settings.
5. Enable [Physics2D](https://docs.unity3d.com/Manual/class-Physics2DManager.html) interactions for your Sprite Shapes by attaching a [Collider](SSCollision.md) component.

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4103ad8b83780496d93e0fabf89b806e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,400 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.U2D;
namespace UnityEditor.U2D.SpriteShape
{
public interface IAngleRangeCache
{
List<AngleRange> angleRanges { get; }
int selectedIndex { get; set; }
float previewAngle { get; set; }
void RegisterUndo(string name);
}
public class AngleRangeController
{
public event Action selectionChanged = () => { };
public IAngleRangeCache cache { get; set; }
public IAngleRangeView view { get; set; }
public float angleOffset { get; set; }
public float radius { get; set; }
public Rect rect { get; set; }
public bool snap { get; set; }
public Color gradientMin { get; set; }
public Color gradientMid { get; set; }
public Color gradientMax { get; set; }
public AngleRange selectedAngleRange
{
get
{
Debug.Assert(cache != null);
AngleRange angleRange = null;
if (cache.selectedIndex >= 0 && cache.selectedIndex < cache.angleRanges.Count)
return cache.angleRanges[cache.selectedIndex];
return angleRange;
}
}
private AngleRange hoveredAngleRange
{
get
{
Debug.Assert(cache != null);
Debug.Assert(view != null);
AngleRange angleRange = null;
if (view.hoveredRangeIndex >= 0 && view.hoveredRangeIndex < cache.angleRanges.Count)
return cache.angleRanges[view.hoveredRangeIndex];
return angleRange;
}
}
public void OnGUI()
{
Debug.Assert(cache != null);
view.SetupLayout(rect, angleOffset, radius);
DoAngleRanges();
HandleSelectAngleRange();
HandleCreateRange();
HandlePreviewSelector();
HandleRemoveRange();
}
private void DoAngleRanges()
{
var removeInvalid = false;
if (view.IsActionTriggering(AngleRangeAction.ModifyRange))
cache.RegisterUndo("Modify Range");
if (view.IsActionFinishing(AngleRangeAction.ModifyRange))
removeInvalid = true;
var index = 0;
foreach (var angleRange in cache.angleRanges)
{
var start = angleRange.start;
var end = angleRange.end;
var isSelected = selectedAngleRange != null && selectedAngleRange == angleRange;
if (view.DoAngleRange(index, rect, radius, angleOffset, ref start, ref end, snap, !isSelected, gradientMin, gradientMid, gradientMax))
SetRange(angleRange, start, end);
++index;
}
if (removeInvalid)
RemoveInvalidRanges();
}
public void RemoveInvalidRanges()
{
var toDelete = new List<AngleRange>();
foreach (var angleRange in cache.angleRanges)
{
var start = angleRange.start;
var end = angleRange.end;
if (start >= end)
toDelete.Add(angleRange);
}
foreach (var angleRange in toDelete)
cache.angleRanges.Remove(angleRange);
if (toDelete.Count > 0)
{
SetSelectedIndexFromPreviewAngle();
view.Repaint();
}
}
private void HandleSelectAngleRange()
{
int newSelected;
if (view.DoSelectAngleRange(cache.selectedIndex, out newSelected))
{
cache.RegisterUndo("Select Angle Range");
cache.previewAngle = view.GetAngleFromPosition(rect, angleOffset);
SelectIndex(newSelected);
}
if (view.IsActionActive(AngleRangeAction.SelectRange))
{
if (hoveredAngleRange == null)
return;
view.DrawAngleRangeOutline(rect, hoveredAngleRange.start, hoveredAngleRange.end, angleOffset, radius);
}
}
private void HandleCreateRange()
{
if (!view.IsActionActive(AngleRangeAction.CreateRange))
return;
var angle = view.GetAngleFromPosition(rect, angleOffset);
var start = 0f;
var end = 0f;
var canCreate = GetNewRangeBounds(angle, out start, out end);
if (canCreate && view.DoCreateRange(rect, radius, angleOffset, start, end))
{
CreateRangeAtAngle(angle);
cache.previewAngle = angle;
SetSelectedIndexFromPreviewAngle();
}
}
private void HandlePreviewSelector()
{
if (view.IsActionTriggering(AngleRangeAction.ModifySelector))
cache.RegisterUndo("Set Preview Angle");
float newAngle;
if (view.DoSelector(rect, angleOffset, radius, cache.previewAngle, out newAngle))
{
if (selectedAngleRange == null)
newAngle = Mathf.Repeat(newAngle + 180f, 360f) - 180f;
cache.previewAngle = newAngle;
SetSelectedIndexFromPreviewAngle();
}
}
private void SetSelectedIndexFromPreviewAngle()
{
var index = SpriteShapeEditorUtility.GetRangeIndexFromAngle(cache.angleRanges, cache.previewAngle);
SelectIndex(index);
}
private void SelectIndex(int index)
{
view.RequestFocusIndex(index);
if (cache.selectedIndex == index)
return;
cache.selectedIndex = index;
selectionChanged();
}
private void ClampPreviewAngle(float start, float end, float prevStart, float prevEnd)
{
var angle = cache.previewAngle;
if (prevStart < start)
{
var a1 = Mathf.Repeat(angle - prevStart, 360f);
var a2 = Mathf.Repeat(angle - start, 360f);
if (a1 < a2)
angle = Mathf.Min(start, end);
}
else if (prevEnd > end)
{
var a1 = Mathf.Repeat(prevEnd - angle, 360f);
var a2 = Mathf.Repeat(end - angle, 360f);
if (a1 < a2)
angle = Mathf.Max(start, end);
}
cache.previewAngle = angle;
}
private void HandleRemoveRange()
{
if (view.DoRemoveRange())
{
cache.RegisterUndo("Remove Range");
cache.angleRanges.RemoveAt(cache.selectedIndex);
SelectIndex(-1);
}
}
public void CreateRange()
{
CreateRangeAtAngle(cache.previewAngle);
}
private void CreateRangeAtAngle(float angle)
{
var start = 0f;
var end = 0f;
if (GetNewRangeBounds(angle, out start, out end))
{
cache.RegisterUndo("Create Range");
var angleRange = new AngleRange();
angleRange.start = start;
angleRange.end = end;
cache.angleRanges.Add(angleRange);
ValidateRange(angleRange);
SetSelectedIndexFromPreviewAngle();
}
}
public void SetRange(AngleRange angleRange, float start, float end)
{
var prevStart = angleRange.start;
var prevEnd = angleRange.end;
angleRange.start = start;
angleRange.end = end;
ValidateRange(angleRange, prevStart, prevEnd);
if (angleRange == selectedAngleRange)
ClampPreviewAngle(start, end, prevStart, prevEnd);
}
private bool GetNewRangeBounds(float angle, out float emptyRangeStart, out float emptyRangeEnd)
{
angle = Mathf.Repeat(angle + 180f, 360f) - 180f;
emptyRangeStart = float.MinValue;
emptyRangeEnd = float.MaxValue;
if (GetAngleRangeAt(angle) != null)
return false;
FindMinMax(out emptyRangeEnd, out emptyRangeStart);
if (angle < emptyRangeStart)
emptyRangeStart -= 360f;
if (angle > emptyRangeEnd)
emptyRangeEnd += 360f;
foreach (var angleRange in cache.angleRanges)
{
var start = angleRange.start;
var end = angleRange.end;
if (angle > end)
emptyRangeStart = Mathf.Max(emptyRangeStart, end);
if (angle < start)
emptyRangeEnd = Mathf.Min(emptyRangeEnd, start);
}
var rangeLength = emptyRangeEnd - emptyRangeStart;
if (rangeLength > 90f)
{
emptyRangeStart = Mathf.Max(angle - 45f, emptyRangeStart);
emptyRangeEnd = Mathf.Min(angle + 45f, emptyRangeEnd);
}
return true;
}
private AngleRange GetAngleRangeAt(float angle)
{
foreach (var angleRange in cache.angleRanges)
{
var start = angleRange.start;
var end = angleRange.end;
var range = end - start;
var angle2 = Mathf.Repeat(angle - start, 360f);
if (angle2 >= 0f && angle2 <= range)
return angleRange;
}
return null;
}
private void FindMinMax(out float min, out float max)
{
min = float.MaxValue;
max = float.MinValue;
foreach (var angleRange in cache.angleRanges)
{
min = Mathf.Min(angleRange.start, min);
max = Mathf.Max(angleRange.end, max);
}
}
private void ValidateRange(AngleRange range)
{
ValidateRange(range, range.start, range.end);
}
private void ValidateRange(AngleRange angleRange, float prevStart, float prevEnd)
{
var start = angleRange.start;
var end = angleRange.end;
foreach (var otherRange in cache.angleRanges)
{
var otherStart = otherRange.start;
var otherEnd = otherRange.end;
if (otherRange == angleRange)
{
if ((start > 180f && end > 180f) || (start < -180f && end < -180f))
{
start = Mathf.Repeat(start + 180f, 360f) - 180f;
end = Mathf.Repeat(end + 180f, 360f) - 180f;
}
otherStart = start + 360f;
otherEnd = end - 360f;
}
ValidateRangeStartEnd(ref start, ref end, prevStart, prevEnd, otherStart, otherEnd);
}
angleRange.start = start;
angleRange.end = end;
}
private void ValidateRangeStartEnd(ref float start, ref float end, float prevStart, float prevEnd, float otherStart, float otherEnd)
{
var min = Mathf.Min(start, otherStart);
var max = Mathf.Max(end, otherEnd);
start -= min;
end -= min;
otherStart -= min;
otherEnd -= min;
prevStart -= min;
prevEnd -= min;
if (prevEnd != end)
end = Mathf.Clamp(end, start, otherStart >= start ? otherStart : 360f);
start += min - max;
end += min - max;
otherStart += min - max;
otherEnd += min - max;
prevStart += min - max;
prevEnd += min - max;
if (prevStart != start)
start = Mathf.Clamp(start, otherEnd <= end ? otherEnd : -360f, end);
start += max;
end += max;
}
}
}

View file

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: a31658f0a7411474fa4e2be61c4f9df2
timeCreated: 1503758178
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,137 @@
using UnityEditor;
using UnityEngine;
using UnityEditor.Sprites;
using System.Collections;
using System.Collections.Generic;
namespace UnityEditor.U2D
{
public class AngleRangeGUI
{
public static readonly int kLeftHandleHashCode = "LeftHandle".GetHashCode();
public static readonly int kRightHandleHashCode = "RightHandle".GetHashCode();
public const float kRangeWidth = 10f;
public static void AngleRangeField(Rect rect, ref float start, ref float end, float angleOffset, float radius, bool snap, bool drawLine, bool drawCircle, Color rangeColor)
{
var leftId = GUIUtility.GetControlID(kLeftHandleHashCode, FocusType.Passive);
var rightId = GUIUtility.GetControlID(kRightHandleHashCode, FocusType.Passive);
AngleRangeField(rect, leftId, rightId, ref start, ref end, angleOffset, radius, snap, drawLine, drawCircle, rangeColor);
}
public static void AngleRangeField(Rect rect, int leftHandleID, int rightHandleID, ref float start, ref float end, float angleOffset, float radius, bool snap, bool drawLine, bool drawCircle, Color rangeColor)
{
Color activeColor = Handles.color;
if (Event.current.type == EventType.Repaint)
{
float range = end - start;
Color color = Handles.color;
Handles.color = rangeColor;
if (range < 0f)
Handles.color = Color.red;
SpriteShapeHandleUtility.DrawSolidArc(rect.center, Vector3.forward, Quaternion.AngleAxis(start + angleOffset, Vector3.forward) * Vector3.right, range, radius, kRangeWidth);
Handles.color = color;
}
EditorGUI.BeginChangeCheck();
float handleSize = 15f;
start = AngleField(rect, leftHandleID, start, angleOffset, new Vector2(-3.5f, -7.5f), start + angleOffset + 90f, handleSize, radius, snap, drawLine, drawCircle, SpriteShapeHandleUtility.RangeLeftCap);
if (EditorGUI.EndChangeCheck())
start = Mathf.Clamp(start, end - 360f, end);
EditorGUI.BeginChangeCheck();
end = AngleField(rect, rightHandleID, end, angleOffset, new Vector2(3.5f, -7.5f), end + angleOffset + 90f, handleSize, radius, snap, drawLine, false, SpriteShapeHandleUtility.RangeRightCap);
if (EditorGUI.EndChangeCheck())
end = Mathf.Clamp(end, end, start + 360f);
Handles.color = activeColor;
}
public static void AngleRangeField(Rect rect, SerializedProperty startProperty, SerializedProperty endProperty, float angleOffset, float radius, bool snap, bool drawLine, bool drawCircle, Color rangeColor)
{
var start = startProperty.floatValue;
var end = endProperty.floatValue;
EditorGUI.BeginChangeCheck();
AngleRangeField(rect, ref start, ref end, angleOffset, radius, snap, drawLine, drawCircle, rangeColor);
if (EditorGUI.EndChangeCheck())
{
startProperty.floatValue = start;
endProperty.floatValue = end;
}
}
public static void AngleField(int id, SerializedProperty property, float angleOffset, Vector2 handleOffset, float handleAngle, float handleSize, float radius, bool snap, bool drawLine, bool drawCircle, Handles.CapFunction drawCapFunction)
{
EditorGUI.BeginChangeCheck();
float value = AngleField(id, property.floatValue, angleOffset, handleOffset, handleAngle, handleSize, radius, snap, drawLine, drawCircle, drawCapFunction);
if (EditorGUI.EndChangeCheck())
{
property.floatValue = value;
}
}
public static void AngleField(Rect r, int id, SerializedProperty property, float angleOffset, Vector2 handleOffset, float handleAngle, float handleSize, float radius, bool snap, bool drawLine, bool drawCircle, Handles.CapFunction drawCapFunction)
{
EditorGUI.BeginChangeCheck();
float value = AngleField(r, id, property.floatValue, angleOffset, handleOffset, handleAngle, handleSize, radius, snap, drawLine, drawCircle, drawCapFunction);
if (EditorGUI.EndChangeCheck())
{
property.floatValue = value;
}
}
public static float AngleField(int id, float angle, float angleOffset, Vector2 handleOffset, float handleAngle, float radius, float handleSize, bool snap, bool drawLine, bool drawCircle, Handles.CapFunction drawCapFunction)
{
Rect rect = EditorGUILayout.GetControlRect(false, radius * 2f);
return AngleField(rect, id, angle, angleOffset, handleOffset, handleAngle, radius, handleSize, snap, drawLine, drawCircle, drawCapFunction);
}
public static float AngleField(Rect rect, int id, float angle, float angleOffset, Vector2 handleOffset, float handleAngle, float handleSize, float radius, bool snap, bool drawLine, bool drawCircle, Handles.CapFunction drawCapFunction)
{
float offsetedAngle = angle + angleOffset;
Vector2 pos = new Vector2(Mathf.Cos(offsetedAngle * Mathf.Deg2Rad), Mathf.Sin(offsetedAngle * Mathf.Deg2Rad)) * radius + rect.center;
if (Event.current.type == EventType.Repaint)
{
if (drawCircle)
Handles.DrawWireDisc(rect.center, Vector3.forward, radius);
if (drawLine)
Handles.DrawLine(rect.center, pos);
}
if (GUI.enabled)
{
EditorGUI.BeginChangeCheck();
Quaternion rotation = Quaternion.AngleAxis(handleAngle, Vector3.forward);
Vector2 posNew = SpriteShapeHandleUtility.Slider2D(id, pos, rotation * handleOffset, rotation, handleSize, drawCapFunction);
if (EditorGUI.EndChangeCheck())
{
Vector2 v1 = pos - rect.center;
Vector2 v2 = posNew - rect.center;
float angleDirection = Mathf.Sign(Vector3.Dot(Vector3.forward, Vector3.Cross(v1, v2)));
float angleIncrement = Vector2.Angle(v1, v2);
angle += angleIncrement * angleDirection;
if (snap)
angle = Mathf.RoundToInt(angle);
}
}
return angle;
}
}
}

View file

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: c5b7a6d3ca9063e4faeefb6613a86c7c
timeCreated: 1503758178
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,336 @@
using UnityEditor;
using UnityEngine;
using UnityEditor.Sprites;
using System.Collections;
using System.Collections.Generic;
namespace UnityEditor.U2D
{
public enum AngleRangeAction
{
SelectRange,
ModifyRange,
CreateRange,
ModifySelector,
RemoveRange,
}
public interface IAngleRangeView
{
int hoveredRangeIndex { get; }
void RequestFocusIndex(int index);
float GetAngleFromPosition(Rect rect, float angleOffset);
void Repaint();
void SetupLayout(Rect rect, float angleOffset, float radius);
bool DoAngleRange(int index, Rect rect, float radius, float angleOffset, ref float start, ref float end, bool snap, bool disabled, Color gradientMin, Color gradientMid, Color gradientMax);
bool DoSelectAngleRange(int currentSelected, out int newSelected);
bool DoCreateRange(Rect rect, float radius, float angleOffset, float start, float end);
void DoCreateRangeTooltip();
bool DoSelector(Rect rect, float angleOffset, float radius, float angle, out float newAngle);
bool DoRemoveRange();
bool IsActionActive(AngleRangeAction action);
bool IsActionTriggering(AngleRangeAction action);
bool IsActionFinishing(AngleRangeAction action);
void DrawAngleRangeOutline(Rect rect, float start, float end, float angleOffset, float radius);
}
public class AngleRangeView : IAngleRangeView
{
const string kDeleteCommandName = "Delete";
const string kSoftDeleteCommandName = "SoftDelete";
static readonly int kAngleRangeHashCode = "AngleRange".GetHashCode();
static readonly int kCreateRangeHashCode = "CreateRange".GetHashCode();
static readonly int kSelectorHashCode = "Selector".GetHashCode();
private static Color kHightlightColor = new Color(0.25f, 0.5f, 1.0f);
private static Color kNoKeboardFocusColor = new Color(0.3f, 0.5f, 0.65f);
private static class Contents
{
public static readonly GUIContent addRangeTooltip = new GUIContent("", "Click to add a new range");
}
private int m_FocusedRangeControlID = -1;
private int m_HoveredRangeIndex = -1;
private int m_HoveredRangeID = -1;
private int m_HoveredHandleID = -1;
private int m_HotHandleID = -1;
private int m_CreateRangeControlID = -1;
private int m_SelectorControlID = -1;
private int m_RequestFocusIndex = -1;
public int hoveredRangeIndex { get { return m_HoveredRangeIndex; } }
public void RequestFocusIndex(int index)
{
GUIUtility.keyboardControl = 0;
m_RequestFocusIndex = index;
}
public float GetAngleFromPosition(Rect rect, float angleOffset)
{
return Mathf.RoundToInt(SpriteShapeHandleUtility.PosToAngle(Event.current.mousePosition, rect.center, -angleOffset));
}
public void Repaint()
{
HandleUtility.Repaint();
}
public void SetupLayout(Rect rect, float angleOffset, float radius)
{
m_CreateRangeControlID = GUIUtility.GetControlID(kCreateRangeHashCode, FocusType.Passive);
m_SelectorControlID = GUIUtility.GetControlID(kSelectorHashCode, FocusType.Passive);
LayoutCreateRange(rect, angleOffset, radius);
if (Event.current.type == EventType.Layout)
{
m_HoveredRangeIndex = -1;
m_HoveredRangeID = -1;
m_HoveredHandleID = -1;
if (GUIUtility.hotControl == 0)
{
m_HotHandleID = -1;
}
}
}
private void LayoutCreateRange(Rect rect, float angleOffset, float radius)
{
if (Event.current.type == EventType.Layout)
{
var mousePosition = Event.current.mousePosition;
var distance = SpriteShapeHandleUtility.DistanceToArcWidth(mousePosition, rect.center, 0f, 360f, radius, AngleRangeGUI.kRangeWidth, angleOffset);
HandleUtility.AddControl(m_CreateRangeControlID, distance);
}
}
public bool DoAngleRange(int index, Rect rect, float radius, float angleOffset, ref float start, ref float end, bool snap, bool disabled, Color gradientMin, Color gradientMid, Color gradientMax)
{
var changed = false;
var controlID = GUIUtility.GetControlID(kAngleRangeHashCode, FocusType.Passive);
var leftHandleId = GUIUtility.GetControlID(AngleRangeGUI.kLeftHandleHashCode, FocusType.Passive);
var rightHandleId = GUIUtility.GetControlID(AngleRangeGUI.kRightHandleHashCode, FocusType.Passive);
if (Event.current.type == EventType.Layout)
{
var distance = SpriteShapeHandleUtility.DistanceToArcWidth(Event.current.mousePosition, rect.center, start, end, radius, AngleRangeGUI.kRangeWidth, angleOffset);
HandleUtility.AddControl(controlID, distance);
if (HandleUtility.nearestControl == controlID)
{
m_HoveredRangeIndex = index;
m_HoveredRangeID = controlID;
}
}
if (IsActionTriggering(AngleRangeAction.ModifyRange))
{
m_HotHandleID = m_HoveredHandleID;
GrabKeyboardFocus(controlID);
}
if (m_RequestFocusIndex == index)
{
GrabKeyboardFocus(controlID);
if (Event.current.type == EventType.Repaint)
m_RequestFocusIndex = -1;
}
using (new EditorGUI.DisabledScope(disabled))
{
var midAngle = (end - start) * 0.5f + start;
var t = 2f * (midAngle + 180f) / 360f;
var color = gradientMin;
if (t < 1f)
color = Color.Lerp(gradientMin, gradientMid, t);
else
color = Color.Lerp(gradientMid, gradientMax, t - 1f);
if (!disabled)
{
color = kNoKeboardFocusColor;
if (HasKeyboardFocus())
color = kHightlightColor;
}
EditorGUI.BeginChangeCheck();
AngleRangeGUI.AngleRangeField(rect, leftHandleId, rightHandleId, ref start, ref end, angleOffset, radius, snap, false, false, color);
changed = EditorGUI.EndChangeCheck();
}
//Extra Layout from handles
if (Event.current.type == EventType.Layout &&
(HandleUtility.nearestControl == leftHandleId || HandleUtility.nearestControl == rightHandleId))
{
m_HoveredRangeIndex = index;
m_HoveredRangeID = controlID;
m_HoveredHandleID = HandleUtility.nearestControl;
}
return changed;
}
public bool DoSelectAngleRange(int currentSelected, out int newSelected)
{
newSelected = currentSelected;
if (IsActionTriggering(AngleRangeAction.SelectRange))
{
newSelected = m_HoveredRangeIndex;
GUI.changed = true;
Repaint();
HandleUtility.nearestControl = m_SelectorControlID;
return true;
}
return false;
}
public bool DoCreateRange(Rect rect, float radius, float angleOffset, float start, float end)
{
if (IsActionTriggering(AngleRangeAction.CreateRange))
{
GUI.changed = true;
HandleUtility.nearestControl = m_SelectorControlID;
return true;
}
if (IsActionActive(AngleRangeAction.CreateRange))
{
DrawAngleRangeOutline(rect, start, end, angleOffset, radius);
if (Event.current.type == EventType.MouseMove)
Repaint();
}
return false;
}
public void DoCreateRangeTooltip()
{
if (IsActionActive(AngleRangeAction.CreateRange))
{
var mousePosition = Event.current.mousePosition;
EditorGUI.LabelField(new Rect(mousePosition, new Vector2(1f, 20f)), Contents.addRangeTooltip);
}
}
public bool DoSelector(Rect rect, float angleOffset, float radius, float angle, out float newAngle)
{
EditorGUI.BeginChangeCheck();
newAngle = AngleRangeGUI.AngleField(rect, m_SelectorControlID, angle, angleOffset, Vector2.down * 7.5f, angle, 15f, radius - AngleRangeGUI.kRangeWidth, true, true, false, SpriteShapeHandleUtility.PlayHeadCap);
return EditorGUI.EndChangeCheck();
}
public bool DoRemoveRange()
{
EventType eventType = Event.current.type;
if (IsActionTriggering(AngleRangeAction.RemoveRange))
{
Event.current.Use();
GUI.changed = true;
return true;
}
return false;
}
public bool IsActionActive(AngleRangeAction action)
{
if (GUIUtility.hotControl != 0)
return false;
if (action == AngleRangeAction.SelectRange)
return HandleUtility.nearestControl == m_HoveredRangeID;
if (action == AngleRangeAction.ModifyRange)
return HandleUtility.nearestControl == m_HoveredHandleID;
if (action == AngleRangeAction.CreateRange)
return HandleUtility.nearestControl == m_CreateRangeControlID;
if (action == AngleRangeAction.ModifySelector)
return HandleUtility.nearestControl == m_SelectorControlID;
if (action == AngleRangeAction.RemoveRange)
return HasKeyboardFocus();
return false;
}
public bool IsActionHot(AngleRangeAction action)
{
if (GUIUtility.hotControl == 0)
return false;
if (action == AngleRangeAction.ModifyRange)
return GUIUtility.hotControl == m_HotHandleID;
return false;
}
public bool IsActionTriggering(AngleRangeAction action)
{
if (!IsActionActive(action))
return false;
EventType eventType = Event.current.type;
if (action == AngleRangeAction.RemoveRange)
{
if ((eventType == EventType.ValidateCommand || eventType == EventType.ExecuteCommand)
&& (Event.current.commandName == kSoftDeleteCommandName || Event.current.commandName == kDeleteCommandName))
{
if (eventType == EventType.ExecuteCommand)
return true;
Event.current.Use();
}
return false;
}
return eventType == EventType.MouseDown && Event.current.button == 0;
}
public bool IsActionFinishing(AngleRangeAction action)
{
if (!IsActionHot(action))
return false;
return (Event.current.type == EventType.MouseUp && Event.current.button == 0) || Event.current.type == EventType.Ignore;
}
public void DrawAngleRangeOutline(Rect rect, float start, float end, float angleOffset, float radius)
{
if (Event.current.type == EventType.Repaint)
SpriteShapeHandleUtility.DrawRangeOutline(start, end, angleOffset, rect.center, radius, AngleRangeGUI.kRangeWidth - 1f);
}
private void GrabKeyboardFocus(int controlID)
{
m_FocusedRangeControlID = controlID;
GUIUtility.keyboardControl = controlID;
}
private bool HasKeyboardFocus()
{
return GUIUtility.keyboardControl == m_FocusedRangeControlID;
}
}
}

View file

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: 56b5f4e1cb3304201b11247e0fb1eec7
timeCreated: 1503758178
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,43 @@
using UnityEngine;
using UnityEngine.U2D;
using UnityEditor.U2D.SpriteShape;
namespace UnityEditor.U2D
{
public class ContextMenu
{
private static AngleRange CreateAngleRange(float start, float end, int order)
{
AngleRange angleRange = new AngleRange();
angleRange.start = start;
angleRange.end = end;
angleRange.order = order;
return angleRange;
}
[MenuItem("Assets/Create/Sprite Shape Profile/Open Shape", false, 358)]
public static void CreateNewSpriteStrip()
{
UnityEngine.U2D.SpriteShape newSpriteShape = SpriteShapeEditorUtility.CreateSpriteShapeAsset();
newSpriteShape.angleRanges.Add(CreateAngleRange(-180.0f, 180.0f, 0));
}
[MenuItem("Assets/Create/Sprite Shape Profile/Closed Shape", false, 359)]
public static void CreateNewSpriteShape()
{
UnityEngine.U2D.SpriteShape newSpriteShape = SpriteShapeEditorUtility.CreateSpriteShapeAsset();
newSpriteShape.angleRanges.Add(CreateAngleRange(-45.0f, 45.0f, 4));
newSpriteShape.angleRanges.Add(CreateAngleRange(-135.0f, -45.0f, 3));
newSpriteShape.angleRanges.Add(CreateAngleRange(135.0f, 225.0f, 2));
newSpriteShape.angleRanges.Add(CreateAngleRange(45.0f, 135.0f, 1));
}
[MenuItem("GameObject/2D Object/Sprite Shape")]
internal static void CreateSpriteShapeEmpty()
{
SpriteShapeEditorUtility.SetShapeFromAsset(SpriteShapeEditorUtility.CreateSpriteShapeControllerFromSelection());
}
}
}

View file

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: 98a4cc9d9dadb844e8669b0665d53897
timeCreated: 1503992201
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,236 @@
using UnityEditor;
using UnityEngine;
using UnityEditor.Sprites;
using System.Collections;
using System.Collections.Generic;
namespace UnityEditor.U2D
{
public static class EditorSpriteGUIUtility
{
public enum FitMode
{
BestFit,
FitHorizontal,
FitVertical,
Fill,
Tiled
}
private static Material s_SpriteMaterial;
public static Material spriteMaterial
{
get
{
if (s_SpriteMaterial == null)
{
s_SpriteMaterial = new Material(Shader.Find("Hidden/InternalSpritesInspector"));
s_SpriteMaterial.hideFlags = HideFlags.DontSave;
}
s_SpriteMaterial.SetFloat("_AdjustLinearForGamma", PlayerSettings.colorSpace == ColorSpace.Linear ? 1.0f : 0.0f);
return s_SpriteMaterial;
}
}
public static Texture GetOriginalSpriteTexture(Sprite sprite)
{
return UnityEditor.Sprites.SpriteUtility.GetSpriteTexture(sprite, false);
}
public static Vector2[] GetOriginalSpriteUvs(Sprite sprite)
{
return UnityEditor.Sprites.SpriteUtility.GetSpriteUVs(sprite, false);
}
public static void DrawSpriteInRectPrepare(Rect rect, Sprite sprite, FitMode fitMode, bool excludeBorders, bool forceQuad, Mesh mesh)
{
var vertices = new List<Vector3>();
var uvs = new List<Vector2>();
var indices = new List<int>();
mesh.Clear();
if (!sprite)
{
mesh.UploadMeshData(false);
return;
}
Vector2 scale = Vector2.one;
Rect spriteRect = sprite.textureRect;
Vector2 bottomLeftBorderOffset = sprite.rect.position + new Vector2(sprite.border.x, sprite.border.y) - spriteRect.position;
Vector2 topRightBorderOffset = new Vector2(sprite.border.z, sprite.border.w) + (spriteRect.position + spriteRect.size) - (sprite.rect.position + sprite.rect.size);
if (excludeBorders)
{
forceQuad = true;
spriteRect.position = spriteRect.position + bottomLeftBorderOffset;
spriteRect.size = spriteRect.size - bottomLeftBorderOffset - topRightBorderOffset;
}
bool tiled = false;
if (fitMode == FitMode.Tiled)
{
tiled = true;
forceQuad = true;
fitMode = FitMode.BestFit;
}
if (fitMode == FitMode.BestFit)
{
float spriteRatio = spriteRect.width / spriteRect.height;
float frameRatio = rect.width / rect.height;
if (spriteRatio < frameRatio)
fitMode = FitMode.FitVertical;
else
fitMode = FitMode.FitHorizontal;
}
if (fitMode == FitMode.FitHorizontal)
scale = Vector2.one * (rect.width / spriteRect.width);
if (fitMode == FitMode.FitVertical)
scale = Vector2.one * (rect.height / spriteRect.height);
if (fitMode == FitMode.Fill)
{
scale.x = rect.width / spriteRect.width;
scale.y = rect.height / spriteRect.height;
}
Texture spriteTexture = GetOriginalSpriteTexture(sprite);
if (spriteTexture == null)
return;
if (forceQuad)
{
Vector2 uvScale = new Vector2(1f / spriteTexture.width, 1f / spriteTexture.height);
Vector2 uvPos = Vector2.Scale(spriteRect.position, uvScale);
Vector2 uvSize = Vector2.Scale(spriteRect.size, uvScale);
Vector2 uv0 = uvPos;
Vector2 uv1 = uvPos + Vector2.up * uvSize.y;
Vector2 uv2 = uvPos + Vector2.right * uvSize.x;
Vector2 uv3 = uvPos + uvSize;
Vector3 v0 = new Vector3(uv0.x * spriteTexture.width - spriteRect.position.x - spriteRect.width * 0.5f, uv0.y * spriteTexture.height - spriteRect.position.y - spriteRect.height * 0.5f, 0f);
Vector3 v1 = new Vector3(uv1.x * spriteTexture.width - spriteRect.position.x - spriteRect.width * 0.5f, uv1.y * spriteTexture.height - spriteRect.position.y - spriteRect.height * 0.5f, 0f);
Vector3 v2 = new Vector3(uv2.x * spriteTexture.width - spriteRect.position.x - spriteRect.width * 0.5f, uv2.y * spriteTexture.height - spriteRect.position.y - spriteRect.height * 0.5f, 0f);
Vector3 v3 = new Vector3(uv3.x * spriteTexture.width - spriteRect.position.x - spriteRect.width * 0.5f, uv3.y * spriteTexture.height - spriteRect.position.y - spriteRect.height * 0.5f, 0f);
v0 = Vector3.Scale(v0, scale);
v1 = Vector3.Scale(v1, scale);
v2 = Vector3.Scale(v2, scale);
v3 = Vector3.Scale(v3, scale);
//TODO: Support vertical tiling when horizontal fitted
if (tiled && fitMode == FitMode.FitVertical)
{
Vector2 scaledRectSize = Vector2.Scale(rect.size, new Vector2(1f / scale.x, 1f / scale.y));
float halfDistanceToFill = (scaledRectSize.x - spriteRect.width) * 0.5f;
int halfFillSegmentCount = (int)Mathf.Ceil(halfDistanceToFill / spriteRect.width);
int segmentCount = halfFillSegmentCount * 2 + 1;
int vertexCount = segmentCount * 4;
vertices.Capacity = vertexCount;
uvs.Capacity = vertexCount;
indices.Capacity = vertexCount;
Vector3 offset = Vector3.zero;
Vector3 offsetStep = Vector3.Scale(Vector3.right * spriteRect.width, scale);
float distanceStep = spriteRect.width;
float distanceToFill = halfDistanceToFill + distanceStep;
int vertexIndex = 0;
for (int i = 0; i <= halfFillSegmentCount; ++i)
{
float t = Mathf.Clamp01(distanceToFill / spriteRect.width);
uvs.Add(uv0);
uvs.Add(uv1);
uvs.Add(Vector3.Lerp(uv0, uv2, t));
uvs.Add(Vector3.Lerp(uv1, uv3, t));
vertices.Add(v0 + offset);
vertices.Add(v1 + offset);
vertices.Add(Vector3.Lerp(v0, v2, t) + offset);
vertices.Add(Vector3.Lerp(v1, v3, t) + offset);
indices.Add(vertexIndex);
indices.Add(vertexIndex + 2);
indices.Add(vertexIndex + 1);
indices.Add(vertexIndex + 2);
indices.Add(vertexIndex + 3);
indices.Add(vertexIndex + 1);
vertexIndex += 4;
if (i > 0)
{
uvs.Add(Vector2.Lerp(uv0, uv2, 1f - t));
uvs.Add(Vector2.Lerp(uv1, uv3, 1f - t));
uvs.Add(uv2);
uvs.Add(uv3);
vertices.Add(Vector3.Lerp(v0, v2, 1f - t) - offset);
vertices.Add(Vector3.Lerp(v1, v3, 1f - t) - offset);
vertices.Add(v2 - offset);
vertices.Add(v3 - offset);
indices.Add(vertexIndex);
indices.Add(vertexIndex + 2);
indices.Add(vertexIndex + 1);
indices.Add(vertexIndex + 2);
indices.Add(vertexIndex + 3);
indices.Add(vertexIndex + 1);
vertexIndex += 4;
}
offset += offsetStep;
distanceToFill -= distanceStep;
}
}
else
{
vertices.AddRange(new Vector3[] { v0, v1, v2, v3 });
uvs.AddRange(new Vector2[] { uv0, uv1, uv2, uv3 });
indices.AddRange(new int[] { 0, 2, 1, 2, 3, 1 });
}
}
else
{
ushort[] triangles = sprite.triangles;
indices.Capacity = triangles.Length;
for (int i = 0; i < triangles.Length; ++i)
indices.Add((int)triangles[i]);
uvs.AddRange(GetOriginalSpriteUvs(sprite));
vertices.Capacity = uvs.Count;
for (int i = 0; i < uvs.Count; ++i)
{
Vector3 v = new Vector3(uvs[i].x * spriteTexture.width - spriteRect.position.x - spriteRect.width * 0.5f, uvs[i].y * spriteTexture.height - spriteRect.position.y - spriteRect.height * 0.5f, 0f);
vertices.Add(Vector3.Scale(v, scale));
}
}
mesh.SetVertices(vertices);
mesh.SetUVs(0, uvs);
mesh.SetTriangles(indices, 0);
mesh.UploadMeshData(false);
}
public static void DrawMesh(Mesh mesh, Material material, Vector3 position, Quaternion rotation, Vector3 scale)
{
if (Event.current.type != EventType.Repaint)
return;
Matrix4x4 matrix = new Matrix4x4();
matrix.SetTRS(position, rotation, scale);
material.SetPass(0);
Graphics.DrawMeshNow(mesh, matrix);
}
}
}

View file

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: aff60f81fc1eab749a82103779466d07
timeCreated: 1503758178
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 15cbf89e8ba92694cb870a55b60f1b81
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2ba760cb26319f14f86529637445de30
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,83 @@
// Texture is forced to be in Gamma space regardless of the active ColorSpace.
Shader "Hidden/InternalSpritesInspector"
{
Properties
{
[PerRendererData] _MainTex("Sprite Texture", 2D) = "white" {}
_Color("Tint", Color) = (1, 1, 1, 1)
[MaterialToggle] PixelSnap("Pixel snap", Float) = 0
}
SubShader
{
Tags
{
"Queue" = "Transparent"
"IgnoreProjector" = "True"
"RenderType" = "Transparent"
"PreviewType" = "Plane"
"CanUseSpriteAtlas" = "True"
}
Cull Off
Lighting Off
ZWrite Off
Fog{ Mode Off }
Blend SrcAlpha OneMinusSrcAlpha
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile DUMMY PIXELSNAP_ON
#include "UnityCG.cginc"
uniform bool _AdjustLinearForGamma;
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
half2 texcoord : TEXCOORD0;
float2 clipUV : TEXCOORD1;
};
fixed4 _Color;
uniform float4x4 unity_GUIClipTextureMatrix;
v2f vert(appdata_t IN)
{
float3 screenUV = UnityObjectToViewPos(IN.vertex);
v2f OUT;
OUT.vertex = UnityObjectToClipPos(IN.vertex);
OUT.texcoord = IN.texcoord;
OUT.color = IN.color * _Color;
OUT.clipUV = mul(unity_GUIClipTextureMatrix, float4(screenUV.xy, 0, 1.0));
return OUT;
}
sampler2D _MainTex;
sampler2D _GUIClipTexture;
fixed4 frag(v2f IN) : COLOR
{
fixed4 col = tex2D(_MainTex, IN.texcoord);
fixed alpha = col.a;
if (_AdjustLinearForGamma)
col.rgb = LinearToGammaSpace(col.rgb);
col.a = alpha * tex2D(_GUIClipTexture, IN.clipUV).a;
return col * IN.color;
}
ENDCG
}
}
}

View file

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 603d454d711fe784cba9ce08dd22b881
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1,91 @@
fileFormatVersion: 2
guid: 9417efc47083f4a1598c1966a6345cdb
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 1
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View file

@ -0,0 +1,91 @@
fileFormatVersion: 2
guid: 9ea72647c24be493ba6f15a9cd2a24ae
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 1
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1,91 @@
fileFormatVersion: 2
guid: ee5df01235032491c8b180741ea820fe
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 1
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 574ba49617df66b40a29fe7f0b185aab
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View file

@ -0,0 +1,107 @@
fileFormatVersion: 2
guid: 0a9a0f36a52ce7f4d813fbf5d8f76a1c
timeCreated: 1505457322
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 4
mipmaps:
mipMapMode: 1
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: -1
mipBias: -1
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 0
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: tvOS
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

Some files were not shown because too many files have changed in this diff Show more