mirror of
https://github.com/mob-sakai/UIEffect.git
synced 2026-12-01 10:12:38 +08:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8ba8ada3f2 | |||
| d877a9f4c1 | |||
| fd1e9bcaf2 | |||
| 78f7c2f789 | |||
| 8b00091539 |
@@ -1,3 +1,11 @@
|
|||||||
|
# [5.13.0](https://github.com/mob-sakai/UIEffect/compare/5.12.1...5.13.0) (2026-11-25)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add gradient reverse button ([78f7c2f](https://github.com/mob-sakai/UIEffect/commit/78f7c2f789fb4af0ad2eb7accfb111eb9adccd4e))
|
||||||
|
* add paste color/gradient button (from css code) ([fd1e9bc](https://github.com/mob-sakai/UIEffect/commit/fd1e9bcaf2fc4a620c7902243df1115306c43c70)), closes [#389](https://github.com/mob-sakai/UIEffect/issues/389)
|
||||||
|
|
||||||
## [5.12.1](https://github.com/mob-sakai/UIEffect/compare/5.12.0...5.12.1) (2026-11-24)
|
## [5.12.1](https://github.com/mob-sakai/UIEffect/compare/5.12.0...5.12.1) (2026-11-24)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 195d371d8be894451a95368b19109420
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,109 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8c562a51524754926a36370d17d4b181
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 12
|
||||||
|
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
|
||||||
|
vTOnly: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: 1
|
||||||
|
aniso: 1
|
||||||
|
mipBias: 0
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: 0
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
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: 2
|
||||||
|
textureShape: 1
|
||||||
|
singleChannelComponent: 0
|
||||||
|
flipbookRows: 1
|
||||||
|
flipbookColumns: 1
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
ignorePngGamma: 0
|
||||||
|
applyGammaDecoding: 0
|
||||||
|
cookieLightType: 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: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Standalone
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID:
|
||||||
|
internalID: 0
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
secondaryTextures: []
|
||||||
|
spritePackingTag:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
pSDShowRemoveMatteOption: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1,109 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4075e0c7a9e2c4f4d8f9e3c34e3e59a3
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 12
|
||||||
|
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
|
||||||
|
vTOnly: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: 1
|
||||||
|
aniso: 1
|
||||||
|
mipBias: 0
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: 0
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
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: 2
|
||||||
|
textureShape: 1
|
||||||
|
singleChannelComponent: 0
|
||||||
|
flipbookRows: 1
|
||||||
|
flipbookColumns: 1
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
ignorePngGamma: 0
|
||||||
|
applyGammaDecoding: 0
|
||||||
|
cookieLightType: 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: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Standalone
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID:
|
||||||
|
internalID: 0
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
secondaryTextures: []
|
||||||
|
spritePackingTag:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
pSDShowRemoveMatteOption: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
+3
-5
@@ -20,11 +20,10 @@ TextureImporter:
|
|||||||
externalNormalMap: 0
|
externalNormalMap: 0
|
||||||
heightScale: 0.25
|
heightScale: 0.25
|
||||||
normalMapFilter: 0
|
normalMapFilter: 0
|
||||||
isReadable: 1
|
isReadable: 0
|
||||||
streamingMipmaps: 0
|
streamingMipmaps: 0
|
||||||
streamingMipmapsPriority: 0
|
streamingMipmapsPriority: 0
|
||||||
vTOnly: 0
|
vTOnly: 0
|
||||||
ignoreMasterTextureLimit: 0
|
|
||||||
grayScaleToAlpha: 0
|
grayScaleToAlpha: 0
|
||||||
generateCubemap: 6
|
generateCubemap: 6
|
||||||
cubemapConvolution: 0
|
cubemapConvolution: 0
|
||||||
@@ -91,9 +90,9 @@ TextureImporter:
|
|||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Standalone
|
buildTarget: Standalone
|
||||||
maxTextureSize: 64
|
maxTextureSize: 2048
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
textureFormat: 12
|
textureFormat: -1
|
||||||
textureCompression: 1
|
textureCompression: 1
|
||||||
compressionQuality: 50
|
compressionQuality: 50
|
||||||
crunchedCompression: 0
|
crunchedCompression: 0
|
||||||
@@ -150,7 +149,6 @@ TextureImporter:
|
|||||||
edges: []
|
edges: []
|
||||||
weights: []
|
weights: []
|
||||||
secondaryTextures: []
|
secondaryTextures: []
|
||||||
nameFileIdTable: {}
|
|
||||||
spritePackingTag:
|
spritePackingTag:
|
||||||
pSDRemoveMatte: 0
|
pSDRemoveMatte: 0
|
||||||
pSDShowRemoveMatteOption: 0
|
pSDShowRemoveMatteOption: 0
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 522 B |
@@ -0,0 +1,109 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b776aab5f71a54c63afd46d6987707e7
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 12
|
||||||
|
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
|
||||||
|
vTOnly: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: 1
|
||||||
|
aniso: 1
|
||||||
|
mipBias: 0
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: 0
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
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: 2
|
||||||
|
textureShape: 1
|
||||||
|
singleChannelComponent: 0
|
||||||
|
flipbookRows: 1
|
||||||
|
flipbookColumns: 1
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
ignorePngGamma: 0
|
||||||
|
applyGammaDecoding: 0
|
||||||
|
cookieLightType: 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: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Standalone
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID:
|
||||||
|
internalID: 0
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
secondaryTextures: []
|
||||||
|
spritePackingTag:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
pSDShowRemoveMatteOption: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 547 B |
@@ -0,0 +1,109 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5634431eb895c4ff6bf61ddd65c83608
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 12
|
||||||
|
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
|
||||||
|
vTOnly: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: 1
|
||||||
|
aniso: 1
|
||||||
|
mipBias: 0
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: 0
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
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: 2
|
||||||
|
textureShape: 1
|
||||||
|
singleChannelComponent: 0
|
||||||
|
flipbookRows: 1
|
||||||
|
flipbookColumns: 1
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
ignorePngGamma: 0
|
||||||
|
applyGammaDecoding: 0
|
||||||
|
cookieLightType: 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: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Standalone
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID:
|
||||||
|
internalID: 0
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
secondaryTextures: []
|
||||||
|
spritePackingTag:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
pSDShowRemoveMatteOption: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,146 @@
|
|||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Coffee.UIEffects.Editors
|
||||||
|
{
|
||||||
|
internal static class PasteColorUtil
|
||||||
|
{
|
||||||
|
internal const string SupportedFormats =
|
||||||
|
"hex values (#RGB, #RRGGBB, #RGBA, #RRGGBBAA), Unity-supported color names, transparent, rgb(), and rgba()";
|
||||||
|
|
||||||
|
internal static void PasteFromClipboard(SerializedProperty color)
|
||||||
|
{
|
||||||
|
if (!TryParseColor(GUIUtility.systemCopyBuffer, out var value))
|
||||||
|
{
|
||||||
|
EditorUtility.DisplayDialog("Paste Color",
|
||||||
|
$"Supported formats are {SupportedFormats}, or CSS background/background-color declarations containing one of these values.",
|
||||||
|
"OK");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
color.colorValue = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static bool TryParseColor(string text, out Color color)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(text))
|
||||||
|
{
|
||||||
|
color = default;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TryExtractCssColorValue(text, out var cssColor))
|
||||||
|
{
|
||||||
|
text = cssColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
text = text.Trim();
|
||||||
|
if (text.Equals("transparent", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
color = Color.clear;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ColorUtility.TryParseHtmlString(text, out color))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
var openIndex = text.IndexOf('(');
|
||||||
|
if (openIndex < 0 || text[text.Length - 1] != ')')
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var function = text.Substring(0, openIndex).Trim();
|
||||||
|
var isRgba = function.Equals("rgba", StringComparison.OrdinalIgnoreCase);
|
||||||
|
if (!isRgba && !function.Equals("rgb", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var components = text.Substring(openIndex + 1, text.Length - openIndex - 2)
|
||||||
|
.Split(new[] { ' ', '\t', '\r', '\n', ',', '/' }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
if (components.Length != 3 && components.Length != 4)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((isRgba && components.Length != 4)
|
||||||
|
|| !TryParseRgbComponent(components[0], out var red)
|
||||||
|
|| !TryParseRgbComponent(components[1], out var green)
|
||||||
|
|| !TryParseRgbComponent(components[2], out var blue))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var alpha = 1f;
|
||||||
|
if (components.Length == 4 && !TryParseAlphaComponent(components[3], out alpha))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
color = new Color(red, green, blue, alpha);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool TryExtractCssColorValue(string text, out string value)
|
||||||
|
{
|
||||||
|
foreach (var declaration in text.Split(';'))
|
||||||
|
{
|
||||||
|
var separatorIndex = declaration.IndexOf(':');
|
||||||
|
if (separatorIndex < 0)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var property = declaration.Substring(0, separatorIndex).Trim();
|
||||||
|
var commentEndIndex = property.LastIndexOf("*/", StringComparison.Ordinal);
|
||||||
|
if (commentEndIndex >= 0)
|
||||||
|
{
|
||||||
|
property = property.Substring(commentEndIndex + 2).Trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (property.Equals("background", StringComparison.OrdinalIgnoreCase)
|
||||||
|
|| property.Equals("background-color", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
value = declaration.Substring(separatorIndex + 1).Trim();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
value = null;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool TryParseRgbComponent(string text, out float value)
|
||||||
|
{
|
||||||
|
var isPercentage = text.EndsWith("%", StringComparison.Ordinal);
|
||||||
|
if (!float.TryParse(isPercentage ? text.Substring(0, text.Length - 1) : text,
|
||||||
|
NumberStyles.Float, CultureInfo.InvariantCulture, out value)
|
||||||
|
|| float.IsNaN(value) || float.IsInfinity(value))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
value = Mathf.Clamp01(isPercentage ? value / 100f : value / 255f);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool TryParseAlphaComponent(string text, out float value)
|
||||||
|
{
|
||||||
|
var isPercentage = text.EndsWith("%", StringComparison.Ordinal);
|
||||||
|
if (!float.TryParse(isPercentage ? text.Substring(0, text.Length - 1) : text,
|
||||||
|
NumberStyles.Float, CultureInfo.InvariantCulture, out value)
|
||||||
|
|| float.IsNaN(value) || float.IsInfinity(value))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
value = Mathf.Clamp01(isPercentage ? value / 100f : value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e2fe72e593aed4b90a864e52a745a813
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,293 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Coffee.UIEffects.Editors
|
||||||
|
{
|
||||||
|
internal static class PasteGradientUtil
|
||||||
|
{
|
||||||
|
private struct GradientStop
|
||||||
|
{
|
||||||
|
public Color color;
|
||||||
|
public float? position;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static void PasteFromClipboard(SerializedProperty property,
|
||||||
|
Func<SerializedProperty, Gradient> getGradient,
|
||||||
|
Action<SerializedProperty, Gradient> setGradient)
|
||||||
|
{
|
||||||
|
if (!TryParseCssGradient(GUIUtility.systemCopyBuffer, out var value))
|
||||||
|
{
|
||||||
|
EditorUtility.DisplayDialog("Paste Gradient",
|
||||||
|
"The clipboard does not contain a supported CSS linear-gradient(...) or radial-gradient(...) value.",
|
||||||
|
"OK");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
value.mode = getGradient(property).mode;
|
||||||
|
setGradient(property, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool TryParseCssGradient(string text, out Gradient gradient)
|
||||||
|
{
|
||||||
|
gradient = null;
|
||||||
|
if (string.IsNullOrWhiteSpace(text))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
text = text.Trim();
|
||||||
|
var linearIndex = text.IndexOf("linear-gradient(", StringComparison.OrdinalIgnoreCase);
|
||||||
|
var radialIndex = text.IndexOf("radial-gradient(", StringComparison.OrdinalIgnoreCase);
|
||||||
|
var functionIndex = linearIndex < 0
|
||||||
|
? radialIndex
|
||||||
|
: radialIndex < 0
|
||||||
|
? linearIndex
|
||||||
|
: Math.Min(linearIndex, radialIndex);
|
||||||
|
if (functionIndex < 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
text = text.Substring(functionIndex);
|
||||||
|
var openIndex = text.IndexOf('(');
|
||||||
|
if (openIndex < 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var functionName = text.Substring(0, openIndex).Trim();
|
||||||
|
var isRadial = functionName.Equals("radial-gradient", StringComparison.OrdinalIgnoreCase);
|
||||||
|
if (!isRadial && !functionName.Equals("linear-gradient", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var depth = 0;
|
||||||
|
var closeIndex = -1;
|
||||||
|
for (var i = openIndex; i < text.Length; i++)
|
||||||
|
{
|
||||||
|
if (text[i] == '(')
|
||||||
|
{
|
||||||
|
depth++;
|
||||||
|
}
|
||||||
|
else if (text[i] == ')')
|
||||||
|
{
|
||||||
|
depth--;
|
||||||
|
if (depth < 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (depth == 0)
|
||||||
|
{
|
||||||
|
closeIndex = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (closeIndex < 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var arguments = new List<string>();
|
||||||
|
if (!TrySplitGradientArguments(text.Substring(openIndex + 1, closeIndex - openIndex - 1), arguments)
|
||||||
|
|| arguments.Count < 2)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var firstStopIndex = 0;
|
||||||
|
if (!TryParseGradientStop(arguments[0], out _)
|
||||||
|
&& (isRadial || IsGradientDirection(arguments[0])))
|
||||||
|
{
|
||||||
|
firstStopIndex = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
var stops = new List<GradientStop>();
|
||||||
|
for (var i = firstStopIndex; i < arguments.Count; i++)
|
||||||
|
{
|
||||||
|
if (!TryParseGradientStop(arguments[i], out var stop))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
stops.Add(stop);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stops.Count < 2)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!stops[0].position.HasValue)
|
||||||
|
{
|
||||||
|
stops[0] = SetStopPosition(stops[0], 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
var lastStopIndex = stops.Count - 1;
|
||||||
|
if (!stops[lastStopIndex].position.HasValue)
|
||||||
|
{
|
||||||
|
stops[lastStopIndex] = SetStopPosition(stops[lastStopIndex], 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
var previousPositionIndex = 0;
|
||||||
|
for (var i = 1; i < stops.Count; i++)
|
||||||
|
{
|
||||||
|
if (!stops[i].position.HasValue)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var previousPosition = stops[previousPositionIndex].position.Value;
|
||||||
|
var currentPosition = stops[i].position.Value;
|
||||||
|
var interval = i - previousPositionIndex;
|
||||||
|
for (var j = 1; j < interval; j++)
|
||||||
|
{
|
||||||
|
var position = Mathf.Lerp(previousPosition, currentPosition, (float)j / interval);
|
||||||
|
stops[previousPositionIndex + j] =
|
||||||
|
SetStopPosition(stops[previousPositionIndex + j], position);
|
||||||
|
}
|
||||||
|
|
||||||
|
previousPositionIndex = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
var colorKeys = new GradientColorKey[stops.Count];
|
||||||
|
var alphaKeys = new GradientAlphaKey[stops.Count];
|
||||||
|
var previousTime = 0f;
|
||||||
|
for (var i = 0; i < stops.Count; i++)
|
||||||
|
{
|
||||||
|
var stop = stops[i];
|
||||||
|
var time = Mathf.Clamp01(stop.position.Value);
|
||||||
|
time = Mathf.Max(previousTime, time);
|
||||||
|
colorKeys[i] = new GradientColorKey(new Color(stop.color.r, stop.color.g, stop.color.b), time);
|
||||||
|
alphaKeys[i] = new GradientAlphaKey(stop.color.a, time);
|
||||||
|
previousTime = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
gradient = new Gradient();
|
||||||
|
gradient.SetKeys(colorKeys, alphaKeys);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool TrySplitGradientArguments(string text, List<string> arguments)
|
||||||
|
{
|
||||||
|
var depth = 0;
|
||||||
|
var argumentStart = 0;
|
||||||
|
for (var i = 0; i < text.Length; i++)
|
||||||
|
{
|
||||||
|
if (text[i] == '(')
|
||||||
|
{
|
||||||
|
depth++;
|
||||||
|
}
|
||||||
|
else if (text[i] == ')')
|
||||||
|
{
|
||||||
|
depth--;
|
||||||
|
if (depth < 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (text[i] == ',' && depth == 0)
|
||||||
|
{
|
||||||
|
arguments.Add(text.Substring(argumentStart, i - argumentStart).Trim());
|
||||||
|
argumentStart = i + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (depth != 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
arguments.Add(text.Substring(argumentStart).Trim());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool TryParseGradientStop(string text, out GradientStop stop)
|
||||||
|
{
|
||||||
|
stop = default;
|
||||||
|
text = text.Trim();
|
||||||
|
|
||||||
|
var colorLength = text.Length;
|
||||||
|
var openIndex = text.IndexOf('(');
|
||||||
|
if (openIndex > 0
|
||||||
|
&& (text.Substring(0, openIndex).Trim().Equals("rgb", StringComparison.OrdinalIgnoreCase)
|
||||||
|
|| text.Substring(0, openIndex).Trim().Equals("rgba", StringComparison.OrdinalIgnoreCase)))
|
||||||
|
{
|
||||||
|
var closeIndex = text.IndexOf(')', openIndex + 1);
|
||||||
|
if (closeIndex < 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
colorLength = closeIndex + 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var whitespaceIndex = text.IndexOfAny(new[] { ' ', '\t', '\r', '\n' });
|
||||||
|
if (whitespaceIndex >= 0)
|
||||||
|
{
|
||||||
|
colorLength = whitespaceIndex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var colorText = text.Substring(0, colorLength).Trim();
|
||||||
|
var positionText = text.Substring(colorLength).Trim();
|
||||||
|
if (!PasteColorUtil.TryParseColor(colorText, out var color))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
float? position = null;
|
||||||
|
if (positionText.Length > 0)
|
||||||
|
{
|
||||||
|
if (!positionText.EndsWith("%", StringComparison.Ordinal)
|
||||||
|
|| !float.TryParse(positionText.Substring(0, positionText.Length - 1),
|
||||||
|
NumberStyles.Float, CultureInfo.InvariantCulture, out var percentage)
|
||||||
|
|| float.IsNaN(percentage) || float.IsInfinity(percentage))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
position = percentage / 100f;
|
||||||
|
}
|
||||||
|
|
||||||
|
stop.color = color;
|
||||||
|
stop.position = position;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool IsGradientDirection(string text)
|
||||||
|
{
|
||||||
|
text = text.Trim();
|
||||||
|
if (text.StartsWith("to ", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var suffix in new[] { "deg", "grad", "rad", "turn" })
|
||||||
|
{
|
||||||
|
if (text.EndsWith(suffix, StringComparison.OrdinalIgnoreCase)
|
||||||
|
&& float.TryParse(text.Substring(0, text.Length - suffix.Length),
|
||||||
|
NumberStyles.Float, CultureInfo.InvariantCulture, out var direction)
|
||||||
|
&& !float.IsNaN(direction) && !float.IsInfinity(direction))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static GradientStop SetStopPosition(GradientStop stop, float position)
|
||||||
|
{
|
||||||
|
stop.position = position;
|
||||||
|
return stop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 271608aaaedb44ac39b1357557a71342
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System;
|
using System;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using Coffee.UIEffectInternal;
|
||||||
|
|
||||||
namespace Coffee.UIEffects.Editors
|
namespace Coffee.UIEffects.Editors
|
||||||
{
|
{
|
||||||
@@ -18,6 +19,12 @@ namespace Coffee.UIEffects.Editors
|
|||||||
(Action<SerializedProperty, Gradient>)Delegate.CreateDelegate(typeof(Action<SerializedProperty, Gradient>),
|
(Action<SerializedProperty, Gradient>)Delegate.CreateDelegate(typeof(Action<SerializedProperty, Gradient>),
|
||||||
s_PiGradient.SetMethod);
|
s_PiGradient.SetMethod);
|
||||||
|
|
||||||
|
private static GUIContent s_ReverseGradientContent;
|
||||||
|
private static GUIContent s_PasteColorContent;
|
||||||
|
private static GUIContent s_PasteGradientContent;
|
||||||
|
private static readonly GUIContent s_RotationLabel = new GUIContent("* Rotation");
|
||||||
|
private static readonly GUIContent s_KeepAspectRatioLabel = new GUIContent("* Keep Aspect Ratio");
|
||||||
|
|
||||||
private SerializedProperty _toneFilter;
|
private SerializedProperty _toneFilter;
|
||||||
private SerializedProperty _toneIntensity;
|
private SerializedProperty _toneIntensity;
|
||||||
|
|
||||||
@@ -104,11 +111,19 @@ namespace Coffee.UIEffects.Editors
|
|||||||
private SerializedProperty _detailTexSpeed;
|
private SerializedProperty _detailTexSpeed;
|
||||||
|
|
||||||
private SerializedProperty _flip;
|
private SerializedProperty _flip;
|
||||||
private static GUIContent s_RotationLabel = new GUIContent("* Rotation");
|
|
||||||
private static GUIContent s_KeepAspectRatioLabel = new GUIContent("* Keep Aspect Ratio");
|
|
||||||
|
|
||||||
protected virtual void OnEnable()
|
protected virtual void OnEnable()
|
||||||
{
|
{
|
||||||
|
if (s_ReverseGradientContent == null)
|
||||||
|
{
|
||||||
|
var iconDir = "Packages/com.coffee.ui-effect/Editor/Icons";
|
||||||
|
s_ReverseGradientContent = Misc.GetIconContent($"{iconDir}/ReverseIcon.png", "Reverse gradient");
|
||||||
|
s_PasteColorContent = Misc.GetIconContent($"{iconDir}/PasteIcon.png",
|
||||||
|
$"Paste {PasteColorUtil.SupportedFormats} or CSS background/background-color declarations.");
|
||||||
|
s_PasteGradientContent = Misc.GetIconContent($"{iconDir}/PasteIcon.png",
|
||||||
|
"Paste CSS linear-gradient(...) or radial-gradient(...).");
|
||||||
|
}
|
||||||
|
|
||||||
_toneFilter = serializedObject.FindProperty("m_ToneFilter");
|
_toneFilter = serializedObject.FindProperty("m_ToneFilter");
|
||||||
_toneIntensity = serializedObject.FindProperty("m_ToneIntensity");
|
_toneIntensity = serializedObject.FindProperty("m_ToneIntensity");
|
||||||
|
|
||||||
@@ -502,28 +517,75 @@ namespace Coffee.UIEffects.Editors
|
|||||||
var hdr = UIEffectProjectSettings.useHdrColorPicker;
|
var hdr = UIEffectProjectSettings.useHdrColorPicker;
|
||||||
EditorGUI.showMixedValue = color.hasMultipleDifferentValues;
|
EditorGUI.showMixedValue = color.hasMultipleDifferentValues;
|
||||||
|
|
||||||
|
const float pasteWidth = 20f;
|
||||||
|
var colorRect = new Rect(rect.x, rect.y, rect.width - pasteWidth - 2, rect.height);
|
||||||
|
var pasteRect = new Rect(colorRect.xMax + 2, rect.y, pasteWidth, rect.height);
|
||||||
|
|
||||||
EditorGUI.BeginChangeCheck();
|
EditorGUI.BeginChangeCheck();
|
||||||
var colorValue = EditorGUI.ColorField(rect, label, color.colorValue, true, showAlpha, hdr);
|
var colorValue = EditorGUI.ColorField(colorRect, label, color.colorValue, true, showAlpha, hdr);
|
||||||
if (EditorGUI.EndChangeCheck())
|
if (EditorGUI.EndChangeCheck())
|
||||||
{
|
{
|
||||||
color.colorValue = colorValue;
|
color.colorValue = colorValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (GUI.Button(pasteRect, s_PasteColorContent, "IconButton"))
|
||||||
|
{
|
||||||
|
PasteColorUtil.PasteFromClipboard(color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void DrawGradientField(SerializedProperty gradient)
|
private static void DrawGradientField(SerializedProperty gradient)
|
||||||
{
|
{
|
||||||
var r = EditorGUILayout.GetControlRect();
|
var r = EditorGUILayout.GetControlRect();
|
||||||
|
const float reverseWidth = 20f;
|
||||||
|
const float pasteWidth = 20f;
|
||||||
|
var gradientRect = new Rect(r.x, r.y, r.width - reverseWidth - pasteWidth - 4, r.height);
|
||||||
|
var reverseRect = new Rect(gradientRect.xMax + 2, r.y, reverseWidth, r.height);
|
||||||
|
var pasteRect = new Rect(reverseRect.xMax + 2, r.y, pasteWidth, r.height);
|
||||||
var label = EditorGUIUtility.TrTempContent(gradient.displayName);
|
var label = EditorGUIUtility.TrTempContent(gradient.displayName);
|
||||||
label.tooltip = gradient.tooltip;
|
label.tooltip = gradient.tooltip;
|
||||||
var hdr = UIEffectProjectSettings.useHdrColorPicker;
|
var hdr = UIEffectProjectSettings.useHdrColorPicker;
|
||||||
EditorGUI.showMixedValue = gradient.hasMultipleDifferentValues;
|
EditorGUI.showMixedValue = gradient.hasMultipleDifferentValues;
|
||||||
|
|
||||||
EditorGUI.BeginChangeCheck();
|
EditorGUI.BeginChangeCheck();
|
||||||
var gradientValue = EditorGUI.GradientField(r, label, s_GetGradient(gradient), hdr);
|
var gradientValue = EditorGUI.GradientField(gradientRect, label, s_GetGradient(gradient), hdr);
|
||||||
if (EditorGUI.EndChangeCheck())
|
if (EditorGUI.EndChangeCheck())
|
||||||
{
|
{
|
||||||
s_SetGradient(gradient, gradientValue);
|
s_SetGradient(gradient, gradientValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (GUI.Button(reverseRect, s_ReverseGradientContent, "IconButton"))
|
||||||
|
{
|
||||||
|
ReverseGradient(gradient);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GUI.Button(pasteRect, s_PasteGradientContent, "IconButton"))
|
||||||
|
{
|
||||||
|
PasteGradientUtil.PasteFromClipboard(gradient, s_GetGradient, s_SetGradient);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void ReverseGradient(SerializedProperty property)
|
||||||
|
{
|
||||||
|
var source = s_GetGradient(property);
|
||||||
|
var colorKeys = source.colorKeys;
|
||||||
|
var alphaKeys = source.alphaKeys;
|
||||||
|
for (var i = 0; i < colorKeys.Length; i++)
|
||||||
|
{
|
||||||
|
colorKeys[i].time = 1f - colorKeys[i].time;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i = 0; i < alphaKeys.Length; i++)
|
||||||
|
{
|
||||||
|
alphaKeys[i].time = 1f - alphaKeys[i].time;
|
||||||
|
}
|
||||||
|
|
||||||
|
Array.Reverse(colorKeys);
|
||||||
|
Array.Reverse(alphaKeys);
|
||||||
|
|
||||||
|
var reversed = new Gradient { mode = source.mode };
|
||||||
|
reversed.SetKeys(colorKeys, alphaKeys);
|
||||||
|
s_SetGradient(property, reversed);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void DrawColor(SerializedProperty color, ColorFilter filter, ColorFilter prevFilter,
|
private static void DrawColor(SerializedProperty color, ColorFilter filter, ColorFilter prevFilter,
|
||||||
|
|||||||
+15
-2
@@ -38,6 +38,7 @@ Apply professional-grade filters like grayscale, blur, and dissolve directly fro
|
|||||||
- [Install via UPM (Manually)](#install-via-upm-manually)
|
- [Install via UPM (Manually)](#install-via-upm-manually)
|
||||||
- [Install as Embedded Package](#install-as-embedded-package)
|
- [Install as Embedded Package](#install-as-embedded-package)
|
||||||
- [Import Additional Resources](#import-additional-resources)
|
- [Import Additional Resources](#import-additional-resources)
|
||||||
|
- [Install Additional Resources as Packages](#install-additional-resources-as-packages)
|
||||||
- [🔄 Upgrading from v4 to v5](#-upgrading-from-v4-to-v5)
|
- [🔄 Upgrading from v4 to v5](#-upgrading-from-v4-to-v5)
|
||||||
- [🚀 Usage](#-usage)
|
- [🚀 Usage](#-usage)
|
||||||
- [Getting Started](#getting-started)
|
- [Getting Started](#getting-started)
|
||||||
@@ -67,6 +68,7 @@ Apply professional-grade filters like grayscale, blur, and dissolve directly fro
|
|||||||
- [Settings](#settings)
|
- [Settings](#settings)
|
||||||
- [Editor](#editor)
|
- [Editor](#editor)
|
||||||
- [Shader](#shader)
|
- [Shader](#shader)
|
||||||
|
- [Advanced](#advanced)
|
||||||
- [:warning: Limitations](#warning-limitations)
|
- [:warning: Limitations](#warning-limitations)
|
||||||
- [🤝 Contributing](#-contributing)
|
- [🤝 Contributing](#-contributing)
|
||||||
- [Issues](#issues)
|
- [Issues](#issues)
|
||||||
@@ -297,13 +299,17 @@ The `UIEffect` component applies visual effects to UI elements, allowing various
|
|||||||
|
|
||||||
#### Color Filter
|
#### Color Filter
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
- **Color Filter**: `None`, `Multiply`, `Additive`, `Subtractive`, `Replace`, `Multiply Luminance`, `Multiply Additive`, `Hsv Modifier`, `Contrast`
|
- **Color Filter**: `None`, `Multiply`, `Additive`, `Subtractive`, `Replace`, `Multiply Luminance`, `Multiply Additive`, `Hsv Modifier`, `Contrast`
|
||||||

|

|
||||||
- **Color Intensity**: 0.0 (no effect) - 1.0 (full effect).
|
- **Color Intensity**: 0.0 (no effect) - 1.0 (full effect).
|
||||||
- **Color Glow**: Set the color to glow.
|
- **Color Glow**: Set the color to glow.
|
||||||
|
|
||||||
|
> [!TIP]
|
||||||
|
> The paste button beside a color field accepts hex values (`#RGB`, `#RRGGBB`, `#RGBA`, `#RRGGBBAA`), Unity-supported color names, `transparent`, `rgb()`, and `rgba()`. It also accepts CSS `background` or `background-color` declarations containing one of these values.
|
||||||
|
> This is useful when copying and pasting color codes from CSS, USS, Figma, Photoshop, etc.
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
#### Sampling Filter
|
#### Sampling Filter
|
||||||
@@ -389,7 +395,7 @@ The `UIEffect` component applies visual effects to UI elements, allowing various
|
|||||||
|
|
||||||
#### Gradation Mode
|
#### Gradation Mode
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
- **Gradation Mode**: `None`, `Horizontal`, `HorizontalGradient`, `Vertical`, `VerticalGradient`, `Radial`, `RadialGradient`, `Diagonal`, `DiagonalToRightBottom`, `DiagonalToLeftBottom`, `Angle`, `AngleGradient`
|
- **Gradation Mode**: `None`, `Horizontal`, `HorizontalGradient`, `Vertical`, `VerticalGradient`, `Radial`, `RadialGradient`, `Diagonal`, `DiagonalToRightBottom`, `DiagonalToLeftBottom`, `Angle`, `AngleGradient`
|
||||||

|

|
||||||
@@ -407,6 +413,13 @@ The `UIEffect` component applies visual effects to UI elements, allowing various
|
|||||||
- **Keep Aspect Ratio**:
|
- **Keep Aspect Ratio**:
|
||||||
- ⚠️ NOTE: `Keep Aspect Ratio` is shared with `Transition Filter` and `Gradation Mode` and `Detail Filter`.
|
- ⚠️ NOTE: `Keep Aspect Ratio` is shared with `Transition Filter` and `Gradation Mode` and `Detail Filter`.
|
||||||
|
|
||||||
|
> [!TIP]
|
||||||
|
> The paste button beside a gradient field accepts CSS `linear-gradient(...)` and `radial-gradient(...)` values, importing their color stops and positions. CSS direction and shape are not applied.
|
||||||
|
> This is useful when copying and pasting color codes from CSS, USS, Figma, Photoshop, etc.
|
||||||
|
|
||||||
|
> [!TIP]
|
||||||
|
> Click the reverse button beside a gradient field to reverse its color and alpha stops.
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
#### Edge Mode
|
#### Edge Mode
|
||||||
|
|||||||
@@ -87,6 +87,28 @@ namespace Coffee.UIEffectInternal
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
public static GUIContent GetIconContent(string iconPath, string tooltip = null)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(iconPath))
|
||||||
|
{
|
||||||
|
return new GUIContent(tooltip);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (EditorGUIUtility.isProSkin)
|
||||||
|
{
|
||||||
|
var darkIconPath = $"{Path.GetDirectoryName(iconPath)}/d_{Path.GetFileName(iconPath)}";
|
||||||
|
if (File.Exists(darkIconPath))
|
||||||
|
{
|
||||||
|
iconPath = darkIconPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var icon = AssetDatabase.LoadAssetAtPath<Texture2D>(iconPath);
|
||||||
|
return new GUIContent(icon, tooltip);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !UNITY_2021_2_OR_NEWER
|
#if !UNITY_2021_2_OR_NEWER
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ using UnityEngine.Rendering;
|
|||||||
|
|
||||||
namespace Coffee.UIEffects
|
namespace Coffee.UIEffects
|
||||||
{
|
{
|
||||||
[Icon("Packages/com.coffee.ui-effect/Editor/UIEffectIconIcon.png")]
|
[Icon("Packages/com.coffee.ui-effect/Editor/Icons/UIEffectIconIcon.png")]
|
||||||
[ExecuteAlways]
|
[ExecuteAlways]
|
||||||
[DisallowMultipleComponent]
|
[DisallowMultipleComponent]
|
||||||
public class UIEffect : UIEffectBase
|
public class UIEffect : UIEffectBase
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using UnityEngine;
|
|||||||
|
|
||||||
namespace Coffee.UIEffects
|
namespace Coffee.UIEffects
|
||||||
{
|
{
|
||||||
[Icon("Packages/com.coffee.ui-effect/Editor/UIEffectIconIcon.png")]
|
[Icon("Packages/com.coffee.ui-effect/Editor/Icons/UIEffectIconIcon.png")]
|
||||||
public class UIEffectReplica : UIEffectBase, ISerializationCallbackReceiver
|
public class UIEffectReplica : UIEffectBase, ISerializationCallbackReceiver
|
||||||
{
|
{
|
||||||
[SerializeField] private UIEffect m_Target;
|
[SerializeField] private UIEffect m_Target;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using UnityEngine.Events;
|
|||||||
|
|
||||||
namespace Coffee.UIEffects
|
namespace Coffee.UIEffects
|
||||||
{
|
{
|
||||||
[Icon("Packages/com.coffee.ui-effect/Editor/UIEffectIconIcon.png")]
|
[Icon("Packages/com.coffee.ui-effect/Editor/Icons/UIEffectIconIcon.png")]
|
||||||
[ExecuteAlways]
|
[ExecuteAlways]
|
||||||
[RequireComponent(typeof(UIEffectBase))]
|
[RequireComponent(typeof(UIEffectBase))]
|
||||||
public class UIEffectTweener : MonoBehaviour
|
public class UIEffectTweener : MonoBehaviour
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "com.coffee.ui-effect.shadergraph-builtin",
|
"name": "com.coffee.ui-effect.shadergraph-builtin",
|
||||||
"displayName": "UI Effect - ShaderGraph Support (Unity 6 BuiltIn)",
|
"displayName": "UI Effect - ShaderGraph Support (Unity 6 BuiltIn)",
|
||||||
"description": "An extension for UI Effect that adds ShaderGraph support (Unity 6 BuiltIn).",
|
"description": "An extension for UI Effect that adds ShaderGraph support (Unity 6 BuiltIn).",
|
||||||
"version": "5.12.1",
|
"version": "5.13.0",
|
||||||
"unity": "2020.3",
|
"unity": "2020.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
"url": "https://github.com/mob-sakai"
|
"url": "https://github.com/mob-sakai"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.coffee.ui-effect": "5.12.1"
|
"com.coffee.ui-effect": "5.13.0"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"ui",
|
"ui",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "com.coffee.ui-effect.shadergraph-urp",
|
"name": "com.coffee.ui-effect.shadergraph-urp",
|
||||||
"displayName": "UI Effect - ShaderGraph Support (Unity 6 URP)",
|
"displayName": "UI Effect - ShaderGraph Support (Unity 6 URP)",
|
||||||
"description": "An extension for UI Effect that adds ShaderGraph support (Unity 6 URP).",
|
"description": "An extension for UI Effect that adds ShaderGraph support (Unity 6 URP).",
|
||||||
"version": "5.12.1",
|
"version": "5.13.0",
|
||||||
"unity": "2020.3",
|
"unity": "2020.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -15,8 +15,8 @@
|
|||||||
"url": "https://github.com/mob-sakai"
|
"url": "https://github.com/mob-sakai"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.coffee.ui-effect": "5.12.1",
|
"com.coffee.ui-effect": "5.13.0",
|
||||||
"com.coffee.ui-effect-shadergraph-builtin": "5.12.1"
|
"com.coffee.ui-effect-shadergraph-builtin": "5.13.0"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"ui",
|
"ui",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "com.coffee.ui-effect.textmeshpro-legacy",
|
"name": "com.coffee.ui-effect.textmeshpro-legacy",
|
||||||
"displayName": "UI Effect - TextMeshPro Support",
|
"displayName": "UI Effect - TextMeshPro Support",
|
||||||
"description": "An extension for UI Effect that adds TextMeshPro support.",
|
"description": "An extension for UI Effect that adds TextMeshPro support.",
|
||||||
"version": "5.12.1",
|
"version": "5.13.0",
|
||||||
"unity": "2020.3",
|
"unity": "2020.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
"url": "https://github.com/mob-sakai"
|
"url": "https://github.com/mob-sakai"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.coffee.ui-effect": "5.12.1"
|
"com.coffee.ui-effect": "5.13.0"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"ui",
|
"ui",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "com.coffee.ui-effect.textmeshpro",
|
"name": "com.coffee.ui-effect.textmeshpro",
|
||||||
"displayName": "UI Effect - TextMeshPro Support (Unity 6)",
|
"displayName": "UI Effect - TextMeshPro Support (Unity 6)",
|
||||||
"description": "An extension for UI Effect that adds TextMeshPro support (Unity 6).",
|
"description": "An extension for UI Effect that adds TextMeshPro support (Unity 6).",
|
||||||
"version": "5.12.1",
|
"version": "5.13.0",
|
||||||
"unity": "2020.3",
|
"unity": "2020.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
"url": "https://github.com/mob-sakai"
|
"url": "https://github.com/mob-sakai"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.coffee.ui-effect": "5.12.1"
|
"com.coffee.ui-effect": "5.13.0"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"ui",
|
"ui",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "com.coffee.ui-effect.v4-compatible-components",
|
"name": "com.coffee.ui-effect.v4-compatible-components",
|
||||||
"displayName": "UI Effect - v4 Compatible Components",
|
"displayName": "UI Effect - v4 Compatible Components",
|
||||||
"description": "An extension for UI Effect that adds v4 compatible components.",
|
"description": "An extension for UI Effect that adds v4 compatible components.",
|
||||||
"version": "5.12.1",
|
"version": "5.13.0",
|
||||||
"unity": "2020.3",
|
"unity": "2020.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
"url": "https://github.com/mob-sakai"
|
"url": "https://github.com/mob-sakai"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.coffee.ui-effect": "5.12.1",
|
"com.coffee.ui-effect": "5.13.0",
|
||||||
"com.unity.modules.animation": "1.0.0"
|
"com.unity.modules.animation": "1.0.0"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "com.coffee.ui-effect",
|
"name": "com.coffee.ui-effect",
|
||||||
"displayName": "UI Effect",
|
"displayName": "UI Effect",
|
||||||
"description": "UIEffect is an open-source package that allows you to intuitively apply rich UI effects directly from the Inspector or via code.\nCombine various filters, such as grayscale, blur, and dissolve, to decorate your UI with a unique visual style!",
|
"description": "UIEffect is an open-source package that allows you to intuitively apply rich UI effects directly from the Inspector or via code.\nCombine various filters, such as grayscale, blur, and dissolve, to decorate your UI with a unique visual style!",
|
||||||
"version": "5.12.1",
|
"version": "5.13.0",
|
||||||
"unity": "2020.3",
|
"unity": "2020.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
Reference in New Issue
Block a user