850 changed files with 117961 additions and 0 deletions
-
7Packages/com.unity.ugui/CHANGELOG.md
-
7Packages/com.unity.ugui/CHANGELOG.md.meta
-
8Packages/com.unity.ugui/Editor Resources.meta
-
8Packages/com.unity.ugui/Editor Resources/Gizmos.meta
-
BINPackages/com.unity.ugui/Editor Resources/Gizmos/TMP - Dropdown Icon.psd
-
143Packages/com.unity.ugui/Editor Resources/Gizmos/TMP - Dropdown Icon.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Gizmos/TMP - Font Asset Icon.psd
-
57Packages/com.unity.ugui/Editor Resources/Gizmos/TMP - Font Asset Icon.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Gizmos/TMP - Input Field Icon.psd
-
57Packages/com.unity.ugui/Editor Resources/Gizmos/TMP - Input Field Icon.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Gizmos/TMP - Sprite Asset Icon.psd
-
57Packages/com.unity.ugui/Editor Resources/Gizmos/TMP - Sprite Asset Icon.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Gizmos/TMP - Text Component Icon.psd
-
53Packages/com.unity.ugui/Editor Resources/Gizmos/TMP - Text Component Icon.psd.meta
-
8Packages/com.unity.ugui/Editor Resources/Shaders.meta
-
85Packages/com.unity.ugui/Editor Resources/Shaders/TMP_Properties.cginc
-
9Packages/com.unity.ugui/Editor Resources/Shaders/TMP_Properties.cginc.meta
-
75Packages/com.unity.ugui/Editor Resources/Shaders/TMP_SDF Internal Editor.shader
-
9Packages/com.unity.ugui/Editor Resources/Shaders/TMP_SDF Internal Editor.shader.meta
-
132Packages/com.unity.ugui/Editor Resources/Shaders/TMP_SDF_SSD.cginc
-
9Packages/com.unity.ugui/Editor Resources/Shaders/TMP_SDF_SSD.cginc.meta
-
8Packages/com.unity.ugui/Editor Resources/Textures.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/SectionHeader_Dark.psd
-
53Packages/com.unity.ugui/Editor Resources/Textures/SectionHeader_Dark.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/SectionHeader_Light.psd
-
53Packages/com.unity.ugui/Editor Resources/Textures/SectionHeader_Light.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignBaseLine.psd
-
53Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignBaseLine.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignBaseLine_Light.psd
-
53Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignBaseLine_Light.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignBottom.psd
-
53Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignBottom.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignBottom_Light.psd
-
53Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignBottom_Light.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignCapLine.psd
-
58Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignCapLine.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignCapLine_Light.psd
-
58Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignCapLine_Light.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignCenter.psd
-
53Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignCenter.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignCenterGeo.psd
-
56Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignCenterGeo.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignCenterGeo_Light.psd
-
56Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignCenterGeo_Light.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignCenter_Light.psd
-
53Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignCenter_Light.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignFlush.psd
-
53Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignFlush.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignFlush_Light.psd
-
53Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignFlush_Light.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignJustified.psd
-
59Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignJustified.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignJustified_Light.psd
-
59Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignJustified_Light.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignLeft.psd
-
53Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignLeft.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignLeft_Light.psd
-
53Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignLeft_Light.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignMidLine.psd
-
58Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignMidLine.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignMiddle.psd
-
53Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignMiddle.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignMiddle_Light.psd
-
53Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignMiddle_Light.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignMidline_Light.psd
-
58Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignMidline_Light.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignRight.psd
-
53Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignRight.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignRight_Light.psd
-
53Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignRight_Light.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignTop.psd
-
53Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignTop.psd.meta
-
BINPackages/com.unity.ugui/Editor Resources/Textures/btn_AlignTop_Light.psd
-
53Packages/com.unity.ugui/Editor Resources/Textures/btn_AlignTop_Light.psd.meta
-
8Packages/com.unity.ugui/Editor.meta
-
8Packages/com.unity.ugui/Editor/TMP.meta
-
8Packages/com.unity.ugui/Editor/TMP/HDRP.meta
-
677Packages/com.unity.ugui/Editor/TMP/HDRP/TMP_BaseHDRPLitShaderGUI.cs
-
12Packages/com.unity.ugui/Editor/TMP/HDRP/TMP_BaseHDRPLitShaderGUI.cs.meta
-
681Packages/com.unity.ugui/Editor/TMP/HDRP/TMP_BaseHDRPUnlitShaderGUI.cs
-
12Packages/com.unity.ugui/Editor/TMP/HDRP/TMP_BaseHDRPUnlitShaderGUI.cs.meta
-
631Packages/com.unity.ugui/Editor/TMP/HDRP/TMP_SDF_HDRPLitShaderGUI.cs
-
12Packages/com.unity.ugui/Editor/TMP/HDRP/TMP_SDF_HDRPLitShaderGUI.cs.meta
-
642Packages/com.unity.ugui/Editor/TMP/HDRP/TMP_SDF_HDRPUnlitShaderGUI.cs
-
12Packages/com.unity.ugui/Editor/TMP/HDRP/TMP_SDF_HDRPUnlitShaderGUI.cs.meta
-
8Packages/com.unity.ugui/Editor/TMP/PropertyDrawers.meta
-
63Packages/com.unity.ugui/Editor/TMP/PropertyDrawers/DropdownOptionListDrawer.cs
-
12Packages/com.unity.ugui/Editor/TMP/PropertyDrawers/DropdownOptionListDrawer.cs.meta
-
60Packages/com.unity.ugui/Editor/TMP/PropertyDrawers/GlyphMetricsPropertyDrawer.cs
-
11Packages/com.unity.ugui/Editor/TMP/PropertyDrawers/GlyphMetricsPropertyDrawer.cs.meta
-
372Packages/com.unity.ugui/Editor/TMP/PropertyDrawers/GlyphPairAdjustmentRecordPropertyDrawer.cs
-
11Packages/com.unity.ugui/Editor/TMP/PropertyDrawers/GlyphPairAdjustmentRecordPropertyDrawer.cs.meta
-
50Packages/com.unity.ugui/Editor/TMP/PropertyDrawers/GlyphRectPropertyDrawer.cs
-
11Packages/com.unity.ugui/Editor/TMP/PropertyDrawers/GlyphRectPropertyDrawer.cs.meta
-
123Packages/com.unity.ugui/Editor/TMP/PropertyDrawers/LigatureSubstitutionRecordPropertyDrawer.cs
-
11Packages/com.unity.ugui/Editor/TMP/PropertyDrawers/LigatureSubstitutionRecordPropertyDrawer.cs.meta
-
209Packages/com.unity.ugui/Editor/TMP/PropertyDrawers/TMP_CharacterPropertyDrawer.cs
-
11Packages/com.unity.ugui/Editor/TMP/PropertyDrawers/TMP_CharacterPropertyDrawer.cs.meta
-
106Packages/com.unity.ugui/Editor/TMP/PropertyDrawers/TMP_GlyphPropertyDrawer.cs
-
11Packages/com.unity.ugui/Editor/TMP/PropertyDrawers/TMP_GlyphPropertyDrawer.cs.meta
@ -0,0 +1,7 @@ |
|||
# Changelog |
|||
|
|||
## [2.0.0] - 2023-03-08 |
|||
Merge of the com.unity.textmeshpro package. |
|||
|
|||
## [1.0.0] - 2019-01-08 |
|||
This is the first release of Unity UI as a built in package. |
|||
@ -0,0 +1,7 @@ |
|||
fileFormatVersion: 2 |
|||
guid: c851bee4305bddf438cc6ffc515991ce |
|||
TextScriptImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,8 @@ |
|||
fileFormatVersion: 2 |
|||
guid: d1a0a27327b54c3bac52a08929c33f81 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,8 @@ |
|||
fileFormatVersion: 2 |
|||
guid: e93ec7eb6de342aabd156833e253f838 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,143 @@ |
|||
fileFormatVersion: 2 |
|||
guid: a7ec9e7ad8b847b7ae4510af83c5d868 |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
externalObjects: {} |
|||
serializedVersion: 7 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
sRGBTexture: 1 |
|||
linearTexture: 1 |
|||
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: -2 |
|||
maxTextureSize: 128 |
|||
textureSettings: |
|||
serializedVersion: 2 |
|||
filterMode: -1 |
|||
aniso: 1 |
|||
mipBias: -100 |
|||
wrapU: 1 |
|||
wrapV: 1 |
|||
wrapW: 1 |
|||
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 |
|||
maxTextureSizeSet: 0 |
|||
compressionQualitySet: 0 |
|||
textureFormatSet: 0 |
|||
platformSettings: |
|||
- serializedVersion: 2 |
|||
buildTarget: DefaultTexturePlatform |
|||
maxTextureSize: 128 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 0 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
androidETC2FallbackOverride: 0 |
|||
- serializedVersion: 2 |
|||
buildTarget: Standalone |
|||
maxTextureSize: 128 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 0 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
androidETC2FallbackOverride: 0 |
|||
- serializedVersion: 2 |
|||
buildTarget: iPhone |
|||
maxTextureSize: 128 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: 2 |
|||
textureCompression: 0 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
androidETC2FallbackOverride: 0 |
|||
- serializedVersion: 2 |
|||
buildTarget: Android |
|||
maxTextureSize: 128 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 0 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
androidETC2FallbackOverride: 0 |
|||
- serializedVersion: 2 |
|||
buildTarget: Windows Store Apps |
|||
maxTextureSize: 128 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 0 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
androidETC2FallbackOverride: 0 |
|||
- serializedVersion: 2 |
|||
buildTarget: WebGL |
|||
maxTextureSize: 128 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 0 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
androidETC2FallbackOverride: 0 |
|||
spriteSheet: |
|||
serializedVersion: 2 |
|||
sprites: [] |
|||
outline: [] |
|||
physicsShape: [] |
|||
bones: [] |
|||
spriteID: |
|||
vertices: [] |
|||
indices: |
|||
edges: [] |
|||
weights: [] |
|||
spritePackingTag: |
|||
pSDRemoveMatte: 1 |
|||
pSDShowRemoveMatteOption: 1 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,57 @@ |
|||
fileFormatVersion: 2 |
|||
guid: ee148e281f3c41c5b4ff5f8a5afe5a6c |
|||
timeCreated: 1463559213 |
|||
licenseType: Pro |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: 0.25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 7 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 128 |
|||
textureSettings: |
|||
filterMode: -1 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
allowsAlphaSplitting: 0 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: 0.5, y: 0.5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
outline: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,57 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 3ee40aa79cd242a5b53b0b0ca4f13f0f |
|||
timeCreated: 1457860876 |
|||
licenseType: Pro |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: 0.25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 128 |
|||
textureSettings: |
|||
filterMode: -1 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
allowsAlphaSplitting: 0 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: 0.5, y: 0.5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
outline: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,57 @@ |
|||
fileFormatVersion: 2 |
|||
guid: ec7c645d93308c04d8840982af12101e |
|||
timeCreated: 1463559213 |
|||
licenseType: Pro |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: 0.25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 7 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 128 |
|||
textureSettings: |
|||
filterMode: -1 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
allowsAlphaSplitting: 0 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: 0.5, y: 0.5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
outline: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,53 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 2fd6421f253b4ef1a19526541f9ffc0c |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: .25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 128 |
|||
textureSettings: |
|||
filterMode: -1 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: .5, y: .5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,8 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 2da27f5fe80a3a549ac7331d9f52f5f0 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,85 @@ |
|||
// UI Editable properties |
|||
uniform sampler2D _FaceTex; // Alpha : Signed Distance |
|||
uniform float _FaceUVSpeedX; |
|||
uniform float _FaceUVSpeedY; |
|||
uniform fixed4 _FaceColor; // RGBA : Color + Opacity |
|||
uniform float _FaceDilate; // v[ 0, 1] |
|||
uniform float _OutlineSoftness; // v[ 0, 1] |
|||
|
|||
uniform sampler2D _OutlineTex; // RGBA : Color + Opacity |
|||
uniform float _OutlineUVSpeedX; |
|||
uniform float _OutlineUVSpeedY; |
|||
uniform fixed4 _OutlineColor; // RGBA : Color + Opacity |
|||
uniform float _OutlineWidth; // v[ 0, 1] |
|||
|
|||
uniform float _Bevel; // v[ 0, 1] |
|||
uniform float _BevelOffset; // v[-1, 1] |
|||
uniform float _BevelWidth; // v[-1, 1] |
|||
uniform float _BevelClamp; // v[ 0, 1] |
|||
uniform float _BevelRoundness; // v[ 0, 1] |
|||
|
|||
uniform sampler2D _BumpMap; // Normal map |
|||
uniform float _BumpOutline; // v[ 0, 1] |
|||
uniform float _BumpFace; // v[ 0, 1] |
|||
|
|||
uniform samplerCUBE _Cube; // Cube / sphere map |
|||
uniform fixed4 _ReflectFaceColor; // RGB intensity |
|||
uniform fixed4 _ReflectOutlineColor; |
|||
//uniform float _EnvTiltX; // v[-1, 1] |
|||
//uniform float _EnvTiltY; // v[-1, 1] |
|||
uniform float3 _EnvMatrixRotation; |
|||
uniform float4x4 _EnvMatrix; |
|||
|
|||
uniform fixed4 _SpecularColor; // RGB intensity |
|||
uniform float _LightAngle; // v[ 0,Tau] |
|||
uniform float _SpecularPower; // v[ 0, 1] |
|||
uniform float _Reflectivity; // v[ 5, 15] |
|||
uniform float _Diffuse; // v[ 0, 1] |
|||
uniform float _Ambient; // v[ 0, 1] |
|||
|
|||
uniform fixed4 _UnderlayColor; // RGBA : Color + Opacity |
|||
uniform float _UnderlayOffsetX; // v[-1, 1] |
|||
uniform float _UnderlayOffsetY; // v[-1, 1] |
|||
uniform float _UnderlayDilate; // v[-1, 1] |
|||
uniform float _UnderlaySoftness; // v[ 0, 1] |
|||
|
|||
uniform fixed4 _GlowColor; // RGBA : Color + Intesity |
|||
uniform float _GlowOffset; // v[-1, 1] |
|||
uniform float _GlowOuter; // v[ 0, 1] |
|||
uniform float _GlowInner; // v[ 0, 1] |
|||
uniform float _GlowPower; // v[ 1, 1/(1+4*4)] |
|||
|
|||
// API Editable properties |
|||
uniform float _ShaderFlags; |
|||
uniform float _WeightNormal; |
|||
uniform float _WeightBold; |
|||
|
|||
uniform float _ScaleRatioA; |
|||
uniform float _ScaleRatioB; |
|||
uniform float _ScaleRatioC; |
|||
|
|||
uniform float _VertexOffsetX; |
|||
uniform float _VertexOffsetY; |
|||
|
|||
//uniform float _UseClipRect; |
|||
uniform float _MaskID; |
|||
uniform sampler2D _MaskTex; |
|||
uniform float4 _MaskCoord; |
|||
uniform float4 _ClipRect; // bottom left(x,y) : top right(z,w) |
|||
//uniform float _MaskWipeControl; |
|||
//uniform float _MaskEdgeSoftness; |
|||
//uniform fixed4 _MaskEdgeColor; |
|||
//uniform bool _MaskInverse; |
|||
|
|||
uniform float _MaskSoftnessX; |
|||
uniform float _MaskSoftnessY; |
|||
|
|||
// Font Atlas properties |
|||
uniform sampler2D _MainTex; |
|||
uniform float _TextureWidth; |
|||
uniform float _TextureHeight; |
|||
uniform float _GradientScale; |
|||
uniform float _ScaleX; |
|||
uniform float _ScaleY; |
|||
uniform float _PerspectiveFilter; |
|||
uniform float _Sharpness; |
|||
@ -0,0 +1,9 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 3c6c403084eacec478a1129ce20061ea |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,75 @@ |
|||
// Simplified SDF shader: |
|||
// - No Shading Option (bevel / bump / env map) |
|||
// - No Glow Option |
|||
// - Softness is applied on both side of the outline |
|||
|
|||
Shader "Hidden/TMP/Internal/Editor/Distance Field SSD" { |
|||
|
|||
Properties{ |
|||
_FaceColor("Face Color", Color) = (1,1,1,1) |
|||
_FaceDilate("Face Dilate", Range(-1,1)) = 0 |
|||
|
|||
_OutlineColor("Outline Color", Color) = (0,0,0,1) |
|||
_OutlineWidth("Outline Thickness", Range(0,1)) = 0 |
|||
_OutlineSoftness("Outline Softness", Range(0,1)) = 0 |
|||
|
|||
_UnderlayColor("Border Color", Color) = (0,0,0,.5) |
|||
_UnderlayOffsetX("Border OffsetX", Range(-1,1)) = 0 |
|||
_UnderlayOffsetY("Border OffsetY", Range(-1,1)) = 0 |
|||
_UnderlayDilate("Border Dilate", Range(-1,1)) = 0 |
|||
_UnderlaySoftness("Border Softness", Range(0,1)) = 0 |
|||
|
|||
_WeightNormal("Weight Normal", float) = 0 |
|||
_WeightBold("Weight Bold", float) = .5 |
|||
|
|||
_ShaderFlags("Flags", float) = 0 |
|||
_ScaleRatioA("Scale RatioA", float) = 1 |
|||
_ScaleRatioB("Scale RatioB", float) = 1 |
|||
_ScaleRatioC("Scale RatioC", float) = 1 |
|||
|
|||
_MainTex("Font Atlas", 2D) = "white" {} |
|||
_TextureWidth("Texture Width", float) = 1024 |
|||
_TextureHeight("Texture Height", float) = 1024 |
|||
_GradientScale("Gradient Scale", float) = 1 |
|||
_ScaleX("Scale X", float) = 1 |
|||
_ScaleY("Scale Y", float) = 1 |
|||
_PerspectiveFilter("Perspective Correction", Range(0, 1)) = 0.875 |
|||
_Sharpness("Sharpness", Range(-1,1)) = 0 |
|||
|
|||
_VertexOffsetX("Vertex OffsetX", float) = 0 |
|||
_VertexOffsetY("Vertex OffsetY", float) = 0 |
|||
} |
|||
|
|||
SubShader |
|||
{ |
|||
Tags |
|||
{ |
|||
"ForceSupported" = "True" |
|||
} |
|||
|
|||
Lighting Off |
|||
Blend One OneMinusSrcAlpha |
|||
Cull Off |
|||
ZWrite Off |
|||
ZTest Always |
|||
|
|||
Pass |
|||
{ |
|||
CGPROGRAM |
|||
#pragma vertex VertShader |
|||
#pragma fragment PixShader |
|||
#pragma shader_feature __ OUTLINE_ON |
|||
#pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER |
|||
|
|||
#include "UnityCG.cginc" |
|||
#include "UnityUI.cginc" |
|||
#include "TMP_Properties.cginc" |
|||
|
|||
#include "TMP_SDF_SSD.cginc" |
|||
|
|||
ENDCG |
|||
} |
|||
} |
|||
|
|||
CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI" |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 9c442dc870b456e48b615cd8add0e9ef |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,132 @@ |
|||
struct vertex_t |
|||
{ |
|||
float4 position : POSITION; |
|||
float3 normal : NORMAL; |
|||
float4 color : COLOR; |
|||
float4 texcoord0 : TEXCOORD0; |
|||
float2 texcoord1 : TEXCOORD1; |
|||
}; |
|||
|
|||
struct pixel_t |
|||
{ |
|||
float4 position : SV_POSITION; |
|||
float4 faceColor : COLOR; |
|||
float4 outlineColor : COLOR1; |
|||
float2 texcoord0 : TEXCOORD0; |
|||
float4 param : TEXCOORD1; // weight, scaleRatio |
|||
float2 clipUV : TEXCOORD2; |
|||
#if (UNDERLAY_ON || UNDERLAY_INNER) |
|||
float4 texcoord2 : TEXCOORD3; |
|||
float4 underlayColor : COLOR2; |
|||
#endif |
|||
}; |
|||
|
|||
sampler2D _GUIClipTexture; |
|||
uniform float4x4 unity_GUIClipTextureMatrix; |
|||
float4 _MainTex_TexelSize; |
|||
|
|||
float4 SRGBToLinear(float4 rgba) |
|||
{ |
|||
return float4(lerp(rgba.rgb / 12.92f, pow((rgba.rgb + 0.055f) / 1.055f, 2.4f), step(0.04045f, rgba.rgb)), rgba.a); |
|||
} |
|||
|
|||
pixel_t VertShader(vertex_t input) |
|||
{ |
|||
pixel_t output; |
|||
|
|||
float bold = step(input.texcoord0.w, 0); |
|||
|
|||
float4 vert = input.position; |
|||
vert.x += _VertexOffsetX; |
|||
vert.y += _VertexOffsetY; |
|||
|
|||
float4 vPosition = UnityObjectToClipPos(vert); |
|||
|
|||
float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0; |
|||
weight = (weight + _FaceDilate) * _ScaleRatioA * 0.5; |
|||
|
|||
// Generate UV for the Clip Texture |
|||
float3 eyePos = UnityObjectToViewPos(input.position); |
|||
float2 clipUV = mul(unity_GUIClipTextureMatrix, float4(eyePos.xy, 0, 1.0)); |
|||
|
|||
float4 color = input.color; |
|||
#if (FORCE_LINEAR && !UNITY_COLORSPACE_GAMMA) |
|||
color = SRGBToLinear(input.color); |
|||
#endif |
|||
|
|||
float opacity = color.a; |
|||
#if (UNDERLAY_ON | UNDERLAY_INNER) |
|||
opacity = 1.0; |
|||
#endif |
|||
|
|||
float4 faceColor = float4(color.rgb, opacity) * _FaceColor; |
|||
faceColor.rgb *= faceColor.a; |
|||
|
|||
float4 outlineColor = _OutlineColor; |
|||
outlineColor.a *= opacity; |
|||
outlineColor.rgb *= outlineColor.a; |
|||
|
|||
output.position = vPosition; |
|||
output.faceColor = faceColor; |
|||
output.outlineColor = outlineColor; |
|||
output.texcoord0 = float2(input.texcoord0.xy); |
|||
output.param = float4(0.5 - weight, 1.3333 * _GradientScale * (_Sharpness + 1) / _MainTex_TexelSize.z , _OutlineWidth * _ScaleRatioA * 0.5, 0); |
|||
output.clipUV = clipUV; |
|||
|
|||
#if (UNDERLAY_ON || UNDERLAY_INNER) |
|||
float4 underlayColor = _UnderlayColor; |
|||
underlayColor.rgb *= underlayColor.a; |
|||
|
|||
float x = -(_UnderlayOffsetX * _ScaleRatioC) * _GradientScale / _MainTex_TexelSize.z; |
|||
float y = -(_UnderlayOffsetY * _ScaleRatioC) * _GradientScale / _MainTex_TexelSize.w; |
|||
|
|||
output.texcoord2 = float4(input.texcoord0 + float2(x, y), input.color.a, 0); |
|||
output.underlayColor = underlayColor; |
|||
#endif |
|||
|
|||
return output; |
|||
} |
|||
|
|||
float4 PixShader(pixel_t input) : SV_Target |
|||
{ |
|||
float d = tex2D(_MainTex, input.texcoord0.xy).a; |
|||
|
|||
float2 UV = input.texcoord0.xy; |
|||
float scale = rsqrt(abs(ddx(UV.x) * ddy(UV.y) - ddy(UV.x) * ddx(UV.y))) * input.param.y; |
|||
|
|||
#if (UNDERLAY_ON | UNDERLAY_INNER) |
|||
float layerScale = scale; |
|||
layerScale /= 1 + ((_UnderlaySoftness * _ScaleRatioC) * layerScale); |
|||
float layerBias = input.param.x * layerScale - .5 - ((_UnderlayDilate * _ScaleRatioC) * .5 * layerScale); |
|||
#endif |
|||
|
|||
scale /= 1 + (_OutlineSoftness * _ScaleRatioA * scale); |
|||
|
|||
float4 faceColor = input.faceColor * saturate((d - input.param.x) * scale + 0.5); |
|||
|
|||
#ifdef OUTLINE_ON |
|||
float4 outlineColor = lerp(input.faceColor, input.outlineColor, sqrt(min(1.0, input.param.z * scale * 2))); |
|||
faceColor = lerp(outlineColor, input.faceColor, saturate((d - input.param.x - input.param.z) * scale + 0.5)); |
|||
faceColor *= saturate((d - input.param.x + input.param.z) * scale + 0.5); |
|||
#endif |
|||
|
|||
#if UNDERLAY_ON |
|||
d = tex2D(_MainTex, input.texcoord2.xy).a * layerScale; |
|||
faceColor += float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a) * saturate(d - layerBias) * (1 - faceColor.a); |
|||
#endif |
|||
|
|||
#if UNDERLAY_INNER |
|||
float bias = input.param.x * scale - 0.5; |
|||
float sd = saturate(d * scale - bias - input.param.z); |
|||
d = tex2D(_MainTex, input.texcoord2.xy).a * layerScale; |
|||
faceColor += float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a) * (1 - saturate(d - layerBias)) * sd * (1 - faceColor.a); |
|||
#endif |
|||
|
|||
#if (UNDERLAY_ON | UNDERLAY_INNER) |
|||
faceColor *= input.texcoord2.z; |
|||
#endif |
|||
|
|||
faceColor *= tex2D(_GUIClipTexture, input.clipUV).a; |
|||
|
|||
return faceColor; |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
fileFormatVersion: 2 |
|||
guid: abe6991365a27d341a10580f3b7c0f44 |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,8 @@ |
|||
fileFormatVersion: 2 |
|||
guid: f8e6a2d47aba4c6c9b3c5a72d9f48da5 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,53 @@ |
|||
fileFormatVersion: 2 |
|||
guid: fb5730e24283d0c489e5c7d0bee023d9 |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: .25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: .5, y: .5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,53 @@ |
|||
fileFormatVersion: 2 |
|||
guid: e3b0f810fdea84e40ab4ba20f256f7e8 |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: .25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: .5, y: .5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,53 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 8bc445bb79654bf496c92d0407840a92 |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: .25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: .5, y: .5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,53 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 18775b51e3bd42299fd30bd036ea982f |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: .25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: .5, y: .5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,53 @@ |
|||
fileFormatVersion: 2 |
|||
guid: ca51b19024094d1b87f3e07edb0a75fb |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: .25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: .5, y: .5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,53 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 585b70cb75dd43efbfead809c30a1731 |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: .25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: .5, y: .5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,58 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 0d9a36012a224080966c7b55896aa0f9 |
|||
timeCreated: 1467964791 |
|||
licenseType: Pro |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: 0.25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 7 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
allowsAlphaSplitting: 0 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: 0.5, y: 0.5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
serializedVersion: 2 |
|||
sprites: [] |
|||
outline: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,58 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 49679f302ac6408697f6b9314a38985c |
|||
timeCreated: 1467964413 |
|||
licenseType: Pro |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: 0.25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 7 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
allowsAlphaSplitting: 0 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: 0.5, y: 0.5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
serializedVersion: 2 |
|||
sprites: [] |
|||
outline: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,53 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 81ed8c76d2bc4a4c95d092c98af4e58f |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: .25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: .5, y: .5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,56 @@ |
|||
fileFormatVersion: 2 |
|||
guid: c76700ea0062413d9f69409b4e9e151b |
|||
timeCreated: 1484171296 |
|||
licenseType: Pro |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: .25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
allowsAlphaSplitting: 0 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: .5, y: .5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,56 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 35ff0937876540d3bd4b6a941df62a92 |
|||
timeCreated: 1484171296 |
|||
licenseType: Pro |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: .25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
allowsAlphaSplitting: 0 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: .5, y: .5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,53 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 6ace62d30f494c948b71d5594afce11d |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: .25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: .5, y: .5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,53 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 691475c57a824010be0c6f474caeb7e1 |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: .25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: .5, y: .5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,53 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 64b9fad609434c489c32b1cdf2004a1c |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: .25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: .5, y: .5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,59 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 92027f7f8cfc4feaa477da0dc38d3d46 |
|||
timeCreated: 1472535271 |
|||
licenseType: Pro |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: 0.25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 7 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
allowsAlphaSplitting: 0 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: 0.5, y: 0.5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
spriteTessellationDetail: -1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
serializedVersion: 2 |
|||
sprites: [] |
|||
outline: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,59 @@ |
|||
fileFormatVersion: 2 |
|||
guid: fa6bd40a216346b783a4cce741d277a5 |
|||
timeCreated: 1472535778 |
|||
licenseType: Pro |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: 0.25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 7 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
allowsAlphaSplitting: 0 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: 0.5, y: 0.5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
spriteTessellationDetail: -1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
serializedVersion: 2 |
|||
sprites: [] |
|||
outline: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,53 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 9288066c33474b94b6ee5465f4df1cc0 |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: .25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: .5, y: .5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,53 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 12736c98af174f91827a26b66d2b01b9 |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: .25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: .5, y: .5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,58 @@ |
|||
fileFormatVersion: 2 |
|||
guid: c2f7f6a88b4c4f20a53deb72f3d9144c |
|||
timeCreated: 1426240649 |
|||
licenseType: Store |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: 0.25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
allowsAlphaSplitting: 0 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: 0.5, y: 0.5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
serializedVersion: 2 |
|||
sprites: [] |
|||
outline: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,53 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 41b96614b2e6494ba995ddcd252d11ae |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: .25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: .5, y: .5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,53 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 066619c9c9c84f89acb1b48c11a7efe2 |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: .25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: .5, y: .5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,58 @@ |
|||
fileFormatVersion: 2 |
|||
guid: bb42b2d967d6427983c901a4ffc8ecd9 |
|||
timeCreated: 1426240650 |
|||
licenseType: Store |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: 0.25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
allowsAlphaSplitting: 0 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: 0.5, y: 0.5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
serializedVersion: 2 |
|||
sprites: [] |
|||
outline: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,53 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 342a0f8aca7f4f0691338912faec0494 |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: .25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: .5, y: .5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,53 @@ |
|||
fileFormatVersion: 2 |
|||
guid: e05ace3bd15740cda0bad60d89092a5b |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: .25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: .5, y: .5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,53 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 48d034c499ee4697af9dd6e327110249 |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: .25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: .5, y: .5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,53 @@ |
|||
fileFormatVersion: 2 |
|||
guid: ed041e68439749a69d0efa0e3d896c2e |
|||
TextureImporter: |
|||
fileIDToRecycleName: {} |
|||
serializedVersion: 2 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
linearTexture: 1 |
|||
correctGamma: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: .25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 0 |
|||
cubemapConvolution: 0 |
|||
cubemapConvolutionSteps: 8 |
|||
cubemapConvolutionExponent: 1.5 |
|||
seamlessCubemap: 0 |
|||
textureFormat: -3 |
|||
maxTextureSize: 32 |
|||
textureSettings: |
|||
filterMode: 0 |
|||
aniso: 1 |
|||
mipBias: -1 |
|||
wrapMode: 1 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
rGBM: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: .5, y: .5} |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spritePixelsToUnits: 100 |
|||
alphaIsTransparency: 1 |
|||
textureType: 2 |
|||
buildTargetSettings: [] |
|||
spriteSheet: |
|||
sprites: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,8 @@ |
|||
fileFormatVersion: 2 |
|||
guid: bee384ad5b4d1a843a018082e7db53cd |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,8 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 10d1425d9e87841d9a9deafe9e93a6f2 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,8 @@ |
|||
fileFormatVersion: 2 |
|||
guid: eecc124dc0b994047aac97ccf8c8ed0a |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,677 @@ |
|||
#if HDRP_10_7_OR_NEWER
|
|||
using UnityEngine; |
|||
using UnityEditor; |
|||
using UnityEditor.Rendering.HighDefinition; |
|||
|
|||
|
|||
namespace TMPro.EditorUtilities |
|||
{ |
|||
/// <summary>Base class for TextMesh Pro shader GUIs.</summary>
|
|||
internal abstract class TMP_BaseHDRPLitShaderGUI : LightingShaderGraphGUI |
|||
{ |
|||
/// <summary>Representation of a #pragma shader_feature.</summary>
|
|||
/// <description>It is assumed that the first feature option is for no keyword (underscores).</description>
|
|||
protected class ShaderFeature |
|||
{ |
|||
public string undoLabel; |
|||
|
|||
public GUIContent label; |
|||
|
|||
/// <summary>The keyword labels, for display. Include the no-keyword as the first option.</summary>
|
|||
public GUIContent[] keywordLabels; |
|||
|
|||
/// <summary>The shader keywords. Exclude the no-keyword option.</summary>
|
|||
public string[] keywords; |
|||
|
|||
int m_State; |
|||
|
|||
public bool Active |
|||
{ |
|||
get { return m_State >= 0; } |
|||
} |
|||
|
|||
public int State |
|||
{ |
|||
get { return m_State; } |
|||
} |
|||
|
|||
public void ReadState(Material material) |
|||
{ |
|||
for (int i = 0; i < keywords.Length; i++) |
|||
{ |
|||
if (material.IsKeywordEnabled(keywords[i])) |
|||
{ |
|||
m_State = i; |
|||
return; |
|||
} |
|||
} |
|||
|
|||
m_State = -1; |
|||
} |
|||
|
|||
public void SetActive(bool active, Material material) |
|||
{ |
|||
m_State = active ? 0 : -1; |
|||
SetStateKeywords(material); |
|||
} |
|||
|
|||
public void DoPopup(MaterialEditor editor, Material material) |
|||
{ |
|||
EditorGUI.BeginChangeCheck(); |
|||
int selection = EditorGUILayout.Popup(label, m_State + 1, keywordLabels); |
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
m_State = selection - 1; |
|||
editor.RegisterPropertyChangeUndo(undoLabel); |
|||
SetStateKeywords(material); |
|||
} |
|||
} |
|||
|
|||
void SetStateKeywords(Material material) |
|||
{ |
|||
for (int i = 0; i < keywords.Length; i++) |
|||
{ |
|||
if (i == m_State) |
|||
{ |
|||
material.EnableKeyword(keywords[i]); |
|||
} |
|||
else |
|||
{ |
|||
material.DisableKeyword(keywords[i]); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
static GUIContent s_TempLabel = new GUIContent(); |
|||
|
|||
protected static bool s_DebugExtended; |
|||
|
|||
static int s_UndoRedoCount, s_LastSeenUndoRedoCount; |
|||
|
|||
static float[][] s_TempFloats = |
|||
{ |
|||
null, new float[1], new float[2], new float[3], new float[4] |
|||
}; |
|||
|
|||
protected static GUIContent[] s_XywhVectorLabels = |
|||
{ |
|||
new GUIContent("X"), |
|||
new GUIContent("Y"), |
|||
new GUIContent("W", "Width"), |
|||
new GUIContent("H", "Height") |
|||
}; |
|||
|
|||
protected static GUIContent[] s_LbrtVectorLabels = |
|||
{ |
|||
new GUIContent("L", "Left"), |
|||
new GUIContent("B", "Bottom"), |
|||
new GUIContent("R", "Right"), |
|||
new GUIContent("T", "Top") |
|||
}; |
|||
|
|||
protected static GUIContent[] s_CullingTypeLabels = |
|||
{ |
|||
new GUIContent("Off"), |
|||
new GUIContent("Front"), |
|||
new GUIContent("Back") |
|||
}; |
|||
|
|||
static TMP_BaseHDRPLitShaderGUI() |
|||
{ |
|||
// Keep track of how many undo/redo events happened.
|
|||
Undo.undoRedoPerformed += () => s_UndoRedoCount += 1; |
|||
} |
|||
|
|||
bool m_IsNewGUI = true; |
|||
|
|||
float m_DragAndDropMinY; |
|||
|
|||
protected MaterialEditor m_Editor; |
|||
|
|||
protected Material m_Material; |
|||
|
|||
protected MaterialProperty[] m_Properties; |
|||
|
|||
void PrepareGUI() |
|||
{ |
|||
m_IsNewGUI = false; |
|||
ShaderUtilities.GetShaderPropertyIDs(); |
|||
|
|||
// New GUI just got constructed. This happens in response to a selection,
|
|||
// but also after undo/redo events.
|
|||
if (s_LastSeenUndoRedoCount != s_UndoRedoCount) |
|||
{ |
|||
// There's been at least one undo/redo since the last time this GUI got constructed.
|
|||
// Maybe the undo/redo was for this material? Assume that is was.
|
|||
TMPro_EventManager.ON_MATERIAL_PROPERTY_CHANGED(true, m_Material as Material); |
|||
} |
|||
|
|||
s_LastSeenUndoRedoCount = s_UndoRedoCount; |
|||
} |
|||
|
|||
protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialProperty[] properties) |
|||
{ |
|||
m_Editor = materialEditor; |
|||
m_Material = materialEditor.target as Material; |
|||
this.m_Properties = properties; |
|||
|
|||
if (m_IsNewGUI) |
|||
{ |
|||
PrepareGUI(); |
|||
} |
|||
|
|||
DoDragAndDropBegin(); |
|||
EditorGUI.BeginChangeCheck(); |
|||
DoGUI(); |
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
TMPro_EventManager.ON_MATERIAL_PROPERTY_CHANGED(true, m_Material); |
|||
} |
|||
|
|||
DoDragAndDropEnd(); |
|||
} |
|||
|
|||
/// <summary>Override this method to create the specific shader GUI.</summary>
|
|||
protected abstract void DoGUI(); |
|||
|
|||
static string[] s_PanelStateLabel = new string[] { "\t- <i>Click to collapse</i> -", "\t- <i>Click to expand</i> -" }; |
|||
|
|||
protected bool BeginPanel(string panel, bool expanded) |
|||
{ |
|||
EditorGUI.indentLevel = 0; |
|||
|
|||
EditorGUILayout.BeginVertical(EditorStyles.helpBox); |
|||
Rect r = EditorGUI.IndentedRect(GUILayoutUtility.GetRect(20, 18)); |
|||
r.x += 20; |
|||
r.width += 6; |
|||
|
|||
bool enabled = GUI.enabled; |
|||
GUI.enabled = true; |
|||
expanded = TMP_EditorUtility.EditorToggle(r, expanded, new GUIContent(panel), TMP_UIStyleManager.panelTitle); |
|||
r.width -= 30; |
|||
EditorGUI.LabelField(r, new GUIContent(expanded ? s_PanelStateLabel[0] : s_PanelStateLabel[1]), TMP_UIStyleManager.rightLabel); |
|||
GUI.enabled = enabled; |
|||
|
|||
EditorGUI.indentLevel += 1; |
|||
EditorGUI.BeginDisabledGroup(false); |
|||
|
|||
return expanded; |
|||
} |
|||
|
|||
protected bool BeginPanel(string panel, ShaderFeature feature, bool expanded, bool readState = true) |
|||
{ |
|||
EditorGUI.indentLevel = 0; |
|||
|
|||
if (readState) |
|||
{ |
|||
feature.ReadState(m_Material); |
|||
} |
|||
|
|||
EditorGUI.BeginChangeCheck(); |
|||
|
|||
EditorGUILayout.BeginVertical(EditorStyles.helpBox); |
|||
GUILayout.BeginHorizontal(); |
|||
|
|||
Rect r = EditorGUI.IndentedRect(GUILayoutUtility.GetRect(20, 20, GUILayout.Width(20f))); |
|||
bool active = EditorGUI.Toggle(r, feature.Active); |
|||
|
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
m_Editor.RegisterPropertyChangeUndo(feature.undoLabel); |
|||
feature.SetActive(active, m_Material); |
|||
} |
|||
|
|||
r = EditorGUI.IndentedRect(GUILayoutUtility.GetRect(20, 18)); |
|||
r.width += 6; |
|||
|
|||
bool enabled = GUI.enabled; |
|||
GUI.enabled = true; |
|||
expanded = TMP_EditorUtility.EditorToggle(r, expanded, new GUIContent(panel), TMP_UIStyleManager.panelTitle); |
|||
r.width -= 10; |
|||
EditorGUI.LabelField(r, new GUIContent(expanded ? s_PanelStateLabel[0] : s_PanelStateLabel[1]), TMP_UIStyleManager.rightLabel); |
|||
GUI.enabled = enabled; |
|||
|
|||
GUILayout.EndHorizontal(); |
|||
|
|||
EditorGUI.indentLevel += 1; |
|||
EditorGUI.BeginDisabledGroup(!active); |
|||
|
|||
return expanded; |
|||
} |
|||
|
|||
protected void EndPanel() |
|||
{ |
|||
EditorGUI.EndDisabledGroup(); |
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.EndVertical(); |
|||
} |
|||
|
|||
MaterialProperty BeginProperty(string name) |
|||
{ |
|||
MaterialProperty property = FindProperty(name, m_Properties); |
|||
EditorGUI.BeginChangeCheck(); |
|||
EditorGUI.showMixedValue = property.hasMixedValue; |
|||
m_Editor.BeginAnimatedCheck(Rect.zero, property); |
|||
|
|||
return property; |
|||
} |
|||
|
|||
bool EndProperty() |
|||
{ |
|||
m_Editor.EndAnimatedCheck(); |
|||
EditorGUI.showMixedValue = false; |
|||
return EditorGUI.EndChangeCheck(); |
|||
} |
|||
|
|||
protected void DoPopup(string name, string label, GUIContent[] options) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
s_TempLabel.text = label; |
|||
int index = EditorGUILayout.Popup(s_TempLabel, (int)property.floatValue, options); |
|||
if (EndProperty()) |
|||
{ |
|||
property.floatValue = index; |
|||
} |
|||
} |
|||
|
|||
protected void DoCubeMap(string name, string label) |
|||
{ |
|||
DoTexture(name, label, typeof(Cubemap)); |
|||
} |
|||
|
|||
protected void DoTexture2D(string name, string label, bool withTilingOffset = false, string[] speedNames = null) |
|||
{ |
|||
DoTexture(name, label, typeof(Texture2D), withTilingOffset, speedNames); |
|||
} |
|||
|
|||
void DoTexture(string name, string label, System.Type type, bool withTilingOffset = false, string[] speedNames = null) |
|||
{ |
|||
float objFieldSize = 60f; |
|||
bool smallLayout = EditorGUIUtility.currentViewWidth <= 440f && (withTilingOffset || speedNames != null); |
|||
float controlHeight = smallLayout ? objFieldSize * 2 : objFieldSize; |
|||
|
|||
MaterialProperty property = FindProperty(name, m_Properties); |
|||
m_Editor.BeginAnimatedCheck(Rect.zero, property); |
|||
|
|||
Rect rect = EditorGUILayout.GetControlRect(true, controlHeight); |
|||
float totalWidth = rect.width; |
|||
rect.width = EditorGUIUtility.labelWidth + objFieldSize; |
|||
rect.height = objFieldSize; |
|||
s_TempLabel.text = label; |
|||
|
|||
EditorGUI.BeginChangeCheck(); |
|||
Object tex = EditorGUI.ObjectField(rect, s_TempLabel, property.textureValue, type, false); |
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
property.textureValue = tex as Texture; |
|||
} |
|||
|
|||
float additionalHeight = controlHeight - objFieldSize; |
|||
float xOffset = smallLayout ? rect.width - objFieldSize : rect.width; |
|||
|
|||
rect.y += additionalHeight; |
|||
rect.x += xOffset; |
|||
rect.width = totalWidth - xOffset; |
|||
rect.height = EditorGUIUtility.singleLineHeight; |
|||
|
|||
if (withTilingOffset) |
|||
{ |
|||
DoTilingOffset(rect, property); |
|||
rect.y += (rect.height + 2f) * 2f; |
|||
} |
|||
|
|||
m_Editor.EndAnimatedCheck(); |
|||
|
|||
if (speedNames != null) |
|||
{ |
|||
DoUVSpeed(rect, speedNames); |
|||
} |
|||
} |
|||
|
|||
void DoTilingOffset(Rect rect, MaterialProperty property) |
|||
{ |
|||
float labelWidth = EditorGUIUtility.labelWidth; |
|||
int indentLevel = EditorGUI.indentLevel; |
|||
EditorGUI.indentLevel = 0; |
|||
EditorGUIUtility.labelWidth = Mathf.Min(40f, rect.width * 0.40f); |
|||
|
|||
Vector4 vector = property.textureScaleAndOffset; |
|||
|
|||
bool changed = false; |
|||
float[] values = s_TempFloats[2]; |
|||
|
|||
s_TempLabel.text = "Tiling"; |
|||
Rect vectorRect = EditorGUI.PrefixLabel(rect, s_TempLabel); |
|||
values[0] = vector.x; |
|||
values[1] = vector.y; |
|||
|
|||
EditorGUI.BeginChangeCheck(); |
|||
EditorGUI.MultiFloatField(vectorRect, s_XywhVectorLabels, values); |
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
vector.x = values[0]; |
|||
vector.y = values[1]; |
|||
changed = true; |
|||
} |
|||
|
|||
rect.y += rect.height + 2f; |
|||
s_TempLabel.text = "Offset"; |
|||
vectorRect = EditorGUI.PrefixLabel(rect, s_TempLabel); |
|||
values[0] = vector.z; |
|||
values[1] = vector.w; |
|||
|
|||
EditorGUI.BeginChangeCheck(); |
|||
EditorGUI.MultiFloatField(vectorRect, s_XywhVectorLabels, values); |
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
vector.z = values[0]; |
|||
vector.w = values[1]; |
|||
changed = true; |
|||
} |
|||
|
|||
if (changed) |
|||
{ |
|||
property.textureScaleAndOffset = vector; |
|||
} |
|||
|
|||
EditorGUIUtility.labelWidth = labelWidth; |
|||
EditorGUI.indentLevel = indentLevel; |
|||
} |
|||
|
|||
void DoUVSpeed(Rect rect, string[] names) |
|||
{ |
|||
float labelWidth = EditorGUIUtility.labelWidth; |
|||
int indentLevel = EditorGUI.indentLevel; |
|||
EditorGUI.indentLevel = 0; |
|||
EditorGUIUtility.labelWidth = Mathf.Min(40f, rect.width * 0.40f); |
|||
|
|||
s_TempLabel.text = "Speed"; |
|||
rect = EditorGUI.PrefixLabel(rect, s_TempLabel); |
|||
|
|||
EditorGUIUtility.labelWidth = 10f; |
|||
rect.width = rect.width * 0.5f - 2f; |
|||
|
|||
if (names.Length == 1) |
|||
{ |
|||
DoFloat2(rect, names[0]); |
|||
} |
|||
else |
|||
{ |
|||
DoFloat(rect, names[0], "X"); |
|||
rect.x += rect.width + 4f; |
|||
DoFloat(rect, names[1], "Y"); |
|||
} |
|||
|
|||
EditorGUIUtility.labelWidth = labelWidth; |
|||
EditorGUI.indentLevel = indentLevel; |
|||
} |
|||
|
|||
protected void DoToggle(string name, string label) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
s_TempLabel.text = label; |
|||
bool value = EditorGUILayout.Toggle(s_TempLabel, property.floatValue == 1f); |
|||
if (EndProperty()) |
|||
{ |
|||
property.floatValue = value ? 1f : 0f; |
|||
} |
|||
} |
|||
|
|||
protected void DoFloat(string name, string label) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
Rect rect = EditorGUILayout.GetControlRect(); |
|||
rect.width = EditorGUIUtility.labelWidth + 55f; |
|||
s_TempLabel.text = label; |
|||
float value = EditorGUI.FloatField(rect, s_TempLabel, property.floatValue); |
|||
if (EndProperty()) |
|||
{ |
|||
property.floatValue = value; |
|||
} |
|||
} |
|||
|
|||
protected void DoColor(string name, string label) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
s_TempLabel.text = label; |
|||
Color value = EditorGUI.ColorField(EditorGUILayout.GetControlRect(), s_TempLabel, property.colorValue, false, true, true); |
|||
if (EndProperty()) |
|||
{ |
|||
property.colorValue = value; |
|||
} |
|||
} |
|||
|
|||
void DoFloat(Rect rect, string name, string label) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
s_TempLabel.text = label; |
|||
float value = EditorGUI.FloatField(rect, s_TempLabel, property.floatValue); |
|||
if (EndProperty()) |
|||
{ |
|||
property.floatValue = value; |
|||
} |
|||
} |
|||
|
|||
void DoFloat2(Rect rect, string name) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
|
|||
float x = EditorGUI.FloatField(rect, "X", property.vectorValue.x); |
|||
rect.x += rect.width + 4f; |
|||
float y = EditorGUI.FloatField(rect, "Y", property.vectorValue.y); |
|||
|
|||
if (EndProperty()) |
|||
{ |
|||
property.vectorValue = new Vector2(x, y); |
|||
} |
|||
} |
|||
|
|||
protected void DoOffset(string name, string label) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
s_TempLabel.text = label; |
|||
Vector2 value = EditorGUI.Vector2Field(EditorGUILayout.GetControlRect(), s_TempLabel, property.vectorValue); |
|||
if (EndProperty()) |
|||
{ |
|||
property.vectorValue = value; |
|||
} |
|||
} |
|||
|
|||
protected void DoSlider(string name, string label) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
Vector2 range = property.rangeLimits; |
|||
s_TempLabel.text = label; |
|||
float value = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, property.floatValue, range.x, range.y); |
|||
if (EndProperty()) |
|||
{ |
|||
property.floatValue = value; |
|||
} |
|||
} |
|||
|
|||
protected void DoSlider(string name, Vector2 range, string label) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
s_TempLabel.text = label; |
|||
float value = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, property.floatValue, range.x, range.y); |
|||
if (EndProperty()) |
|||
{ |
|||
property.floatValue = value; |
|||
} |
|||
} |
|||
|
|||
protected void DoSlider(string propertyName, string propertyField, string label) |
|||
{ |
|||
MaterialProperty property = BeginProperty(propertyName); |
|||
Vector2 range = property.rangeLimits; |
|||
s_TempLabel.text = label; |
|||
|
|||
Vector4 value = property.vectorValue; |
|||
|
|||
switch (propertyField) |
|||
{ |
|||
case "X": |
|||
value.x = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.x, range.x, range.y); |
|||
break; |
|||
case "Y": |
|||
value.y = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.y, range.x, range.y); |
|||
break; |
|||
case "Z": |
|||
value.z = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.z, range.x, range.y); |
|||
break; |
|||
case "W": |
|||
value.w = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.w, range.x, range.y); |
|||
break; |
|||
} |
|||
|
|||
if (EndProperty()) |
|||
{ |
|||
property.vectorValue = value; |
|||
} |
|||
} |
|||
|
|||
protected void DoSlider(string propertyName, string propertyField, Vector2 range, string label) |
|||
{ |
|||
MaterialProperty property = BeginProperty(propertyName); |
|||
s_TempLabel.text = label; |
|||
|
|||
Vector4 value = property.vectorValue; |
|||
|
|||
switch (propertyField) |
|||
{ |
|||
case "X": |
|||
value.x = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.x, range.x, range.y); |
|||
break; |
|||
case "Y": |
|||
value.y = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.y, range.x, range.y); |
|||
break; |
|||
case "Z": |
|||
value.z = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.z, range.x, range.y); |
|||
break; |
|||
case "W": |
|||
value.w = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.w, range.x, range.y); |
|||
break; |
|||
} |
|||
|
|||
if (EndProperty()) |
|||
{ |
|||
property.vectorValue = value; |
|||
} |
|||
} |
|||
|
|||
protected void DoVector2(string name, string label) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
s_TempLabel.text = label; |
|||
Vector4 value = EditorGUILayout.Vector3Field(s_TempLabel, property.vectorValue); |
|||
if (EndProperty()) |
|||
{ |
|||
property.vectorValue = value; |
|||
} |
|||
} |
|||
|
|||
protected void DoVector3(string name, string label) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
s_TempLabel.text = label; |
|||
Vector4 value = EditorGUILayout.Vector3Field(s_TempLabel, property.vectorValue); |
|||
if (EndProperty()) |
|||
{ |
|||
property.vectorValue = value; |
|||
} |
|||
} |
|||
|
|||
protected void DoVector(string name, string label, GUIContent[] subLabels) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
Rect rect = EditorGUILayout.GetControlRect(); |
|||
s_TempLabel.text = label; |
|||
rect = EditorGUI.PrefixLabel(rect, s_TempLabel); |
|||
Vector4 vector = property.vectorValue; |
|||
|
|||
float[] values = s_TempFloats[subLabels.Length]; |
|||
for (int i = 0; i < subLabels.Length; i++) |
|||
{ |
|||
values[i] = vector[i]; |
|||
} |
|||
|
|||
EditorGUI.MultiFloatField(rect, subLabels, values); |
|||
if (EndProperty()) |
|||
{ |
|||
for (int i = 0; i < subLabels.Length; i++) |
|||
{ |
|||
vector[i] = values[i]; |
|||
} |
|||
|
|||
property.vectorValue = vector; |
|||
} |
|||
} |
|||
|
|||
void DoDragAndDropBegin() |
|||
{ |
|||
m_DragAndDropMinY = GUILayoutUtility.GetRect(0f, 0f, GUILayout.ExpandWidth(true)).y; |
|||
} |
|||
|
|||
void DoDragAndDropEnd() |
|||
{ |
|||
Rect rect = GUILayoutUtility.GetRect(0f, 0f, GUILayout.ExpandWidth(true)); |
|||
Event evt = Event.current; |
|||
if (evt.type == EventType.DragUpdated) |
|||
{ |
|||
DragAndDrop.visualMode = DragAndDropVisualMode.Generic; |
|||
evt.Use(); |
|||
} |
|||
else if ( |
|||
evt.type == EventType.DragPerform && |
|||
Rect.MinMaxRect(rect.xMin, m_DragAndDropMinY, rect.xMax, rect.yMax).Contains(evt.mousePosition) |
|||
) |
|||
{ |
|||
DragAndDrop.AcceptDrag(); |
|||
evt.Use(); |
|||
Material droppedMaterial = DragAndDrop.objectReferences[0] as Material; |
|||
if (droppedMaterial && droppedMaterial != m_Material) |
|||
{ |
|||
PerformDrop(droppedMaterial); |
|||
} |
|||
} |
|||
} |
|||
|
|||
void PerformDrop(Material droppedMaterial) |
|||
{ |
|||
Texture droppedTex = droppedMaterial.GetTexture(ShaderUtilities.ID_MainTex); |
|||
if (!droppedTex) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
Texture currentTex = m_Material.GetTexture(ShaderUtilities.ID_MainTex); |
|||
TMP_FontAsset requiredFontAsset = null; |
|||
if (droppedTex != currentTex) |
|||
{ |
|||
requiredFontAsset = TMP_EditorUtility.FindMatchingFontAsset(droppedMaterial); |
|||
if (!requiredFontAsset) |
|||
{ |
|||
return; |
|||
} |
|||
} |
|||
|
|||
foreach (GameObject o in Selection.gameObjects) |
|||
{ |
|||
if (requiredFontAsset) |
|||
{ |
|||
TMP_Text textComponent = o.GetComponent<TMP_Text>(); |
|||
if (textComponent) |
|||
{ |
|||
Undo.RecordObject(textComponent, "Font Asset Change"); |
|||
textComponent.font = requiredFontAsset; |
|||
} |
|||
} |
|||
|
|||
TMPro_EventManager.ON_DRAG_AND_DROP_MATERIAL_CHANGED(o, m_Material, droppedMaterial); |
|||
EditorUtility.SetDirty(o); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
#endif
|
|||
@ -0,0 +1,12 @@ |
|||
fileFormatVersion: 2 |
|||
guid: e3795795b029fde4395e6953ce72b5a6 |
|||
timeCreated: 1469844810 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,681 @@ |
|||
#if HDRP_10_7_OR_NEWER
|
|||
using UnityEngine; |
|||
using UnityEditor; |
|||
using UnityEditor.Rendering.HighDefinition; |
|||
|
|||
|
|||
namespace TMPro.EditorUtilities |
|||
{ |
|||
/// <summary>Base class for TextMesh Pro shader GUIs.</summary>
|
|||
#if HDRP_11_OR_NEWER
|
|||
internal abstract class TMP_BaseHDRPUnlitShaderGUI : UnlitShaderGraphGUI |
|||
#else
|
|||
internal abstract class TMP_BaseHDRPUnlitShaderGUI : HDUnlitGUI |
|||
#endif
|
|||
{ |
|||
/// <summary>Representation of a #pragma shader_feature.</summary>
|
|||
/// <description>It is assumed that the first feature option is for no keyword (underscores).</description>
|
|||
protected class ShaderFeature |
|||
{ |
|||
public string undoLabel; |
|||
|
|||
public GUIContent label; |
|||
|
|||
/// <summary>The keyword labels, for display. Include the no-keyword as the first option.</summary>
|
|||
public GUIContent[] keywordLabels; |
|||
|
|||
/// <summary>The shader keywords. Exclude the no-keyword option.</summary>
|
|||
public string[] keywords; |
|||
|
|||
int m_State; |
|||
|
|||
public bool Active |
|||
{ |
|||
get { return m_State >= 0; } |
|||
} |
|||
|
|||
public int State |
|||
{ |
|||
get { return m_State; } |
|||
} |
|||
|
|||
public void ReadState(Material material) |
|||
{ |
|||
for (int i = 0; i < keywords.Length; i++) |
|||
{ |
|||
if (material.IsKeywordEnabled(keywords[i])) |
|||
{ |
|||
m_State = i; |
|||
return; |
|||
} |
|||
} |
|||
|
|||
m_State = -1; |
|||
} |
|||
|
|||
public void SetActive(bool active, Material material) |
|||
{ |
|||
m_State = active ? 0 : -1; |
|||
SetStateKeywords(material); |
|||
} |
|||
|
|||
public void DoPopup(MaterialEditor editor, Material material) |
|||
{ |
|||
EditorGUI.BeginChangeCheck(); |
|||
int selection = EditorGUILayout.Popup(label, m_State + 1, keywordLabels); |
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
m_State = selection - 1; |
|||
editor.RegisterPropertyChangeUndo(undoLabel); |
|||
SetStateKeywords(material); |
|||
} |
|||
} |
|||
|
|||
void SetStateKeywords(Material material) |
|||
{ |
|||
for (int i = 0; i < keywords.Length; i++) |
|||
{ |
|||
if (i == m_State) |
|||
{ |
|||
material.EnableKeyword(keywords[i]); |
|||
} |
|||
else |
|||
{ |
|||
material.DisableKeyword(keywords[i]); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
static GUIContent s_TempLabel = new GUIContent(); |
|||
|
|||
protected static bool s_DebugExtended; |
|||
|
|||
static int s_UndoRedoCount, s_LastSeenUndoRedoCount; |
|||
|
|||
static float[][] s_TempFloats = |
|||
{ |
|||
null, new float[1], new float[2], new float[3], new float[4] |
|||
}; |
|||
|
|||
protected static GUIContent[] s_XywhVectorLabels = |
|||
{ |
|||
new GUIContent("X"), |
|||
new GUIContent("Y"), |
|||
new GUIContent("W", "Width"), |
|||
new GUIContent("H", "Height") |
|||
}; |
|||
|
|||
protected static GUIContent[] s_LbrtVectorLabels = |
|||
{ |
|||
new GUIContent("L", "Left"), |
|||
new GUIContent("B", "Bottom"), |
|||
new GUIContent("R", "Right"), |
|||
new GUIContent("T", "Top") |
|||
}; |
|||
|
|||
protected static GUIContent[] s_CullingTypeLabels = |
|||
{ |
|||
new GUIContent("Off"), |
|||
new GUIContent("Front"), |
|||
new GUIContent("Back") |
|||
}; |
|||
|
|||
static TMP_BaseHDRPUnlitShaderGUI() |
|||
{ |
|||
// Keep track of how many undo/redo events happened.
|
|||
Undo.undoRedoPerformed += () => s_UndoRedoCount += 1; |
|||
} |
|||
|
|||
bool m_IsNewGUI = true; |
|||
|
|||
float m_DragAndDropMinY; |
|||
|
|||
protected MaterialEditor m_Editor; |
|||
|
|||
protected Material m_Material; |
|||
|
|||
protected MaterialProperty[] m_Properties; |
|||
|
|||
void PrepareGUI() |
|||
{ |
|||
m_IsNewGUI = false; |
|||
ShaderUtilities.GetShaderPropertyIDs(); |
|||
|
|||
// New GUI just got constructed. This happens in response to a selection,
|
|||
// but also after undo/redo events.
|
|||
if (s_LastSeenUndoRedoCount != s_UndoRedoCount) |
|||
{ |
|||
// There's been at least one undo/redo since the last time this GUI got constructed.
|
|||
// Maybe the undo/redo was for this material? Assume that is was.
|
|||
TMPro_EventManager.ON_MATERIAL_PROPERTY_CHANGED(true, m_Material as Material); |
|||
} |
|||
|
|||
s_LastSeenUndoRedoCount = s_UndoRedoCount; |
|||
} |
|||
|
|||
protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialProperty[] properties) |
|||
{ |
|||
m_Editor = materialEditor; |
|||
m_Material = materialEditor.target as Material; |
|||
this.m_Properties = properties; |
|||
|
|||
if (m_IsNewGUI) |
|||
{ |
|||
PrepareGUI(); |
|||
} |
|||
|
|||
DoDragAndDropBegin(); |
|||
EditorGUI.BeginChangeCheck(); |
|||
DoGUI(); |
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
TMPro_EventManager.ON_MATERIAL_PROPERTY_CHANGED(true, m_Material); |
|||
} |
|||
|
|||
DoDragAndDropEnd(); |
|||
} |
|||
|
|||
/// <summary>Override this method to create the specific shader GUI.</summary>
|
|||
protected abstract void DoGUI(); |
|||
|
|||
static string[] s_PanelStateLabel = new string[] { "\t- <i>Click to collapse</i> -", "\t- <i>Click to expand</i> -" }; |
|||
|
|||
protected bool BeginPanel(string panel, bool expanded) |
|||
{ |
|||
EditorGUI.indentLevel = 0; |
|||
|
|||
EditorGUILayout.BeginVertical(EditorStyles.helpBox); |
|||
Rect r = EditorGUI.IndentedRect(GUILayoutUtility.GetRect(20, 18)); |
|||
r.x += 20; |
|||
r.width += 6; |
|||
|
|||
bool enabled = GUI.enabled; |
|||
GUI.enabled = true; |
|||
expanded = TMP_EditorUtility.EditorToggle(r, expanded, new GUIContent(panel), TMP_UIStyleManager.panelTitle); |
|||
r.width -= 30; |
|||
EditorGUI.LabelField(r, new GUIContent(expanded ? s_PanelStateLabel[0] : s_PanelStateLabel[1]), TMP_UIStyleManager.rightLabel); |
|||
GUI.enabled = enabled; |
|||
|
|||
EditorGUI.indentLevel += 1; |
|||
EditorGUI.BeginDisabledGroup(false); |
|||
|
|||
return expanded; |
|||
} |
|||
|
|||
protected bool BeginPanel(string panel, ShaderFeature feature, bool expanded, bool readState = true) |
|||
{ |
|||
EditorGUI.indentLevel = 0; |
|||
|
|||
if (readState) |
|||
{ |
|||
feature.ReadState(m_Material); |
|||
} |
|||
|
|||
EditorGUI.BeginChangeCheck(); |
|||
|
|||
EditorGUILayout.BeginVertical(EditorStyles.helpBox); |
|||
GUILayout.BeginHorizontal(); |
|||
|
|||
Rect r = EditorGUI.IndentedRect(GUILayoutUtility.GetRect(20, 20, GUILayout.Width(20f))); |
|||
bool active = EditorGUI.Toggle(r, feature.Active); |
|||
|
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
m_Editor.RegisterPropertyChangeUndo(feature.undoLabel); |
|||
feature.SetActive(active, m_Material); |
|||
} |
|||
|
|||
r = EditorGUI.IndentedRect(GUILayoutUtility.GetRect(20, 18)); |
|||
r.width += 6; |
|||
|
|||
bool enabled = GUI.enabled; |
|||
GUI.enabled = true; |
|||
expanded = TMP_EditorUtility.EditorToggle(r, expanded, new GUIContent(panel), TMP_UIStyleManager.panelTitle); |
|||
r.width -= 10; |
|||
EditorGUI.LabelField(r, new GUIContent(expanded ? s_PanelStateLabel[0] : s_PanelStateLabel[1]), TMP_UIStyleManager.rightLabel); |
|||
GUI.enabled = enabled; |
|||
|
|||
GUILayout.EndHorizontal(); |
|||
|
|||
EditorGUI.indentLevel += 1; |
|||
EditorGUI.BeginDisabledGroup(!active); |
|||
|
|||
return expanded; |
|||
} |
|||
|
|||
protected void EndPanel() |
|||
{ |
|||
EditorGUI.EndDisabledGroup(); |
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.EndVertical(); |
|||
} |
|||
|
|||
MaterialProperty BeginProperty(string name) |
|||
{ |
|||
MaterialProperty property = FindProperty(name, m_Properties); |
|||
EditorGUI.BeginChangeCheck(); |
|||
EditorGUI.showMixedValue = property.hasMixedValue; |
|||
m_Editor.BeginAnimatedCheck(Rect.zero, property); |
|||
|
|||
return property; |
|||
} |
|||
|
|||
bool EndProperty() |
|||
{ |
|||
m_Editor.EndAnimatedCheck(); |
|||
EditorGUI.showMixedValue = false; |
|||
return EditorGUI.EndChangeCheck(); |
|||
} |
|||
|
|||
protected void DoPopup(string name, string label, GUIContent[] options) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
s_TempLabel.text = label; |
|||
int index = EditorGUILayout.Popup(s_TempLabel, (int)property.floatValue, options); |
|||
if (EndProperty()) |
|||
{ |
|||
property.floatValue = index; |
|||
} |
|||
} |
|||
|
|||
protected void DoCubeMap(string name, string label) |
|||
{ |
|||
DoTexture(name, label, typeof(Cubemap)); |
|||
} |
|||
|
|||
protected void DoTexture2D(string name, string label, bool withTilingOffset = false, string[] speedNames = null) |
|||
{ |
|||
DoTexture(name, label, typeof(Texture2D), withTilingOffset, speedNames); |
|||
} |
|||
|
|||
void DoTexture(string name, string label, System.Type type, bool withTilingOffset = false, string[] speedNames = null) |
|||
{ |
|||
float objFieldSize = 60f; |
|||
bool smallLayout = EditorGUIUtility.currentViewWidth <= 440f && (withTilingOffset || speedNames != null); |
|||
float controlHeight = smallLayout ? objFieldSize * 2 : objFieldSize; |
|||
|
|||
MaterialProperty property = FindProperty(name, m_Properties); |
|||
m_Editor.BeginAnimatedCheck(Rect.zero, property); |
|||
|
|||
Rect rect = EditorGUILayout.GetControlRect(true, controlHeight); |
|||
float totalWidth = rect.width; |
|||
rect.width = EditorGUIUtility.labelWidth + objFieldSize; |
|||
rect.height = objFieldSize; |
|||
s_TempLabel.text = label; |
|||
|
|||
EditorGUI.BeginChangeCheck(); |
|||
Object tex = EditorGUI.ObjectField(rect, s_TempLabel, property.textureValue, type, false); |
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
property.textureValue = tex as Texture; |
|||
} |
|||
|
|||
float additionalHeight = controlHeight - objFieldSize; |
|||
float xOffset = smallLayout ? rect.width - objFieldSize : rect.width; |
|||
|
|||
rect.y += additionalHeight; |
|||
rect.x += xOffset; |
|||
rect.width = totalWidth - xOffset; |
|||
rect.height = EditorGUIUtility.singleLineHeight; |
|||
|
|||
if (withTilingOffset) |
|||
{ |
|||
DoTilingOffset(rect, property); |
|||
rect.y += (rect.height + 2f) * 2f; |
|||
} |
|||
|
|||
m_Editor.EndAnimatedCheck(); |
|||
|
|||
if (speedNames != null) |
|||
{ |
|||
DoUVSpeed(rect, speedNames); |
|||
} |
|||
} |
|||
|
|||
void DoTilingOffset(Rect rect, MaterialProperty property) |
|||
{ |
|||
float labelWidth = EditorGUIUtility.labelWidth; |
|||
int indentLevel = EditorGUI.indentLevel; |
|||
EditorGUI.indentLevel = 0; |
|||
EditorGUIUtility.labelWidth = Mathf.Min(40f, rect.width * 0.40f); |
|||
|
|||
Vector4 vector = property.textureScaleAndOffset; |
|||
|
|||
bool changed = false; |
|||
float[] values = s_TempFloats[2]; |
|||
|
|||
s_TempLabel.text = "Tiling"; |
|||
Rect vectorRect = EditorGUI.PrefixLabel(rect, s_TempLabel); |
|||
values[0] = vector.x; |
|||
values[1] = vector.y; |
|||
|
|||
EditorGUI.BeginChangeCheck(); |
|||
EditorGUI.MultiFloatField(vectorRect, s_XywhVectorLabels, values); |
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
vector.x = values[0]; |
|||
vector.y = values[1]; |
|||
changed = true; |
|||
} |
|||
|
|||
rect.y += rect.height + 2f; |
|||
s_TempLabel.text = "Offset"; |
|||
vectorRect = EditorGUI.PrefixLabel(rect, s_TempLabel); |
|||
values[0] = vector.z; |
|||
values[1] = vector.w; |
|||
|
|||
EditorGUI.BeginChangeCheck(); |
|||
EditorGUI.MultiFloatField(vectorRect, s_XywhVectorLabels, values); |
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
vector.z = values[0]; |
|||
vector.w = values[1]; |
|||
changed = true; |
|||
} |
|||
|
|||
if (changed) |
|||
{ |
|||
property.textureScaleAndOffset = vector; |
|||
} |
|||
|
|||
EditorGUIUtility.labelWidth = labelWidth; |
|||
EditorGUI.indentLevel = indentLevel; |
|||
} |
|||
|
|||
void DoUVSpeed(Rect rect, string[] names) |
|||
{ |
|||
float labelWidth = EditorGUIUtility.labelWidth; |
|||
int indentLevel = EditorGUI.indentLevel; |
|||
EditorGUI.indentLevel = 0; |
|||
EditorGUIUtility.labelWidth = Mathf.Min(40f, rect.width * 0.40f); |
|||
|
|||
s_TempLabel.text = "Speed"; |
|||
rect = EditorGUI.PrefixLabel(rect, s_TempLabel); |
|||
|
|||
EditorGUIUtility.labelWidth = 10f; |
|||
rect.width = rect.width * 0.5f - 2f; |
|||
|
|||
if (names.Length == 1) |
|||
{ |
|||
DoFloat2(rect, names[0]); |
|||
} |
|||
else |
|||
{ |
|||
DoFloat(rect, names[0], "X"); |
|||
rect.x += rect.width + 4f; |
|||
DoFloat(rect, names[1], "Y"); |
|||
} |
|||
|
|||
EditorGUIUtility.labelWidth = labelWidth; |
|||
EditorGUI.indentLevel = indentLevel; |
|||
} |
|||
|
|||
protected void DoToggle(string name, string label) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
s_TempLabel.text = label; |
|||
bool value = EditorGUILayout.Toggle(s_TempLabel, property.floatValue == 1f); |
|||
if (EndProperty()) |
|||
{ |
|||
property.floatValue = value ? 1f : 0f; |
|||
} |
|||
} |
|||
|
|||
protected void DoFloat(string name, string label) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
Rect rect = EditorGUILayout.GetControlRect(); |
|||
rect.width = EditorGUIUtility.labelWidth + 55f; |
|||
s_TempLabel.text = label; |
|||
float value = EditorGUI.FloatField(rect, s_TempLabel, property.floatValue); |
|||
if (EndProperty()) |
|||
{ |
|||
property.floatValue = value; |
|||
} |
|||
} |
|||
|
|||
protected void DoColor(string name, string label) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
s_TempLabel.text = label; |
|||
Color value = EditorGUI.ColorField(EditorGUILayout.GetControlRect(), s_TempLabel, property.colorValue, false, true, true); |
|||
if (EndProperty()) |
|||
{ |
|||
property.colorValue = value; |
|||
} |
|||
} |
|||
|
|||
void DoFloat(Rect rect, string name, string label) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
s_TempLabel.text = label; |
|||
float value = EditorGUI.FloatField(rect, s_TempLabel, property.floatValue); |
|||
if (EndProperty()) |
|||
{ |
|||
property.floatValue = value; |
|||
} |
|||
} |
|||
|
|||
void DoFloat2(Rect rect, string name) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
|
|||
float x = EditorGUI.FloatField(rect, "X", property.vectorValue.x); |
|||
rect.x += rect.width + 4f; |
|||
float y = EditorGUI.FloatField(rect, "Y", property.vectorValue.y); |
|||
|
|||
if (EndProperty()) |
|||
{ |
|||
property.vectorValue = new Vector2(x, y); |
|||
} |
|||
} |
|||
|
|||
protected void DoOffset(string name, string label) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
s_TempLabel.text = label; |
|||
Vector2 value = EditorGUI.Vector2Field(EditorGUILayout.GetControlRect(), s_TempLabel, property.vectorValue); |
|||
if (EndProperty()) |
|||
{ |
|||
property.vectorValue = value; |
|||
} |
|||
} |
|||
|
|||
protected void DoSlider(string name, string label) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
Vector2 range = property.rangeLimits; |
|||
s_TempLabel.text = label; |
|||
float value = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, property.floatValue, range.x, range.y); |
|||
if (EndProperty()) |
|||
{ |
|||
property.floatValue = value; |
|||
} |
|||
} |
|||
|
|||
protected void DoSlider(string name, Vector2 range, string label) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
s_TempLabel.text = label; |
|||
float value = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, property.floatValue, range.x, range.y); |
|||
if (EndProperty()) |
|||
{ |
|||
property.floatValue = value; |
|||
} |
|||
} |
|||
|
|||
protected void DoSlider(string propertyName, string propertyField, string label) |
|||
{ |
|||
MaterialProperty property = BeginProperty(propertyName); |
|||
Vector2 range = property.rangeLimits; |
|||
s_TempLabel.text = label; |
|||
|
|||
Vector4 value = property.vectorValue; |
|||
|
|||
switch (propertyField) |
|||
{ |
|||
case "X": |
|||
value.x = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.x, range.x, range.y); |
|||
break; |
|||
case "Y": |
|||
value.y = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.y, range.x, range.y); |
|||
break; |
|||
case "Z": |
|||
value.z = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.z, range.x, range.y); |
|||
break; |
|||
case "W": |
|||
value.w = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.w, range.x, range.y); |
|||
break; |
|||
} |
|||
|
|||
if (EndProperty()) |
|||
{ |
|||
property.vectorValue = value; |
|||
} |
|||
} |
|||
|
|||
protected void DoSlider(string propertyName, string propertyField, Vector2 range, string label) |
|||
{ |
|||
MaterialProperty property = BeginProperty(propertyName); |
|||
s_TempLabel.text = label; |
|||
|
|||
Vector4 value = property.vectorValue; |
|||
|
|||
switch (propertyField) |
|||
{ |
|||
case "X": |
|||
value.x = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.x, range.x, range.y); |
|||
break; |
|||
case "Y": |
|||
value.y = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.y, range.x, range.y); |
|||
break; |
|||
case "Z": |
|||
value.z = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.z, range.x, range.y); |
|||
break; |
|||
case "W": |
|||
value.w = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.w, range.x, range.y); |
|||
break; |
|||
} |
|||
|
|||
if (EndProperty()) |
|||
{ |
|||
property.vectorValue = value; |
|||
} |
|||
} |
|||
|
|||
protected void DoVector2(string name, string label) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
s_TempLabel.text = label; |
|||
Vector4 value = EditorGUILayout.Vector3Field(s_TempLabel, property.vectorValue); |
|||
if (EndProperty()) |
|||
{ |
|||
property.vectorValue = value; |
|||
} |
|||
} |
|||
|
|||
protected void DoVector3(string name, string label) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
s_TempLabel.text = label; |
|||
Vector4 value = EditorGUILayout.Vector3Field(s_TempLabel, property.vectorValue); |
|||
if (EndProperty()) |
|||
{ |
|||
property.vectorValue = value; |
|||
} |
|||
} |
|||
|
|||
protected void DoVector(string name, string label, GUIContent[] subLabels) |
|||
{ |
|||
MaterialProperty property = BeginProperty(name); |
|||
Rect rect = EditorGUILayout.GetControlRect(); |
|||
s_TempLabel.text = label; |
|||
rect = EditorGUI.PrefixLabel(rect, s_TempLabel); |
|||
Vector4 vector = property.vectorValue; |
|||
|
|||
float[] values = s_TempFloats[subLabels.Length]; |
|||
for (int i = 0; i < subLabels.Length; i++) |
|||
{ |
|||
values[i] = vector[i]; |
|||
} |
|||
|
|||
EditorGUI.MultiFloatField(rect, subLabels, values); |
|||
if (EndProperty()) |
|||
{ |
|||
for (int i = 0; i < subLabels.Length; i++) |
|||
{ |
|||
vector[i] = values[i]; |
|||
} |
|||
|
|||
property.vectorValue = vector; |
|||
} |
|||
} |
|||
|
|||
void DoDragAndDropBegin() |
|||
{ |
|||
m_DragAndDropMinY = GUILayoutUtility.GetRect(0f, 0f, GUILayout.ExpandWidth(true)).y; |
|||
} |
|||
|
|||
void DoDragAndDropEnd() |
|||
{ |
|||
Rect rect = GUILayoutUtility.GetRect(0f, 0f, GUILayout.ExpandWidth(true)); |
|||
Event evt = Event.current; |
|||
if (evt.type == EventType.DragUpdated) |
|||
{ |
|||
DragAndDrop.visualMode = DragAndDropVisualMode.Generic; |
|||
evt.Use(); |
|||
} |
|||
else if ( |
|||
evt.type == EventType.DragPerform && |
|||
Rect.MinMaxRect(rect.xMin, m_DragAndDropMinY, rect.xMax, rect.yMax).Contains(evt.mousePosition) |
|||
) |
|||
{ |
|||
DragAndDrop.AcceptDrag(); |
|||
evt.Use(); |
|||
Material droppedMaterial = DragAndDrop.objectReferences[0] as Material; |
|||
if (droppedMaterial && droppedMaterial != m_Material) |
|||
{ |
|||
PerformDrop(droppedMaterial); |
|||
} |
|||
} |
|||
} |
|||
|
|||
void PerformDrop(Material droppedMaterial) |
|||
{ |
|||
Texture droppedTex = droppedMaterial.GetTexture(ShaderUtilities.ID_MainTex); |
|||
if (!droppedTex) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
Texture currentTex = m_Material.GetTexture(ShaderUtilities.ID_MainTex); |
|||
TMP_FontAsset requiredFontAsset = null; |
|||
if (droppedTex != currentTex) |
|||
{ |
|||
requiredFontAsset = TMP_EditorUtility.FindMatchingFontAsset(droppedMaterial); |
|||
if (!requiredFontAsset) |
|||
{ |
|||
return; |
|||
} |
|||
} |
|||
|
|||
foreach (GameObject o in Selection.gameObjects) |
|||
{ |
|||
if (requiredFontAsset) |
|||
{ |
|||
TMP_Text textComponent = o.GetComponent<TMP_Text>(); |
|||
if (textComponent) |
|||
{ |
|||
Undo.RecordObject(textComponent, "Font Asset Change"); |
|||
textComponent.font = requiredFontAsset; |
|||
} |
|||
} |
|||
|
|||
TMPro_EventManager.ON_DRAG_AND_DROP_MATERIAL_CHANGED(o, m_Material, droppedMaterial); |
|||
EditorUtility.SetDirty(o); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
#endif
|
|||
@ -0,0 +1,12 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 645409e9544820042937871953f20509 |
|||
timeCreated: 1469844810 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,631 @@ |
|||
#if HDRP_10_7_OR_NEWER
|
|||
using UnityEngine; |
|||
using UnityEditor; |
|||
|
|||
using UnityEditor.Rendering.HighDefinition; |
|||
|
|||
namespace TMPro.EditorUtilities |
|||
{ |
|||
internal class TMP_SDF_HDRPLitShaderGUI : TMP_BaseHDRPLitShaderGUI |
|||
{ |
|||
static ShaderFeature s_OutlineFeature, s_UnderlayFeature, s_BevelFeature, s_GlowFeature, s_MaskFeature; |
|||
|
|||
static bool s_Face = true, s_Outline = true, s_Outline2 = true, s_Outline3 = true, s_Underlay = true, s_Lighting = true, s_Glow, s_Bevel, s_Light, s_Bump, s_Env; |
|||
|
|||
static string[] |
|||
s_FaceUVSpeedName = { "_FaceUVSpeed" }, |
|||
s_FaceUvSpeedNames = { "_FaceUVSpeedX", "_FaceUVSpeedY" }, |
|||
s_OutlineUvSpeedNames = { "_OutlineUVSpeedX", "_OutlineUVSpeedY" }, |
|||
s_OutlineUvSpeedName = { "_OutlineUVSpeed" }; |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
static TMP_SDF_HDRPLitShaderGUI() |
|||
{ |
|||
s_OutlineFeature = new ShaderFeature() |
|||
{ |
|||
undoLabel = "Outline", |
|||
keywords = new[] { "OUTLINE_ON" } |
|||
}; |
|||
|
|||
s_UnderlayFeature = new ShaderFeature() |
|||
{ |
|||
undoLabel = "Underlay", |
|||
keywords = new[] { "UNDERLAY_ON", "UNDERLAY_INNER" }, |
|||
label = new GUIContent("Underlay Type"), |
|||
keywordLabels = new[] |
|||
{ |
|||
new GUIContent("None"), new GUIContent("Normal"), new GUIContent("Inner") |
|||
} |
|||
}; |
|||
|
|||
s_BevelFeature = new ShaderFeature() |
|||
{ |
|||
undoLabel = "Bevel", |
|||
keywords = new[] { "BEVEL_ON" } |
|||
}; |
|||
|
|||
s_GlowFeature = new ShaderFeature() |
|||
{ |
|||
undoLabel = "Glow", |
|||
keywords = new[] { "GLOW_ON" } |
|||
}; |
|||
|
|||
s_MaskFeature = new ShaderFeature() |
|||
{ |
|||
undoLabel = "Mask", |
|||
keywords = new[] { "MASK_HARD", "MASK_SOFT" }, |
|||
label = new GUIContent("Mask"), |
|||
keywordLabels = new[] |
|||
{ |
|||
new GUIContent("Mask Off"), new GUIContent("Mask Hard"), new GUIContent("Mask Soft") |
|||
} |
|||
}; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
public TMP_SDF_HDRPLitShaderGUI() |
|||
{ |
|||
// Remove the ShaderGraphUIBlock to avoid having duplicated properties in the UI.
|
|||
uiBlocks.RemoveAll(b => b is ShaderGraphUIBlock); |
|||
} |
|||
|
|||
protected override void DoGUI() |
|||
{ |
|||
s_Face = BeginPanel("Face", s_Face); |
|||
if (s_Face) |
|||
{ |
|||
DoFacePanel(); |
|||
} |
|||
|
|||
EndPanel(); |
|||
|
|||
// Outline panels
|
|||
DoOutlinePanels(); |
|||
|
|||
// Underlay panel
|
|||
s_Underlay = BeginPanel("Underlay", s_Underlay); |
|||
if (s_Underlay) |
|||
{ |
|||
DoUnderlayPanel(); |
|||
} |
|||
|
|||
EndPanel(); |
|||
|
|||
// Lighting panel
|
|||
DrawLightingPanel(); |
|||
|
|||
/* |
|||
if (m_Material.HasProperty(ShaderUtilities.ID_GlowColor)) |
|||
{ |
|||
s_Glow = BeginPanel("Glow", s_GlowFeature, s_Glow); |
|||
if (s_Glow) |
|||
{ |
|||
DoGlowPanel(); |
|||
} |
|||
|
|||
EndPanel(); |
|||
} |
|||
*/ |
|||
|
|||
s_DebugExtended = BeginPanel("Debug Settings", s_DebugExtended); |
|||
if (s_DebugExtended) |
|||
{ |
|||
DoDebugPanelSRP(); |
|||
} |
|||
EndPanel(); |
|||
|
|||
EditorGUILayout.Space(); |
|||
EditorGUILayout.Space(); |
|||
|
|||
// Draw HDRP panels
|
|||
uiBlocks.OnGUI(m_Editor, m_Properties); |
|||
#if HDRP_12_OR_NEWER
|
|||
ValidateMaterial(m_Material); |
|||
#else
|
|||
SetupMaterialKeywordsAndPass(m_Material); |
|||
#endif
|
|||
} |
|||
|
|||
void DoFacePanel() |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
|
|||
DoColor("_FaceColor", "Color"); |
|||
|
|||
if (m_Material.HasProperty(ShaderUtilities.ID_FaceTex)) |
|||
{ |
|||
if (m_Material.HasProperty("_FaceUVSpeedX")) |
|||
{ |
|||
DoTexture2D("_FaceTex", "Texture", true, s_FaceUvSpeedNames); |
|||
} |
|||
else if (m_Material.HasProperty("_FaceUVSpeed")) |
|||
{ |
|||
DoTexture2D("_FaceTex", "Texture", true, s_FaceUVSpeedName); |
|||
} |
|||
else |
|||
{ |
|||
DoTexture2D("_FaceTex", "Texture", true); |
|||
} |
|||
} |
|||
|
|||
if (m_Material.HasProperty("_Softness")) |
|||
{ |
|||
DoSlider("_Softness", "X", new Vector2(0, 1), "Softness"); |
|||
} |
|||
|
|||
if (m_Material.HasProperty("_OutlineSoftness")) |
|||
{ |
|||
DoSlider("_OutlineSoftness", "Softness"); |
|||
} |
|||
|
|||
if (m_Material.HasProperty(ShaderUtilities.ID_FaceDilate)) |
|||
{ |
|||
DoSlider("_FaceDilate", "Dilate"); |
|||
if (m_Material.HasProperty(ShaderUtilities.ID_Shininess)) |
|||
{ |
|||
DoSlider("_FaceShininess", "Gloss"); |
|||
} |
|||
} |
|||
|
|||
if (m_Material.HasProperty(ShaderUtilities.ID_IsoPerimeter)) |
|||
{ |
|||
DoSlider("_IsoPerimeter", "X", new Vector2(-1, 1), "Dilate"); |
|||
} |
|||
|
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
void DoOutlinePanels() |
|||
{ |
|||
s_Outline = BeginPanel("Outline 1", s_Outline); |
|||
if (s_Outline) |
|||
DoOutlinePanelWithTexture(1, "Y", "Color"); |
|||
|
|||
EndPanel(); |
|||
|
|||
s_Outline2 = BeginPanel("Outline 2", s_Outline2); |
|||
if (s_Outline2) |
|||
DoOutlinePanel(2, "Z", "Color"); |
|||
|
|||
EndPanel(); |
|||
|
|||
s_Outline3 = BeginPanel("Outline 3", s_Outline3); |
|||
if (s_Outline3) |
|||
DoOutlinePanel(3, "W", "Color"); |
|||
|
|||
EndPanel(); |
|||
} |
|||
|
|||
void DoOutlinePanel(int outlineID, string propertyField, string label) |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
DoColor("_OutlineColor" + outlineID, label); |
|||
|
|||
if (outlineID != 3) |
|||
DoOffset("_OutlineOffset" + outlineID, "Offset"); |
|||
else |
|||
{ |
|||
if (m_Material.GetFloat(ShaderUtilities.ID_OutlineMode) == 0) |
|||
DoOffset("_OutlineOffset" + outlineID, "Offset"); |
|||
} |
|||
|
|||
DoSlider("_Softness", propertyField, new Vector2(0, 1), "Softness"); |
|||
DoSlider("_IsoPerimeter", propertyField, new Vector2(-1, 1), "Dilate"); |
|||
|
|||
if (outlineID == 3) |
|||
{ |
|||
DoToggle("_OutlineMode", "Outline Mode"); |
|||
} |
|||
|
|||
if (m_Material.HasProperty("_OutlineShininess")) |
|||
{ |
|||
//DoSlider("_OutlineShininess", "Gloss");
|
|||
} |
|||
|
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
void DoOutlinePanelWithTexture(int outlineID, string propertyField, string label) |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
DoColor("_OutlineColor" + outlineID, label); |
|||
if (m_Material.HasProperty(ShaderUtilities.ID_OutlineTex)) |
|||
{ |
|||
if (m_Material.HasProperty("_OutlineUVSpeedX")) |
|||
{ |
|||
DoTexture2D("_OutlineTex", "Texture", true, s_OutlineUvSpeedNames); |
|||
} |
|||
else if (m_Material.HasProperty("_OutlineUVSpeed")) |
|||
{ |
|||
DoTexture2D("_OutlineTex", "Texture", true, s_OutlineUvSpeedName); |
|||
} |
|||
else |
|||
{ |
|||
DoTexture2D("_OutlineTex", "Texture", true); |
|||
} |
|||
} |
|||
|
|||
DoOffset("_OutlineOffset" + outlineID, "Offset"); |
|||
DoSlider("_Softness", propertyField, new Vector2(0, 1), "Softness"); |
|||
DoSlider("_IsoPerimeter", propertyField, new Vector2(-1, 1), "Dilate"); |
|||
|
|||
if (m_Material.HasProperty("_OutlineShininess")) |
|||
{ |
|||
//DoSlider("_OutlineShininess", "Gloss");
|
|||
} |
|||
|
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
void DoUnderlayPanel() |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
|
|||
if (m_Material.HasProperty(ShaderUtilities.ID_IsoPerimeter)) |
|||
{ |
|||
DoColor("_UnderlayColor", "Color"); |
|||
DoSlider("_UnderlayOffset", "X", new Vector2(-1, 1), "Offset X"); |
|||
DoSlider("_UnderlayOffset", "Y", new Vector2(-1, 1), "Offset Y"); |
|||
DoSlider("_UnderlayDilate", new Vector2(-1, 1), "Dilate"); |
|||
DoSlider("_UnderlaySoftness", new Vector2(0, 1), "Softness"); |
|||
} |
|||
else |
|||
{ |
|||
s_UnderlayFeature.DoPopup(m_Editor, m_Material); |
|||
DoColor("_UnderlayColor", "Color"); |
|||
DoSlider("_UnderlayOffsetX", "Offset X"); |
|||
DoSlider("_UnderlayOffsetY", "Offset Y"); |
|||
DoSlider("_UnderlayDilate", "Dilate"); |
|||
DoSlider("_UnderlaySoftness", "Softness"); |
|||
} |
|||
|
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
static GUIContent[] s_BevelTypeLabels = |
|||
{ |
|||
new GUIContent("Outer Bevel"), |
|||
new GUIContent("Inner Bevel") |
|||
}; |
|||
|
|||
void DrawLightingPanel() |
|||
{ |
|||
s_Lighting = BeginPanel("Lighting", s_Lighting); |
|||
if (s_Lighting) |
|||
{ |
|||
s_Bevel = BeginPanel("Bevel", s_Bevel); |
|||
if (s_Bevel) |
|||
{ |
|||
DoBevelPanel(); |
|||
} |
|||
EndPanel(); |
|||
|
|||
s_Light = BeginPanel("Local Lighting", s_Light); |
|||
if (s_Light) |
|||
{ |
|||
DoLocalLightingPanel(); |
|||
} |
|||
EndPanel(); |
|||
|
|||
/* |
|||
s_Bump = BeginPanel("Bump Map", s_Bump); |
|||
if (s_Bump) |
|||
{ |
|||
DoBumpMapPanel(); |
|||
} |
|||
|
|||
EndPanel(); |
|||
|
|||
s_Env = BeginPanel("Environment Map", s_Env); |
|||
if (s_Env) |
|||
{ |
|||
DoEnvMapPanel(); |
|||
} |
|||
|
|||
EndPanel(); |
|||
*/ |
|||
} |
|||
|
|||
EndPanel(); |
|||
} |
|||
|
|||
void DoBevelPanel() |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
DoPopup("_BevelType", "Type", s_BevelTypeLabels); |
|||
DoSlider("_BevelAmount", "Amount"); |
|||
DoSlider("_BevelOffset", "Offset"); |
|||
DoSlider("_BevelWidth", "Width"); |
|||
DoSlider("_BevelRoundness", "Roundness"); |
|||
DoSlider("_BevelClamp", "Clamp"); |
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
void DoLocalLightingPanel() |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
DoSlider("_LightAngle", "Light Angle"); |
|||
DoColor("_SpecularColor", "Specular Color"); |
|||
DoSlider("_SpecularPower", "Specular Power"); |
|||
DoSlider("_Reflectivity", "Reflectivity Power"); |
|||
DoSlider("_Diffuse", "Diffuse Shadow"); |
|||
DoSlider("_Ambient", "Ambient Shadow"); |
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
void DoSurfaceLightingPanel() |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
DoColor("_SpecColor", "Specular Color"); |
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
void DoBumpMapPanel() |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
DoTexture2D("_BumpMap", "Texture"); |
|||
DoSlider("_BumpFace", "Face"); |
|||
DoSlider("_BumpOutline", "Outline"); |
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
void DoEnvMapPanel() |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
DoColor("_ReflectFaceColor", "Face Color"); |
|||
DoColor("_ReflectOutlineColor", "Outline Color"); |
|||
DoCubeMap("_Cube", "Texture"); |
|||
DoVector3("_EnvMatrixRotation", "Rotation"); |
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
void DoGlowPanel() |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
DoColor("_GlowColor", "Color"); |
|||
DoSlider("_GlowOffset", "Offset"); |
|||
DoSlider("_GlowInner", "Inner"); |
|||
DoSlider("_GlowOuter", "Outer"); |
|||
DoSlider("_GlowPower", "Power"); |
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
void DoDebugPanel() |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
DoTexture2D("_MainTex", "Font Atlas"); |
|||
DoFloat("_GradientScale", "Gradient Scale"); |
|||
DoFloat("_TextureWidth", "Texture Width"); |
|||
DoFloat("_TextureHeight", "Texture Height"); |
|||
EditorGUILayout.Space(); |
|||
DoFloat("_ScaleX", "Scale X"); |
|||
DoFloat("_ScaleY", "Scale Y"); |
|||
|
|||
if (m_Material.HasProperty(ShaderUtilities.ID_Sharpness)) |
|||
DoSlider("_Sharpness", "Sharpness"); |
|||
|
|||
DoSlider("_PerspectiveFilter", "Perspective Filter"); |
|||
EditorGUILayout.Space(); |
|||
DoFloat("_VertexOffsetX", "Offset X"); |
|||
DoFloat("_VertexOffsetY", "Offset Y"); |
|||
|
|||
if (m_Material.HasProperty(ShaderUtilities.ID_MaskCoord)) |
|||
{ |
|||
EditorGUILayout.Space(); |
|||
s_MaskFeature.ReadState(m_Material); |
|||
s_MaskFeature.DoPopup(m_Editor, m_Material); |
|||
if (s_MaskFeature.Active) |
|||
{ |
|||
DoMaskSubgroup(); |
|||
} |
|||
|
|||
EditorGUILayout.Space(); |
|||
DoVector("_ClipRect", "Clip Rect", s_LbrtVectorLabels); |
|||
} |
|||
else if (m_Material.HasProperty("_MaskTex")) |
|||
{ |
|||
DoMaskTexSubgroup(); |
|||
} |
|||
else if (m_Material.HasProperty(ShaderUtilities.ID_MaskSoftnessX)) |
|||
{ |
|||
EditorGUILayout.Space(); |
|||
DoFloat("_MaskSoftnessX", "Softness X"); |
|||
DoFloat("_MaskSoftnessY", "Softness Y"); |
|||
DoVector("_ClipRect", "Clip Rect", s_LbrtVectorLabels); |
|||
} |
|||
|
|||
if (m_Material.HasProperty(ShaderUtilities.ID_StencilID)) |
|||
{ |
|||
EditorGUILayout.Space(); |
|||
DoFloat("_Stencil", "Stencil ID"); |
|||
DoFloat("_StencilComp", "Stencil Comp"); |
|||
} |
|||
|
|||
EditorGUILayout.Space(); |
|||
|
|||
EditorGUI.BeginChangeCheck(); |
|||
bool useRatios = EditorGUILayout.Toggle("Use Ratios", !m_Material.IsKeywordEnabled("RATIOS_OFF")); |
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
m_Editor.RegisterPropertyChangeUndo("Use Ratios"); |
|||
if (useRatios) |
|||
{ |
|||
m_Material.DisableKeyword("RATIOS_OFF"); |
|||
} |
|||
else |
|||
{ |
|||
m_Material.EnableKeyword("RATIOS_OFF"); |
|||
} |
|||
} |
|||
|
|||
if (m_Material.HasProperty(ShaderUtilities.ShaderTag_CullMode)) |
|||
{ |
|||
EditorGUILayout.Space(); |
|||
DoPopup("_CullMode", "Cull Mode", s_CullingTypeLabels); |
|||
} |
|||
|
|||
EditorGUILayout.Space(); |
|||
|
|||
EditorGUI.BeginDisabledGroup(true); |
|||
DoFloat("_ScaleRatioA", "Scale Ratio A"); |
|||
DoFloat("_ScaleRatioB", "Scale Ratio B"); |
|||
DoFloat("_ScaleRatioC", "Scale Ratio C"); |
|||
EditorGUI.EndDisabledGroup(); |
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
void DoDebugPanelSRP() |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
DoTexture2D("_MainTex", "Font Atlas"); |
|||
DoFloat("_GradientScale", "Gradient Scale"); |
|||
//DoFloat("_TextureWidth", "Texture Width");
|
|||
//DoFloat("_TextureHeight", "Texture Height");
|
|||
EditorGUILayout.Space(); |
|||
|
|||
/* |
|||
DoFloat("_ScaleX", "Scale X"); |
|||
DoFloat("_ScaleY", "Scale Y"); |
|||
|
|||
if (m_Material.HasProperty(ShaderUtilities.ID_Sharpness)) |
|||
DoSlider("_Sharpness", "Sharpness"); |
|||
|
|||
DoSlider("_PerspectiveFilter", "Perspective Filter"); |
|||
EditorGUILayout.Space(); |
|||
DoFloat("_VertexOffsetX", "Offset X"); |
|||
DoFloat("_VertexOffsetY", "Offset Y"); |
|||
|
|||
if (m_Material.HasProperty(ShaderUtilities.ID_MaskCoord)) |
|||
{ |
|||
EditorGUILayout.Space(); |
|||
s_MaskFeature.ReadState(m_Material); |
|||
s_MaskFeature.DoPopup(m_Editor, m_Material); |
|||
if (s_MaskFeature.Active) |
|||
{ |
|||
DoMaskSubgroup(); |
|||
} |
|||
|
|||
EditorGUILayout.Space(); |
|||
DoVector("_ClipRect", "Clip Rect", s_LbrtVectorLabels); |
|||
} |
|||
else if (m_Material.HasProperty("_MaskTex")) |
|||
{ |
|||
DoMaskTexSubgroup(); |
|||
} |
|||
else if (m_Material.HasProperty(ShaderUtilities.ID_MaskSoftnessX)) |
|||
{ |
|||
EditorGUILayout.Space(); |
|||
DoFloat("_MaskSoftnessX", "Softness X"); |
|||
DoFloat("_MaskSoftnessY", "Softness Y"); |
|||
DoVector("_ClipRect", "Clip Rect", s_LbrtVectorLabels); |
|||
} |
|||
|
|||
if (m_Material.HasProperty(ShaderUtilities.ID_StencilID)) |
|||
{ |
|||
EditorGUILayout.Space(); |
|||
DoFloat("_Stencil", "Stencil ID"); |
|||
DoFloat("_StencilComp", "Stencil Comp"); |
|||
} |
|||
|
|||
EditorGUILayout.Space(); |
|||
|
|||
EditorGUI.BeginChangeCheck(); |
|||
bool useRatios = EditorGUILayout.Toggle("Use Ratios", !m_Material.IsKeywordEnabled("RATIOS_OFF")); |
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
m_Editor.RegisterPropertyChangeUndo("Use Ratios"); |
|||
if (useRatios) |
|||
{ |
|||
m_Material.DisableKeyword("RATIOS_OFF"); |
|||
} |
|||
else |
|||
{ |
|||
m_Material.EnableKeyword("RATIOS_OFF"); |
|||
} |
|||
} |
|||
*/ |
|||
if (m_Material.HasProperty(ShaderUtilities.ShaderTag_CullMode)) |
|||
{ |
|||
EditorGUILayout.Space(); |
|||
DoPopup("_CullMode", "Cull Mode", s_CullingTypeLabels); |
|||
} |
|||
|
|||
EditorGUILayout.Space(); |
|||
/* |
|||
EditorGUI.BeginDisabledGroup(true); |
|||
DoFloat("_ScaleRatioA", "Scale Ratio A"); |
|||
DoFloat("_ScaleRatioB", "Scale Ratio B"); |
|||
DoFloat("_ScaleRatioC", "Scale Ratio C"); |
|||
EditorGUI.EndDisabledGroup(); |
|||
*/ |
|||
|
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
void DoMaskSubgroup() |
|||
{ |
|||
DoVector("_MaskCoord", "Mask Bounds", s_XywhVectorLabels); |
|||
if (Selection.activeGameObject != null) |
|||
{ |
|||
Renderer renderer = Selection.activeGameObject.GetComponent<Renderer>(); |
|||
if (renderer != null) |
|||
{ |
|||
Rect rect = EditorGUILayout.GetControlRect(); |
|||
rect.x += EditorGUIUtility.labelWidth; |
|||
rect.width -= EditorGUIUtility.labelWidth; |
|||
if (GUI.Button(rect, "Match Renderer Bounds")) |
|||
{ |
|||
FindProperty("_MaskCoord", m_Properties).vectorValue = new Vector4( |
|||
0, |
|||
0, |
|||
Mathf.Round(renderer.bounds.extents.x * 1000) / 1000, |
|||
Mathf.Round(renderer.bounds.extents.y * 1000) / 1000 |
|||
); |
|||
} |
|||
} |
|||
} |
|||
|
|||
if (s_MaskFeature.State == 1) |
|||
{ |
|||
DoFloat("_MaskSoftnessX", "Softness X"); |
|||
DoFloat("_MaskSoftnessY", "Softness Y"); |
|||
} |
|||
} |
|||
|
|||
void DoMaskTexSubgroup() |
|||
{ |
|||
EditorGUILayout.Space(); |
|||
DoTexture2D("_MaskTex", "Mask Texture"); |
|||
DoToggle("_MaskInverse", "Inverse Mask"); |
|||
DoColor("_MaskEdgeColor", "Edge Color"); |
|||
DoSlider("_MaskEdgeSoftness", "Edge Softness"); |
|||
DoSlider("_MaskWipeControl", "Wipe Position"); |
|||
DoFloat("_MaskSoftnessX", "Softness X"); |
|||
DoFloat("_MaskSoftnessY", "Softness Y"); |
|||
DoVector("_ClipRect", "Clip Rect", s_LbrtVectorLabels); |
|||
} |
|||
|
|||
// protected override void SetupMaterialKeywordsAndPassInternal(Material material)
|
|||
// {
|
|||
// BaseLitGUI.SetupBaseLitKeywords(material);
|
|||
// BaseLitGUI.SetupBaseLitMaterialPass(material);
|
|||
// }
|
|||
} |
|||
} |
|||
#endif
|
|||
@ -0,0 +1,12 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 85016528879d5d644981050d1d0a4368 |
|||
timeCreated: 1469844718 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,642 @@ |
|||
#if HDRP_10_7_OR_NEWER
|
|||
using UnityEngine; |
|||
using UnityEditor; |
|||
|
|||
using UnityEditor.Rendering.HighDefinition; |
|||
|
|||
namespace TMPro.EditorUtilities |
|||
{ |
|||
internal class TMP_SDF_HDRPUnlitShaderGUI : TMP_BaseHDRPUnlitShaderGUI |
|||
{ |
|||
#if !HDRP_11_OR_NEWER
|
|||
const SurfaceOptionUIBlock.Features surfaceOptionFeatures = SurfaceOptionUIBlock.Features.Unlit; |
|||
|
|||
private readonly MaterialUIBlockList uiBlocks = new MaterialUIBlockList |
|||
{ |
|||
new SurfaceOptionUIBlock(MaterialUIBlock.Expandable.Base, features: surfaceOptionFeatures), |
|||
new ShaderGraphUIBlock(MaterialUIBlock.Expandable.ShaderGraph, ShaderGraphUIBlock.Features.Unlit), |
|||
new AdvancedOptionsUIBlock(MaterialUIBlock.Expandable.Advance, ~AdvancedOptionsUIBlock.Features.SpecularOcclusion) |
|||
}; |
|||
#endif
|
|||
|
|||
static ShaderFeature s_OutlineFeature, s_UnderlayFeature, s_BevelFeature, s_GlowFeature, s_MaskFeature; |
|||
|
|||
static bool s_Face = true, s_Outline = true, s_Outline2 = true, s_Outline3 = true, s_Underlay = true, s_Lighting = true, s_Glow, s_Bevel, s_Light, s_Bump, s_Env; |
|||
|
|||
static string[] |
|||
s_FaceUVSpeedName = { "_FaceUVSpeed" }, |
|||
s_FaceUvSpeedNames = { "_FaceUVSpeedX", "_FaceUVSpeedY" }, |
|||
s_OutlineUvSpeedNames = { "_OutlineUVSpeedX", "_OutlineUVSpeedY" }, |
|||
s_OutlineUvSpeedName = { "_OutlineUVSpeed" }; |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
static TMP_SDF_HDRPUnlitShaderGUI() |
|||
{ |
|||
s_OutlineFeature = new ShaderFeature() |
|||
{ |
|||
undoLabel = "Outline", |
|||
keywords = new[] { "OUTLINE_ON" } |
|||
}; |
|||
|
|||
s_UnderlayFeature = new ShaderFeature() |
|||
{ |
|||
undoLabel = "Underlay", |
|||
keywords = new[] { "UNDERLAY_ON", "UNDERLAY_INNER" }, |
|||
label = new GUIContent("Underlay Type"), |
|||
keywordLabels = new[] |
|||
{ |
|||
new GUIContent("None"), new GUIContent("Normal"), new GUIContent("Inner") |
|||
} |
|||
}; |
|||
|
|||
s_BevelFeature = new ShaderFeature() |
|||
{ |
|||
undoLabel = "Bevel", |
|||
keywords = new[] { "BEVEL_ON" } |
|||
}; |
|||
|
|||
s_GlowFeature = new ShaderFeature() |
|||
{ |
|||
undoLabel = "Glow", |
|||
keywords = new[] { "GLOW_ON" } |
|||
}; |
|||
|
|||
s_MaskFeature = new ShaderFeature() |
|||
{ |
|||
undoLabel = "Mask", |
|||
keywords = new[] { "MASK_HARD", "MASK_SOFT" }, |
|||
label = new GUIContent("Mask"), |
|||
keywordLabels = new[] |
|||
{ |
|||
new GUIContent("Mask Off"), new GUIContent("Mask Hard"), new GUIContent("Mask Soft") |
|||
} |
|||
}; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
public TMP_SDF_HDRPUnlitShaderGUI() |
|||
{ |
|||
// Remove the ShaderGraphUIBlock to avoid having duplicated properties in the UI.
|
|||
uiBlocks.RemoveAll(b => b is ShaderGraphUIBlock); |
|||
} |
|||
|
|||
protected override void DoGUI() |
|||
{ |
|||
s_Face = BeginPanel("Face", s_Face); |
|||
if (s_Face) |
|||
{ |
|||
DoFacePanel(); |
|||
} |
|||
|
|||
EndPanel(); |
|||
|
|||
// Outline panels
|
|||
DoOutlinePanels(); |
|||
|
|||
// Underlay panel
|
|||
s_Underlay = BeginPanel("Underlay", s_Underlay); |
|||
if (s_Underlay) |
|||
{ |
|||
DoUnderlayPanel(); |
|||
} |
|||
|
|||
EndPanel(); |
|||
|
|||
// Lighting panel
|
|||
DrawLightingPanel(); |
|||
|
|||
/* |
|||
if (m_Material.HasProperty(ShaderUtilities.ID_GlowColor)) |
|||
{ |
|||
s_Glow = BeginPanel("Glow", s_GlowFeature, s_Glow); |
|||
if (s_Glow) |
|||
{ |
|||
DoGlowPanel(); |
|||
} |
|||
|
|||
EndPanel(); |
|||
} |
|||
*/ |
|||
|
|||
s_DebugExtended = BeginPanel("Debug Settings", s_DebugExtended); |
|||
if (s_DebugExtended) |
|||
{ |
|||
DoDebugPanelSRP(); |
|||
} |
|||
EndPanel(); |
|||
|
|||
EditorGUILayout.Space(); |
|||
EditorGUILayout.Space(); |
|||
|
|||
// Draw HDRP panels
|
|||
uiBlocks.OnGUI(m_Editor, m_Properties); |
|||
#if HDRP_12_OR_NEWER
|
|||
ValidateMaterial(m_Material); |
|||
#else
|
|||
SetupMaterialKeywordsAndPass(m_Material); |
|||
#endif
|
|||
} |
|||
|
|||
void DoFacePanel() |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
|
|||
DoColor("_FaceColor", "Color"); |
|||
|
|||
if (m_Material.HasProperty(ShaderUtilities.ID_FaceTex)) |
|||
{ |
|||
if (m_Material.HasProperty("_FaceUVSpeedX")) |
|||
{ |
|||
DoTexture2D("_FaceTex", "Texture", true, s_FaceUvSpeedNames); |
|||
} |
|||
else if (m_Material.HasProperty("_FaceUVSpeed")) |
|||
{ |
|||
DoTexture2D("_FaceTex", "Texture", true, s_FaceUVSpeedName); |
|||
} |
|||
else |
|||
{ |
|||
DoTexture2D("_FaceTex", "Texture", true); |
|||
} |
|||
} |
|||
|
|||
if (m_Material.HasProperty("_Softness")) |
|||
{ |
|||
DoSlider("_Softness", "X", new Vector2(0, 1), "Softness"); |
|||
} |
|||
|
|||
if (m_Material.HasProperty("_OutlineSoftness")) |
|||
{ |
|||
DoSlider("_OutlineSoftness", "Softness"); |
|||
} |
|||
|
|||
if (m_Material.HasProperty(ShaderUtilities.ID_FaceDilate)) |
|||
{ |
|||
DoSlider("_FaceDilate", "Dilate"); |
|||
if (m_Material.HasProperty(ShaderUtilities.ID_Shininess)) |
|||
{ |
|||
DoSlider("_FaceShininess", "Gloss"); |
|||
} |
|||
} |
|||
|
|||
if (m_Material.HasProperty(ShaderUtilities.ID_IsoPerimeter)) |
|||
{ |
|||
DoSlider("_IsoPerimeter", "X", new Vector2(-1, 1), "Dilate"); |
|||
} |
|||
|
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
void DoOutlinePanels() |
|||
{ |
|||
s_Outline = BeginPanel("Outline 1", s_Outline); |
|||
if (s_Outline) |
|||
DoOutlinePanelWithTexture(1, "Y", "Color"); |
|||
|
|||
EndPanel(); |
|||
|
|||
s_Outline2 = BeginPanel("Outline 2", s_Outline2); |
|||
if (s_Outline2) |
|||
DoOutlinePanel(2, "Z", "Color"); |
|||
|
|||
EndPanel(); |
|||
|
|||
s_Outline3 = BeginPanel("Outline 3", s_Outline3); |
|||
if (s_Outline3) |
|||
DoOutlinePanel(3, "W", "Color"); |
|||
|
|||
EndPanel(); |
|||
} |
|||
|
|||
void DoOutlinePanel(int outlineID, string propertyField, string label) |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
DoColor("_OutlineColor" + outlineID, label); |
|||
|
|||
if (outlineID != 3) |
|||
DoOffset("_OutlineOffset" + outlineID, "Offset"); |
|||
else |
|||
{ |
|||
if (m_Material.GetFloat(ShaderUtilities.ID_OutlineMode) == 0) |
|||
DoOffset("_OutlineOffset" + outlineID, "Offset"); |
|||
} |
|||
|
|||
DoSlider("_Softness", propertyField, new Vector2(0, 1), "Softness"); |
|||
DoSlider("_IsoPerimeter", propertyField, new Vector2(-1, 1), "Dilate"); |
|||
|
|||
if (outlineID == 3) |
|||
{ |
|||
DoToggle("_OutlineMode", "Outline Mode"); |
|||
} |
|||
|
|||
if (m_Material.HasProperty("_OutlineShininess")) |
|||
{ |
|||
//DoSlider("_OutlineShininess", "Gloss");
|
|||
} |
|||
|
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
void DoOutlinePanelWithTexture(int outlineID, string propertyField, string label) |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
DoColor("_OutlineColor" + outlineID, label); |
|||
if (m_Material.HasProperty(ShaderUtilities.ID_OutlineTex)) |
|||
{ |
|||
if (m_Material.HasProperty("_OutlineUVSpeedX")) |
|||
{ |
|||
DoTexture2D("_OutlineTex", "Texture", true, s_OutlineUvSpeedNames); |
|||
} |
|||
else if (m_Material.HasProperty("_OutlineUVSpeed")) |
|||
{ |
|||
DoTexture2D("_OutlineTex", "Texture", true, s_OutlineUvSpeedName); |
|||
} |
|||
else |
|||
{ |
|||
DoTexture2D("_OutlineTex", "Texture", true); |
|||
} |
|||
} |
|||
|
|||
DoOffset("_OutlineOffset" + outlineID, "Offset"); |
|||
DoSlider("_Softness", propertyField, new Vector2(0, 1), "Softness"); |
|||
DoSlider("_IsoPerimeter", propertyField, new Vector2(-1, 1), "Dilate"); |
|||
|
|||
if (m_Material.HasProperty("_OutlineShininess")) |
|||
{ |
|||
//DoSlider("_OutlineShininess", "Gloss");
|
|||
} |
|||
|
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
void DoUnderlayPanel() |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
|
|||
if (m_Material.HasProperty(ShaderUtilities.ID_IsoPerimeter)) |
|||
{ |
|||
DoColor("_UnderlayColor", "Color"); |
|||
DoSlider("_UnderlayOffset", "X", new Vector2(-1, 1), "Offset X"); |
|||
DoSlider("_UnderlayOffset", "Y", new Vector2(-1, 1), "Offset Y"); |
|||
DoSlider("_UnderlayDilate", new Vector2(-1, 1), "Dilate"); |
|||
DoSlider("_UnderlaySoftness", new Vector2(0, 1), "Softness"); |
|||
} |
|||
else |
|||
{ |
|||
s_UnderlayFeature.DoPopup(m_Editor, m_Material); |
|||
DoColor("_UnderlayColor", "Color"); |
|||
DoSlider("_UnderlayOffsetX", "Offset X"); |
|||
DoSlider("_UnderlayOffsetY", "Offset Y"); |
|||
DoSlider("_UnderlayDilate", "Dilate"); |
|||
DoSlider("_UnderlaySoftness", "Softness"); |
|||
} |
|||
|
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
static GUIContent[] s_BevelTypeLabels = |
|||
{ |
|||
new GUIContent("Outer Bevel"), |
|||
new GUIContent("Inner Bevel") |
|||
}; |
|||
|
|||
void DrawLightingPanel() |
|||
{ |
|||
s_Lighting = BeginPanel("Lighting", s_Lighting); |
|||
if (s_Lighting) |
|||
{ |
|||
s_Bevel = BeginPanel("Bevel", s_Bevel); |
|||
if (s_Bevel) |
|||
{ |
|||
DoBevelPanel(); |
|||
} |
|||
EndPanel(); |
|||
|
|||
s_Light = BeginPanel("Local Lighting", s_Light); |
|||
if (s_Light) |
|||
{ |
|||
DoLocalLightingPanel(); |
|||
} |
|||
EndPanel(); |
|||
|
|||
/* |
|||
s_Bump = BeginPanel("Bump Map", s_Bump); |
|||
if (s_Bump) |
|||
{ |
|||
DoBumpMapPanel(); |
|||
} |
|||
|
|||
EndPanel(); |
|||
|
|||
s_Env = BeginPanel("Environment Map", s_Env); |
|||
if (s_Env) |
|||
{ |
|||
DoEnvMapPanel(); |
|||
} |
|||
|
|||
EndPanel(); |
|||
*/ |
|||
} |
|||
|
|||
EndPanel(); |
|||
} |
|||
|
|||
void DoBevelPanel() |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
DoPopup("_BevelType", "Type", s_BevelTypeLabels); |
|||
DoSlider("_BevelAmount", "Amount"); |
|||
DoSlider("_BevelOffset", "Offset"); |
|||
DoSlider("_BevelWidth", "Width"); |
|||
DoSlider("_BevelRoundness", "Roundness"); |
|||
DoSlider("_BevelClamp", "Clamp"); |
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
void DoLocalLightingPanel() |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
DoSlider("_LightAngle", "Light Angle"); |
|||
DoColor("_SpecularColor", "Specular Color"); |
|||
DoSlider("_SpecularPower", "Specular Power"); |
|||
DoSlider("_Reflectivity", "Reflectivity Power"); |
|||
DoSlider("_Diffuse", "Diffuse Shadow"); |
|||
DoSlider("_Ambient", "Ambient Shadow"); |
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
void DoSurfaceLightingPanel() |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
DoColor("_SpecColor", "Specular Color"); |
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
void DoBumpMapPanel() |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
DoTexture2D("_BumpMap", "Texture"); |
|||
DoSlider("_BumpFace", "Face"); |
|||
DoSlider("_BumpOutline", "Outline"); |
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
void DoEnvMapPanel() |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
DoColor("_ReflectFaceColor", "Face Color"); |
|||
DoColor("_ReflectOutlineColor", "Outline Color"); |
|||
DoCubeMap("_Cube", "Texture"); |
|||
DoVector3("_EnvMatrixRotation", "Rotation"); |
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
void DoGlowPanel() |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
DoColor("_GlowColor", "Color"); |
|||
DoSlider("_GlowOffset", "Offset"); |
|||
DoSlider("_GlowInner", "Inner"); |
|||
DoSlider("_GlowOuter", "Outer"); |
|||
DoSlider("_GlowPower", "Power"); |
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
void DoDebugPanel() |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
DoTexture2D("_MainTex", "Font Atlas"); |
|||
DoFloat("_GradientScale", "Gradient Scale"); |
|||
DoFloat("_TextureWidth", "Texture Width"); |
|||
DoFloat("_TextureHeight", "Texture Height"); |
|||
EditorGUILayout.Space(); |
|||
DoFloat("_ScaleX", "Scale X"); |
|||
DoFloat("_ScaleY", "Scale Y"); |
|||
|
|||
if (m_Material.HasProperty(ShaderUtilities.ID_Sharpness)) |
|||
DoSlider("_Sharpness", "Sharpness"); |
|||
|
|||
DoSlider("_PerspectiveFilter", "Perspective Filter"); |
|||
EditorGUILayout.Space(); |
|||
DoFloat("_VertexOffsetX", "Offset X"); |
|||
DoFloat("_VertexOffsetY", "Offset Y"); |
|||
|
|||
if (m_Material.HasProperty(ShaderUtilities.ID_MaskCoord)) |
|||
{ |
|||
EditorGUILayout.Space(); |
|||
s_MaskFeature.ReadState(m_Material); |
|||
s_MaskFeature.DoPopup(m_Editor, m_Material); |
|||
if (s_MaskFeature.Active) |
|||
{ |
|||
DoMaskSubgroup(); |
|||
} |
|||
|
|||
EditorGUILayout.Space(); |
|||
DoVector("_ClipRect", "Clip Rect", s_LbrtVectorLabels); |
|||
} |
|||
else if (m_Material.HasProperty("_MaskTex")) |
|||
{ |
|||
DoMaskTexSubgroup(); |
|||
} |
|||
else if (m_Material.HasProperty(ShaderUtilities.ID_MaskSoftnessX)) |
|||
{ |
|||
EditorGUILayout.Space(); |
|||
DoFloat("_MaskSoftnessX", "Softness X"); |
|||
DoFloat("_MaskSoftnessY", "Softness Y"); |
|||
DoVector("_ClipRect", "Clip Rect", s_LbrtVectorLabels); |
|||
} |
|||
|
|||
if (m_Material.HasProperty(ShaderUtilities.ID_StencilID)) |
|||
{ |
|||
EditorGUILayout.Space(); |
|||
DoFloat("_Stencil", "Stencil ID"); |
|||
DoFloat("_StencilComp", "Stencil Comp"); |
|||
} |
|||
|
|||
EditorGUILayout.Space(); |
|||
|
|||
EditorGUI.BeginChangeCheck(); |
|||
bool useRatios = EditorGUILayout.Toggle("Use Ratios", !m_Material.IsKeywordEnabled("RATIOS_OFF")); |
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
m_Editor.RegisterPropertyChangeUndo("Use Ratios"); |
|||
if (useRatios) |
|||
{ |
|||
m_Material.DisableKeyword("RATIOS_OFF"); |
|||
} |
|||
else |
|||
{ |
|||
m_Material.EnableKeyword("RATIOS_OFF"); |
|||
} |
|||
} |
|||
|
|||
if (m_Material.HasProperty(ShaderUtilities.ShaderTag_CullMode)) |
|||
{ |
|||
EditorGUILayout.Space(); |
|||
DoPopup("_CullMode", "Cull Mode", s_CullingTypeLabels); |
|||
} |
|||
|
|||
EditorGUILayout.Space(); |
|||
|
|||
EditorGUI.BeginDisabledGroup(true); |
|||
DoFloat("_ScaleRatioA", "Scale Ratio A"); |
|||
DoFloat("_ScaleRatioB", "Scale Ratio B"); |
|||
DoFloat("_ScaleRatioC", "Scale Ratio C"); |
|||
EditorGUI.EndDisabledGroup(); |
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
void DoDebugPanelSRP() |
|||
{ |
|||
EditorGUI.indentLevel += 1; |
|||
DoTexture2D("_MainTex", "Font Atlas"); |
|||
DoFloat("_GradientScale", "Gradient Scale"); |
|||
//DoFloat("_TextureWidth", "Texture Width");
|
|||
//DoFloat("_TextureHeight", "Texture Height");
|
|||
EditorGUILayout.Space(); |
|||
|
|||
/* |
|||
DoFloat("_ScaleX", "Scale X"); |
|||
DoFloat("_ScaleY", "Scale Y"); |
|||
|
|||
if (m_Material.HasProperty(ShaderUtilities.ID_Sharpness)) |
|||
DoSlider("_Sharpness", "Sharpness"); |
|||
|
|||
DoSlider("_PerspectiveFilter", "Perspective Filter"); |
|||
EditorGUILayout.Space(); |
|||
DoFloat("_VertexOffsetX", "Offset X"); |
|||
DoFloat("_VertexOffsetY", "Offset Y"); |
|||
|
|||
if (m_Material.HasProperty(ShaderUtilities.ID_MaskCoord)) |
|||
{ |
|||
EditorGUILayout.Space(); |
|||
s_MaskFeature.ReadState(m_Material); |
|||
s_MaskFeature.DoPopup(m_Editor, m_Material); |
|||
if (s_MaskFeature.Active) |
|||
{ |
|||
DoMaskSubgroup(); |
|||
} |
|||
|
|||
EditorGUILayout.Space(); |
|||
DoVector("_ClipRect", "Clip Rect", s_LbrtVectorLabels); |
|||
} |
|||
else if (m_Material.HasProperty("_MaskTex")) |
|||
{ |
|||
DoMaskTexSubgroup(); |
|||
} |
|||
else if (m_Material.HasProperty(ShaderUtilities.ID_MaskSoftnessX)) |
|||
{ |
|||
EditorGUILayout.Space(); |
|||
DoFloat("_MaskSoftnessX", "Softness X"); |
|||
DoFloat("_MaskSoftnessY", "Softness Y"); |
|||
DoVector("_ClipRect", "Clip Rect", s_LbrtVectorLabels); |
|||
} |
|||
|
|||
if (m_Material.HasProperty(ShaderUtilities.ID_StencilID)) |
|||
{ |
|||
EditorGUILayout.Space(); |
|||
DoFloat("_Stencil", "Stencil ID"); |
|||
DoFloat("_StencilComp", "Stencil Comp"); |
|||
} |
|||
|
|||
EditorGUILayout.Space(); |
|||
|
|||
EditorGUI.BeginChangeCheck(); |
|||
bool useRatios = EditorGUILayout.Toggle("Use Ratios", !m_Material.IsKeywordEnabled("RATIOS_OFF")); |
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
m_Editor.RegisterPropertyChangeUndo("Use Ratios"); |
|||
if (useRatios) |
|||
{ |
|||
m_Material.DisableKeyword("RATIOS_OFF"); |
|||
} |
|||
else |
|||
{ |
|||
m_Material.EnableKeyword("RATIOS_OFF"); |
|||
} |
|||
} |
|||
*/ |
|||
if (m_Material.HasProperty(ShaderUtilities.ShaderTag_CullMode)) |
|||
{ |
|||
EditorGUILayout.Space(); |
|||
DoPopup("_CullMode", "Cull Mode", s_CullingTypeLabels); |
|||
} |
|||
|
|||
EditorGUILayout.Space(); |
|||
/* |
|||
EditorGUI.BeginDisabledGroup(true); |
|||
DoFloat("_ScaleRatioA", "Scale Ratio A"); |
|||
DoFloat("_ScaleRatioB", "Scale Ratio B"); |
|||
DoFloat("_ScaleRatioC", "Scale Ratio C"); |
|||
EditorGUI.EndDisabledGroup(); |
|||
*/ |
|||
|
|||
EditorGUI.indentLevel -= 1; |
|||
EditorGUILayout.Space(); |
|||
} |
|||
|
|||
void DoMaskSubgroup() |
|||
{ |
|||
DoVector("_MaskCoord", "Mask Bounds", s_XywhVectorLabels); |
|||
if (Selection.activeGameObject != null) |
|||
{ |
|||
Renderer renderer = Selection.activeGameObject.GetComponent<Renderer>(); |
|||
if (renderer != null) |
|||
{ |
|||
Rect rect = EditorGUILayout.GetControlRect(); |
|||
rect.x += EditorGUIUtility.labelWidth; |
|||
rect.width -= EditorGUIUtility.labelWidth; |
|||
if (GUI.Button(rect, "Match Renderer Bounds")) |
|||
{ |
|||
FindProperty("_MaskCoord", m_Properties).vectorValue = new Vector4( |
|||
0, |
|||
0, |
|||
Mathf.Round(renderer.bounds.extents.x * 1000) / 1000, |
|||
Mathf.Round(renderer.bounds.extents.y * 1000) / 1000 |
|||
); |
|||
} |
|||
} |
|||
} |
|||
|
|||
if (s_MaskFeature.State == 1) |
|||
{ |
|||
DoFloat("_MaskSoftnessX", "Softness X"); |
|||
DoFloat("_MaskSoftnessY", "Softness Y"); |
|||
} |
|||
} |
|||
|
|||
void DoMaskTexSubgroup() |
|||
{ |
|||
EditorGUILayout.Space(); |
|||
DoTexture2D("_MaskTex", "Mask Texture"); |
|||
DoToggle("_MaskInverse", "Inverse Mask"); |
|||
DoColor("_MaskEdgeColor", "Edge Color"); |
|||
DoSlider("_MaskEdgeSoftness", "Edge Softness"); |
|||
DoSlider("_MaskWipeControl", "Wipe Position"); |
|||
DoFloat("_MaskSoftnessX", "Softness X"); |
|||
DoFloat("_MaskSoftnessY", "Softness Y"); |
|||
DoVector("_ClipRect", "Clip Rect", s_LbrtVectorLabels); |
|||
} |
|||
|
|||
// protected override void SetupMaterialKeywordsAndPassInternal(Material material)
|
|||
// {
|
|||
// BaseLitGUI.SetupBaseLitKeywords(material);
|
|||
// BaseLitGUI.SetupBaseLitMaterialPass(material);
|
|||
// }
|
|||
} |
|||
} |
|||
#endif
|
|||
@ -0,0 +1,12 @@ |
|||
fileFormatVersion: 2 |
|||
guid: bad96c2cfa78a124cb8ec890d2386dfe |
|||
timeCreated: 1469844718 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,8 @@ |
|||
fileFormatVersion: 2 |
|||
guid: ea7c31b5b377c314db28ad3fabbbd38d |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,63 @@ |
|||
using UnityEditorInternal; |
|||
using UnityEngine; |
|||
using UnityEngine.UI; |
|||
using UnityEditor; |
|||
|
|||
namespace TMPro.EditorUtilities |
|||
{ |
|||
[CustomPropertyDrawer(typeof(TMP_Dropdown.OptionDataList), true)] |
|||
class DropdownOptionListDrawer : PropertyDrawer |
|||
{ |
|||
private ReorderableList m_ReorderableList; |
|||
|
|||
private void Init(SerializedProperty property) |
|||
{ |
|||
if (m_ReorderableList != null) |
|||
return; |
|||
|
|||
SerializedProperty array = property.FindPropertyRelative("m_Options"); |
|||
|
|||
m_ReorderableList = new ReorderableList(property.serializedObject, array); |
|||
m_ReorderableList.drawElementCallback = DrawOptionData; |
|||
m_ReorderableList.drawHeaderCallback = DrawHeader; |
|||
m_ReorderableList.elementHeight += 40; |
|||
} |
|||
|
|||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) |
|||
{ |
|||
Init(property); |
|||
|
|||
m_ReorderableList.DoList(position); |
|||
} |
|||
|
|||
private void DrawHeader(Rect rect) |
|||
{ |
|||
GUI.Label(rect, "Options"); |
|||
} |
|||
|
|||
private void DrawOptionData(Rect rect, int index, bool isActive, bool isFocused) |
|||
{ |
|||
SerializedProperty itemData = m_ReorderableList.serializedProperty.GetArrayElementAtIndex(index); |
|||
SerializedProperty itemText = itemData.FindPropertyRelative("m_Text"); |
|||
SerializedProperty itemImage = itemData.FindPropertyRelative("m_Image"); |
|||
SerializedProperty itemColor = itemData.FindPropertyRelative("m_Color"); |
|||
|
|||
RectOffset offset = new RectOffset(0, 0, -1, -3); |
|||
rect = offset.Add(rect); |
|||
rect.height = EditorGUIUtility.singleLineHeight; |
|||
|
|||
EditorGUI.PropertyField(rect, itemText, GUIContent.none); |
|||
rect.y += EditorGUIUtility.singleLineHeight + 2; |
|||
EditorGUI.PropertyField(rect, itemImage, GUIContent.none); |
|||
rect.y += EditorGUIUtility.singleLineHeight + 2; |
|||
EditorGUI.PropertyField(rect, itemColor, GUIContent.none); |
|||
} |
|||
|
|||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) |
|||
{ |
|||
Init(property); |
|||
|
|||
return m_ReorderableList.GetHeight(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 9545c9eb3bf94265810463794fec8334 |
|||
timeCreated: 1464818008 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,60 @@ |
|||
using UnityEngine; |
|||
using UnityEngine.TextCore; |
|||
using UnityEditor; |
|||
using System.Collections; |
|||
|
|||
|
|||
namespace TMPro.EditorUtilities |
|||
{ |
|||
|
|||
[CustomPropertyDrawer(typeof(GlyphMetrics))] |
|||
internal class GlyphMetricsPropertyDrawer : PropertyDrawer |
|||
{ |
|||
private static readonly GUIContent k_GlyphMetricLabel = new GUIContent("Glyph Metrics", "The layout metrics of the glyph."); |
|||
private static readonly GUIContent k_WidthPropertyLabel = new GUIContent("W:", "The width of the glyph."); |
|||
private static readonly GUIContent k_HeightPropertyLabel = new GUIContent("H:", "The height of the glyph."); |
|||
private static readonly GUIContent k_BearingXPropertyLabel = new GUIContent("BX:", "The horizontal bearing X of the glyph."); |
|||
private static readonly GUIContent k_BearingYPropertyLabel = new GUIContent("BY:", "The horizontal bearing Y of the glyph."); |
|||
private static readonly GUIContent k_HorizontalAdvancePropertyLabel = new GUIContent("AD:", "The horizontal advance of the glyph."); |
|||
|
|||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) |
|||
{ |
|||
SerializedProperty prop_Width = property.FindPropertyRelative("m_Width"); |
|||
SerializedProperty prop_Height = property.FindPropertyRelative("m_Height"); |
|||
SerializedProperty prop_HoriBearingX = property.FindPropertyRelative("m_HorizontalBearingX"); |
|||
SerializedProperty prop_HoriBearingY = property.FindPropertyRelative("m_HorizontalBearingY"); |
|||
SerializedProperty prop_HoriAdvance = property.FindPropertyRelative("m_HorizontalAdvance"); |
|||
|
|||
// We get Rect since a valid position may not be provided by the caller.
|
|||
Rect rect = new Rect(position.x, position.y, position.width, 49); |
|||
|
|||
EditorGUI.LabelField(new Rect(rect.x, rect.y - 2.5f, rect.width, 18), k_GlyphMetricLabel); |
|||
|
|||
EditorGUIUtility.labelWidth = 20f; |
|||
EditorGUIUtility.fieldWidth = 15f; |
|||
|
|||
//GUI.enabled = false;
|
|||
float width = (rect.width - 75f) / 2; |
|||
EditorGUI.PropertyField(new Rect(rect.x + width * 0, rect.y + 20, width - 5f, 18), prop_Width, k_WidthPropertyLabel); |
|||
EditorGUI.PropertyField(new Rect(rect.x + width * 1, rect.y + 20, width - 5f, 18), prop_Height, k_HeightPropertyLabel); |
|||
|
|||
//GUI.enabled = true;
|
|||
|
|||
width = (rect.width - 75f) / 3; |
|||
EditorGUI.BeginChangeCheck(); |
|||
EditorGUI.PropertyField(new Rect(rect.x + width * 0, rect.y + 40, width - 5f, 18), prop_HoriBearingX, k_BearingXPropertyLabel); |
|||
EditorGUI.PropertyField(new Rect(rect.x + width * 1, rect.y + 40, width - 5f, 18), prop_HoriBearingY, k_BearingYPropertyLabel); |
|||
EditorGUI.PropertyField(new Rect(rect.x + width * 2, rect.y + 40, width - 5f, 18), prop_HoriAdvance, k_HorizontalAdvancePropertyLabel); |
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
|
|||
} |
|||
} |
|||
|
|||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) |
|||
{ |
|||
return 65f; |
|||
} |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: e3882522a08b6f5459b4dea6f8791278 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,372 @@ |
|||
using UnityEngine; |
|||
using UnityEngine.TextCore; |
|||
using UnityEngine.TextCore.LowLevel; |
|||
using UnityEditor; |
|||
using System.Collections.Generic; |
|||
|
|||
|
|||
namespace TMPro.EditorUtilities |
|||
{ |
|||
|
|||
[CustomPropertyDrawer(typeof(GlyphPairAdjustmentRecord))] |
|||
internal class GlyphPairAdjustmentRecordPropertyDrawer : PropertyDrawer |
|||
{ |
|||
private bool isEditingEnabled; |
|||
private bool isSelectable; |
|||
|
|||
private Dictionary<uint, GlyphProxy> m_GlyphLookupDictionary; |
|||
|
|||
private string m_FirstCharacter = string.Empty; |
|||
private string m_SecondCharacter = string.Empty; |
|||
private string m_PreviousInput; |
|||
|
|||
static GUIContent s_CharacterTextFieldLabel = new GUIContent("Char:", "Enter the character or its UTF16 or UTF32 Unicode character escape sequence. For UTF16 use \"\\uFF00\" and for UTF32 use \"\\UFF00FF00\" representation."); |
|||
|
|||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) |
|||
{ |
|||
SerializedProperty prop_FirstAdjustmentRecord = property.FindPropertyRelative("m_FirstAdjustmentRecord"); |
|||
SerializedProperty prop_SecondAdjustmentRecord = property.FindPropertyRelative("m_SecondAdjustmentRecord"); |
|||
|
|||
SerializedProperty prop_FirstGlyphIndex = prop_FirstAdjustmentRecord.FindPropertyRelative("m_GlyphIndex"); |
|||
SerializedProperty prop_FirstGlyphValueRecord = prop_FirstAdjustmentRecord.FindPropertyRelative("m_GlyphValueRecord"); |
|||
|
|||
SerializedProperty prop_SecondGlyphIndex = prop_SecondAdjustmentRecord.FindPropertyRelative("m_GlyphIndex"); |
|||
SerializedProperty prop_SecondGlyphValueRecord = prop_SecondAdjustmentRecord.FindPropertyRelative("m_GlyphValueRecord"); |
|||
|
|||
SerializedProperty prop_FontFeatureLookupFlags = property.FindPropertyRelative("m_FeatureLookupFlags"); |
|||
|
|||
// Refresh glyph proxy lookup dictionary if needed
|
|||
if (TMP_PropertyDrawerUtilities.s_RefreshGlyphProxyLookup) |
|||
TMP_PropertyDrawerUtilities.RefreshGlyphProxyLookup(property.serializedObject); |
|||
|
|||
position.yMin += 2; |
|||
|
|||
float width = position.width / 2; |
|||
float padding = 5.0f; |
|||
|
|||
Rect rect; |
|||
|
|||
isEditingEnabled = GUI.enabled; |
|||
isSelectable = label.text == "Selectable"; |
|||
|
|||
if (isSelectable) |
|||
GUILayoutUtility.GetRect(position.width, 80); |
|||
else |
|||
GUILayoutUtility.GetRect(position.width, 55); |
|||
|
|||
GUIStyle style = new GUIStyle(EditorStyles.label); |
|||
style.richText = true; |
|||
|
|||
// First Glyph
|
|||
GUI.enabled = isEditingEnabled; |
|||
if (isSelectable) |
|||
{ |
|||
rect = new Rect(position.x + 70, position.y, position.width, 49); |
|||
|
|||
float labelWidth = GUI.skin.label.CalcSize(new GUIContent("ID: " + prop_FirstGlyphIndex.intValue)).x; |
|||
EditorGUI.LabelField(new Rect(position.x + (64 - labelWidth) / 2, position.y + 60, 64f, 18f), new GUIContent("ID: <color=#FFFF80>" + prop_FirstGlyphIndex.intValue + "</color>"), style); |
|||
|
|||
GUI.enabled = isEditingEnabled; |
|||
EditorGUIUtility.labelWidth = 25f; |
|||
|
|||
rect = new Rect(position.x + 70, position.y + 10, (width - 70) - padding, 18); |
|||
EditorGUI.PropertyField(rect, prop_FirstGlyphValueRecord.FindPropertyRelative("m_XPlacement"), new GUIContent("OX:")); |
|||
|
|||
rect.y += 20; |
|||
EditorGUI.PropertyField(rect, prop_FirstGlyphValueRecord.FindPropertyRelative("m_YPlacement"), new GUIContent("OY:")); |
|||
|
|||
rect.y += 20; |
|||
EditorGUI.PropertyField(rect, prop_FirstGlyphValueRecord.FindPropertyRelative("m_XAdvance"), new GUIContent("AX:")); |
|||
|
|||
//rect.y += 20;
|
|||
//EditorGUI.PropertyField(rect, prop_FirstGlyphValueRecord.FindPropertyRelative("m_YAdvance"), new GUIContent("AY:"));
|
|||
|
|||
DrawGlyph((uint)prop_FirstGlyphIndex.intValue, new Rect(position.x, position.y + 2, 64, 60), property); |
|||
} |
|||
else |
|||
{ |
|||
rect = new Rect(position.x, position.y, width / 2 * 0.8f - padding, 18); |
|||
EditorGUIUtility.labelWidth = 40f; |
|||
|
|||
// First Character Lookup
|
|||
GUI.SetNextControlName("FirstCharacterField"); |
|||
EditorGUI.BeginChangeCheck(); |
|||
string firstCharacter = EditorGUI.TextField(rect, s_CharacterTextFieldLabel, m_FirstCharacter); |
|||
|
|||
if (GUI.GetNameOfFocusedControl() == "FirstCharacterField") |
|||
{ |
|||
if (ValidateInput(firstCharacter)) |
|||
{ |
|||
//Debug.Log("1st Unicode value: [" + firstCharacter + "]");
|
|||
|
|||
uint unicode = GetUnicodeCharacter(firstCharacter); |
|||
|
|||
// Lookup glyph index
|
|||
TMP_SerializedPropertyHolder propertyHolder = property.serializedObject.targetObject as TMP_SerializedPropertyHolder; |
|||
TMP_FontAsset fontAsset = propertyHolder.fontAsset; |
|||
if (fontAsset != null) |
|||
{ |
|||
prop_FirstGlyphIndex.intValue = (int)fontAsset.GetGlyphIndex(unicode); |
|||
propertyHolder.firstCharacter = unicode; |
|||
} |
|||
} |
|||
} |
|||
|
|||
if (EditorGUI.EndChangeCheck()) |
|||
m_FirstCharacter = firstCharacter; |
|||
|
|||
// First Glyph Index
|
|||
rect.x += width / 2 * 0.8f; |
|||
|
|||
EditorGUIUtility.labelWidth = 25f; |
|||
EditorGUI.BeginChangeCheck(); |
|||
EditorGUI.PropertyField(rect, prop_FirstGlyphIndex, new GUIContent("ID:")); |
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
|
|||
} |
|||
|
|||
GUI.enabled = isEditingEnabled; |
|||
EditorGUIUtility.labelWidth = 25f; |
|||
|
|||
rect = new Rect(position.x, position.y + 20, width * 0.5f - padding, 18); |
|||
EditorGUI.PropertyField(rect, prop_FirstGlyphValueRecord.FindPropertyRelative("m_XPlacement"), new GUIContent("OX")); |
|||
|
|||
rect.x += width * 0.5f; |
|||
EditorGUI.PropertyField(rect, prop_FirstGlyphValueRecord.FindPropertyRelative("m_YPlacement"), new GUIContent("OY")); |
|||
|
|||
rect.x = position.x; |
|||
rect.y += 20; |
|||
EditorGUI.PropertyField(rect, prop_FirstGlyphValueRecord.FindPropertyRelative("m_XAdvance"), new GUIContent("AX")); |
|||
|
|||
//rect.x += width * 0.5f;
|
|||
//EditorGUI.PropertyField(rect, prop_FirstGlyphAdjustment.FindPropertyRelative("m_YAdvance"), new GUIContent("AY"));
|
|||
|
|||
} |
|||
|
|||
|
|||
// Second Glyph
|
|||
GUI.enabled = isEditingEnabled; |
|||
if (isSelectable) |
|||
{ |
|||
float labelWidth = GUI.skin.label.CalcSize(new GUIContent("ID: " + prop_SecondGlyphIndex.intValue)).x; |
|||
EditorGUI.LabelField(new Rect(position.width / 2 + 20 + (64 - labelWidth) / 2, position.y + 60, 64f, 18f), new GUIContent("ID: <color=#FFFF80>" + prop_SecondGlyphIndex.intValue + "</color>"), style); |
|||
|
|||
GUI.enabled = isEditingEnabled; |
|||
EditorGUIUtility.labelWidth = 25f; |
|||
|
|||
rect = new Rect(position.width / 2 + 20 + 70, position.y + 10, (width - 70) - padding, 18); |
|||
EditorGUI.PropertyField(rect, prop_SecondGlyphValueRecord.FindPropertyRelative("m_XPlacement"), new GUIContent("OX:")); |
|||
|
|||
rect.y += 20; |
|||
EditorGUI.PropertyField(rect, prop_SecondGlyphValueRecord.FindPropertyRelative("m_YPlacement"), new GUIContent("OY:")); |
|||
|
|||
rect.y += 20; |
|||
EditorGUI.PropertyField(rect, prop_SecondGlyphValueRecord.FindPropertyRelative("m_XAdvance"), new GUIContent("AX:")); |
|||
|
|||
//rect.y += 20;
|
|||
//EditorGUI.PropertyField(rect, prop_SecondGlyphAdjustment.FindPropertyRelative("m_YAdvance"), new GUIContent("AY"));
|
|||
|
|||
DrawGlyph((uint)prop_SecondGlyphIndex.intValue, new Rect(position.width / 2 + 20, position.y + 2, 64, 60), property); |
|||
} |
|||
else |
|||
{ |
|||
rect = new Rect(position.width / 2 + 20, position.y, width / 2 * 0.8f - padding, 18); |
|||
EditorGUIUtility.labelWidth = 40f; |
|||
|
|||
// Second Character Lookup
|
|||
GUI.SetNextControlName("SecondCharacterField"); |
|||
EditorGUI.BeginChangeCheck(); |
|||
string secondCharacter = EditorGUI.TextField(rect, s_CharacterTextFieldLabel, m_SecondCharacter); |
|||
|
|||
if (GUI.GetNameOfFocusedControl() == "SecondCharacterField") |
|||
{ |
|||
if (ValidateInput(secondCharacter)) |
|||
{ |
|||
//Debug.Log("2nd Unicode value: [" + secondCharacter + "]");
|
|||
|
|||
uint unicode = GetUnicodeCharacter(secondCharacter); |
|||
|
|||
// Lookup glyph index
|
|||
TMP_SerializedPropertyHolder propertyHolder = property.serializedObject.targetObject as TMP_SerializedPropertyHolder; |
|||
TMP_FontAsset fontAsset = propertyHolder.fontAsset; |
|||
if (fontAsset != null) |
|||
{ |
|||
prop_SecondGlyphIndex.intValue = (int)fontAsset.GetGlyphIndex(unicode); |
|||
propertyHolder.secondCharacter = unicode; |
|||
} |
|||
} |
|||
} |
|||
|
|||
if (EditorGUI.EndChangeCheck()) |
|||
m_SecondCharacter = secondCharacter; |
|||
|
|||
// Second Glyph Index
|
|||
rect.x += width / 2 * 0.8f; |
|||
|
|||
EditorGUIUtility.labelWidth = 25f; |
|||
EditorGUI.BeginChangeCheck(); |
|||
EditorGUI.PropertyField(rect, prop_SecondGlyphIndex, new GUIContent("ID:")); |
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
|
|||
} |
|||
|
|||
GUI.enabled = isEditingEnabled; |
|||
EditorGUIUtility.labelWidth = 25f; |
|||
|
|||
rect = new Rect(position.width / 2 + 20, position.y + 20, width * 0.5f - padding, 18); |
|||
EditorGUI.PropertyField(rect, prop_SecondGlyphValueRecord.FindPropertyRelative("m_XPlacement"), new GUIContent("OX")); |
|||
|
|||
rect.x += width * 0.5f; |
|||
EditorGUI.PropertyField(rect, prop_SecondGlyphValueRecord.FindPropertyRelative("m_YPlacement"), new GUIContent("OY")); |
|||
|
|||
rect.x = position.width / 2 + 20; |
|||
rect.y += 20; |
|||
EditorGUI.PropertyField(rect, prop_SecondGlyphValueRecord.FindPropertyRelative("m_XAdvance"), new GUIContent("AX")); |
|||
|
|||
//rect.x += width * 0.5f;
|
|||
//EditorGUI.PropertyField(rect, prop_SecondGlyphAdjustment.FindPropertyRelative("m_YAdvance"), new GUIContent("AY"));
|
|||
} |
|||
|
|||
// Font Feature Lookup Flags
|
|||
if (isSelectable) |
|||
{ |
|||
EditorGUIUtility.labelWidth = 50f; |
|||
|
|||
rect.width = position.width * 0.5f; |
|||
rect.x = rect.width + 16; |
|||
rect.y += 28; |
|||
|
|||
FontFeatureLookupFlags flags = (FontFeatureLookupFlags)prop_FontFeatureLookupFlags.intValue; |
|||
|
|||
EditorGUI.BeginChangeCheck(); |
|||
flags = (FontFeatureLookupFlags)EditorGUI.EnumFlagsField(rect, new GUIContent("Options:"), flags); |
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
prop_FontFeatureLookupFlags.intValue = (int)flags; |
|||
} |
|||
} |
|||
} |
|||
|
|||
bool ValidateInput(string source) |
|||
{ |
|||
int length = string.IsNullOrEmpty(source) ? 0 : source.Length; |
|||
|
|||
////Filter out unwanted characters.
|
|||
Event evt = Event.current; |
|||
|
|||
char c = evt.character; |
|||
|
|||
if (c != '\0') |
|||
{ |
|||
switch (length) |
|||
{ |
|||
case 0: |
|||
break; |
|||
case 1: |
|||
if (source != m_PreviousInput) |
|||
return true; |
|||
|
|||
if ((source[0] == '\\' && (c == 'u' || c == 'U')) == false) |
|||
evt.character = '\0'; |
|||
|
|||
break; |
|||
case 2: |
|||
case 3: |
|||
case 4: |
|||
case 5: |
|||
if ((c < '0' || c > '9') && (c < 'a' || c > 'f') && (c < 'A' || c > 'F')) |
|||
evt.character = '\0'; |
|||
break; |
|||
case 6: |
|||
case 7: |
|||
case 8: |
|||
case 9: |
|||
if (source[1] == 'u' || (c < '0' || c > '9') && (c < 'a' || c > 'f') && (c < 'A' || c > 'F')) |
|||
evt.character = '\0'; |
|||
|
|||
// Validate input
|
|||
if (length == 6 && source[1] == 'u' && source != m_PreviousInput) |
|||
return true; |
|||
break; |
|||
case 10: |
|||
if (source != m_PreviousInput) |
|||
return true; |
|||
|
|||
evt.character = '\0'; |
|||
break; |
|||
} |
|||
} |
|||
|
|||
m_PreviousInput = source; |
|||
|
|||
return false; |
|||
} |
|||
|
|||
uint GetUnicodeCharacter (string source) |
|||
{ |
|||
uint unicode; |
|||
|
|||
if (source.Length == 1) |
|||
unicode = source[0]; |
|||
else if (source.Length == 6) |
|||
unicode = (uint)TMP_TextUtilities.StringHexToInt(source.Replace("\\u", "")); |
|||
else |
|||
unicode = (uint)TMP_TextUtilities.StringHexToInt(source.Replace("\\U", "")); |
|||
|
|||
return unicode; |
|||
} |
|||
|
|||
void DrawGlyph(uint glyphIndex, Rect glyphDrawPosition, SerializedProperty property) |
|||
{ |
|||
// Get a reference to the serialized object which can either be a TMP_FontAsset or FontAsset.
|
|||
SerializedObject so = property.serializedObject; |
|||
if (so == null) |
|||
return; |
|||
|
|||
if (m_GlyphLookupDictionary == null) |
|||
m_GlyphLookupDictionary = TMP_PropertyDrawerUtilities.GetGlyphProxyLookupDictionary(so); |
|||
|
|||
// Try getting a reference to the glyph for the given glyph index.
|
|||
if (!m_GlyphLookupDictionary.TryGetValue(glyphIndex, out GlyphProxy glyph)) |
|||
return; |
|||
|
|||
Texture2D atlasTexture; |
|||
if (TMP_PropertyDrawerUtilities.TryGetAtlasTextureFromSerializedObject(so, glyph.atlasIndex, out atlasTexture) == false) |
|||
return; |
|||
|
|||
Material mat; |
|||
if (TMP_PropertyDrawerUtilities.TryGetMaterial(so, atlasTexture, out mat) == false) |
|||
return; |
|||
|
|||
int padding = so.FindProperty("m_AtlasPadding").intValue; |
|||
GlyphRect glyphRect = glyph.glyphRect; |
|||
int glyphOriginX = glyphRect.x - padding; |
|||
int glyphOriginY = glyphRect.y - padding; |
|||
int glyphWidth = glyphRect.width + padding * 2; |
|||
int glyphHeight = glyphRect.height + padding * 2; |
|||
|
|||
SerializedProperty faceInfoProperty = so.FindProperty("m_FaceInfo"); |
|||
float ascentLine = faceInfoProperty.FindPropertyRelative("m_AscentLine").floatValue; |
|||
float descentLine = faceInfoProperty.FindPropertyRelative("m_DescentLine").floatValue; |
|||
|
|||
float normalizedHeight = ascentLine - descentLine; |
|||
float scale = glyphDrawPosition.width / normalizedHeight; |
|||
|
|||
// Compute the normalized texture coordinates
|
|||
Rect texCoords = new Rect((float)glyphOriginX / atlasTexture.width, (float)glyphOriginY / atlasTexture.height, (float)glyphWidth / atlasTexture.width, (float)glyphHeight / atlasTexture.height); |
|||
|
|||
if (Event.current.type == EventType.Repaint) |
|||
{ |
|||
glyphDrawPosition.x += (glyphDrawPosition.width - glyphWidth * scale) / 2; |
|||
glyphDrawPosition.y += (glyphDrawPosition.height - glyphHeight * scale) / 2; |
|||
glyphDrawPosition.width = glyphWidth * scale; |
|||
glyphDrawPosition.height = glyphHeight * scale; |
|||
|
|||
// Could switch to using the default material of the font asset which would require passing scale to the shader.
|
|||
Graphics.DrawTexture(glyphDrawPosition, atlasTexture, texCoords, 0, 0, 0, 0, new Color(1f, 1f, 1f), mat); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: d256fa541faf5d4409992c631adb98a1 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,50 @@ |
|||
using UnityEngine; |
|||
using UnityEngine.TextCore; |
|||
using UnityEditor; |
|||
using System.Collections; |
|||
|
|||
|
|||
namespace TMPro.EditorUtilities |
|||
{ |
|||
|
|||
[CustomPropertyDrawer(typeof(GlyphRect))] |
|||
public class GlyphRectPropertyDrawer : PropertyDrawer |
|||
{ |
|||
private static readonly GUIContent k_GlyphRectLabel = new GUIContent("Glyph Rect", "A rectangle (rect) that represents the position of the glyph in the atlas texture."); |
|||
private static readonly GUIContent k_XPropertyLabel = new GUIContent("X:", "The X coordinate of the glyph in the atlas texture."); |
|||
private static readonly GUIContent k_YPropertyLabel = new GUIContent("Y:", "The Y coordinate of the glyph in the atlas texture."); |
|||
private static readonly GUIContent k_WidthPropertyLabel = new GUIContent("W:", "The width of the glyph in the atlas texture."); |
|||
private static readonly GUIContent k_HeightPropertyLabel = new GUIContent("H:", "The height of the glyph in the atlas texture."); |
|||
|
|||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) |
|||
{ |
|||
//EditorGUI.BeginProperty(position, label, property);
|
|||
|
|||
SerializedProperty prop_X = property.FindPropertyRelative("m_X"); |
|||
SerializedProperty prop_Y = property.FindPropertyRelative("m_Y"); |
|||
SerializedProperty prop_Width = property.FindPropertyRelative("m_Width"); |
|||
SerializedProperty prop_Height = property.FindPropertyRelative("m_Height"); |
|||
|
|||
// We get Rect since a valid position may not be provided by the caller.
|
|||
Rect rect = new Rect(position.x, position.y, position.width, 49); |
|||
EditorGUI.LabelField(new Rect(rect.x, rect.y - 2.5f, rect.width, 18), k_GlyphRectLabel); |
|||
|
|||
EditorGUIUtility.labelWidth = 20f; |
|||
EditorGUIUtility.fieldWidth = 20f; |
|||
|
|||
//GUI.enabled = false;
|
|||
float width = (rect.width - 75f) / 4; |
|||
EditorGUI.PropertyField(new Rect(rect.x + width * 0, rect.y + 20, width - 5f, 18), prop_X, k_XPropertyLabel); |
|||
EditorGUI.PropertyField(new Rect(rect.x + width * 1, rect.y + 20, width - 5f, 18), prop_Y, k_YPropertyLabel); |
|||
EditorGUI.PropertyField(new Rect(rect.x + width * 2, rect.y + 20, width - 5f, 18), prop_Width, k_WidthPropertyLabel); |
|||
EditorGUI.PropertyField(new Rect(rect.x + width * 3, rect.y + 20, width - 5f, 18), prop_Height, k_HeightPropertyLabel); |
|||
|
|||
//EditorGUI.EndProperty();
|
|||
} |
|||
|
|||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) |
|||
{ |
|||
return 45f; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 8bc2b083b068f3546a9509c805e0541c |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,123 @@ |
|||
using System.Collections.Generic; |
|||
using UnityEditor; |
|||
using UnityEngine; |
|||
using UnityEngine.TextCore; |
|||
using UnityEngine.TextCore.LowLevel; |
|||
|
|||
namespace TMPro.EditorUtilities |
|||
{ |
|||
[CustomPropertyDrawer(typeof(LigatureSubstitutionRecord))] |
|||
class LigatureSubstitutionRecordPropertyDrawer : PropertyDrawer |
|||
{ |
|||
private Dictionary<uint, GlyphProxy> m_GlyphLookupDictionary; |
|||
|
|||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) |
|||
{ |
|||
SerializedProperty prop_ComponentGlyphIDs = property.FindPropertyRelative("m_ComponentGlyphIDs"); |
|||
int ComponentGlyphIDCount = prop_ComponentGlyphIDs.arraySize; |
|||
SerializedProperty prop_LigatureGlyphID = property.FindPropertyRelative("m_LigatureGlyphID"); |
|||
|
|||
// Refresh glyph proxy lookup dictionary if needed
|
|||
if (TMP_PropertyDrawerUtilities.s_RefreshGlyphProxyLookup) |
|||
TMP_PropertyDrawerUtilities.RefreshGlyphProxyLookup(property.serializedObject); |
|||
|
|||
Rect rect = position; |
|||
GUILayoutUtility.GetRect(position.width, 100); |
|||
|
|||
EditorGUIUtility.labelWidth = 115; |
|||
EditorGUI.BeginChangeCheck(); |
|||
int size = EditorGUI.DelayedIntField(new Rect(rect.x, position.y + 3, 130, rect.height), new GUIContent("Component Glyphs"), prop_ComponentGlyphIDs.arraySize); |
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
size = Mathf.Clamp(size, 0, 20); |
|||
prop_ComponentGlyphIDs.arraySize = size; |
|||
return; |
|||
} |
|||
|
|||
// Spacing between glyphs
|
|||
int glyphSpacing = 60; |
|||
|
|||
// Draw Component Glyphs
|
|||
for (int i = 0; i < ComponentGlyphIDCount; i++) |
|||
{ |
|||
Rect componentGlyphPosition = new Rect(50 + (glyphSpacing * i), position.y + 24, 48, 48); |
|||
|
|||
// Draw glyph
|
|||
uint glyphIndex = (uint)prop_ComponentGlyphIDs.GetArrayElementAtIndex(i).intValue; |
|||
DrawGlyph(glyphIndex, componentGlyphPosition, property); |
|||
|
|||
EditorGUI.BeginChangeCheck(); |
|||
EditorGUI.DelayedIntField(new Rect(componentGlyphPosition.x - 13, componentGlyphPosition.y + 73, 40, EditorGUIUtility.singleLineHeight), prop_ComponentGlyphIDs.GetArrayElementAtIndex(i), GUIContent.none); |
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
|
|||
} |
|||
} |
|||
|
|||
// Draw Ligature glyph
|
|||
Rect ligatureGlyphPosition = new Rect(50 + (glyphSpacing * ComponentGlyphIDCount + 1), position.y + 3, 95, EditorGUIUtility.singleLineHeight); |
|||
ligatureGlyphPosition.x = Mathf.Max(200, ligatureGlyphPosition.x); |
|||
EditorGUI.LabelField(ligatureGlyphPosition, new GUIContent("Ligature Glyph")); |
|||
|
|||
DrawGlyph((uint)prop_LigatureGlyphID.intValue, new Rect(ligatureGlyphPosition.x + 37, ligatureGlyphPosition.y + 21, 48, 48), property); |
|||
|
|||
EditorGUI.BeginChangeCheck(); |
|||
EditorGUI.DelayedIntField(new Rect(ligatureGlyphPosition.x + 24, ligatureGlyphPosition.y + 94, 40, EditorGUIUtility.singleLineHeight), prop_LigatureGlyphID, GUIContent.none); |
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
|
|||
} |
|||
} |
|||
|
|||
void DrawGlyph(uint glyphIndex, Rect glyphDrawPosition, SerializedProperty property) |
|||
{ |
|||
// Get a reference to the serialized object which can either be a TMP_FontAsset or FontAsset.
|
|||
SerializedObject so = property.serializedObject; |
|||
if (so == null) |
|||
return; |
|||
|
|||
if (m_GlyphLookupDictionary == null) |
|||
m_GlyphLookupDictionary = TMP_PropertyDrawerUtilities.GetGlyphProxyLookupDictionary(so); |
|||
|
|||
// Try getting a reference to the glyph for the given glyph index.
|
|||
if (!m_GlyphLookupDictionary.TryGetValue(glyphIndex, out GlyphProxy glyph)) |
|||
return; |
|||
|
|||
Texture2D atlasTexture; |
|||
if (TMP_PropertyDrawerUtilities.TryGetAtlasTextureFromSerializedObject(so, glyph.atlasIndex, out atlasTexture) == false) |
|||
return; |
|||
|
|||
Material mat; |
|||
if (TMP_PropertyDrawerUtilities.TryGetMaterial(so, atlasTexture, out mat) == false) |
|||
return; |
|||
|
|||
int padding = so.FindProperty("m_AtlasPadding").intValue; |
|||
GlyphRect glyphRect = glyph.glyphRect; |
|||
int glyphOriginX = glyphRect.x - padding; |
|||
int glyphOriginY = glyphRect.y - padding; |
|||
int glyphWidth = glyphRect.width + padding * 2; |
|||
int glyphHeight = glyphRect.height + padding * 2; |
|||
|
|||
SerializedProperty faceInfoProperty = so.FindProperty("m_FaceInfo"); |
|||
float ascentLine = faceInfoProperty.FindPropertyRelative("m_AscentLine").floatValue; |
|||
float descentLine = faceInfoProperty.FindPropertyRelative("m_DescentLine").floatValue; |
|||
|
|||
float normalizedHeight = ascentLine - descentLine; |
|||
float scale = glyphDrawPosition.width / normalizedHeight; |
|||
|
|||
// Compute the normalized texture coordinates
|
|||
Rect texCoords = new Rect((float)glyphOriginX / atlasTexture.width, (float)glyphOriginY / atlasTexture.height, (float)glyphWidth / atlasTexture.width, (float)glyphHeight / atlasTexture.height); |
|||
|
|||
if (Event.current.type == EventType.Repaint) |
|||
{ |
|||
glyphDrawPosition.x += -(glyphWidth * scale / 2 - padding * scale); |
|||
glyphDrawPosition.y += glyphDrawPosition.height - glyph.metrics.horizontalBearingY * scale; |
|||
glyphDrawPosition.width = glyphWidth * scale; |
|||
glyphDrawPosition.height = glyphHeight * scale; |
|||
|
|||
// Could switch to using the default material of the font asset which would require passing scale to the shader.
|
|||
Graphics.DrawTexture(glyphDrawPosition, atlasTexture, texCoords, 0, 0, 0, 0, new Color(1f, 1f, 1f), mat); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 7b6c2e51603686247afd5ab620c490e6 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,209 @@ |
|||
using UnityEngine; |
|||
using UnityEngine.TextCore; |
|||
using UnityEngine.TextCore.LowLevel; |
|||
using UnityEditor; |
|||
using System.Collections.Generic; |
|||
|
|||
|
|||
namespace TMPro.EditorUtilities |
|||
{ |
|||
[CustomPropertyDrawer(typeof(TMP_Character))] |
|||
public class TMP_CharacterPropertyDrawer : PropertyDrawer |
|||
{ |
|||
private Dictionary<uint, GlyphProxy> m_GlyphLookupDictionary; |
|||
int m_GlyphSelectedForEditing = -1; |
|||
|
|||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) |
|||
{ |
|||
SerializedProperty prop_Unicode = property.FindPropertyRelative("m_Unicode"); |
|||
SerializedProperty prop_GlyphIndex = property.FindPropertyRelative("m_GlyphIndex"); |
|||
SerializedProperty prop_Scale = property.FindPropertyRelative("m_Scale"); |
|||
|
|||
// Refresh glyph proxy lookup dictionary if needed
|
|||
if (TMP_PropertyDrawerUtilities.s_RefreshGlyphProxyLookup) |
|||
TMP_PropertyDrawerUtilities.RefreshGlyphProxyLookup(property.serializedObject); |
|||
|
|||
GUIStyle style = new GUIStyle(EditorStyles.label); |
|||
style.richText = true; |
|||
|
|||
EditorGUIUtility.labelWidth = 40f; |
|||
EditorGUIUtility.fieldWidth = 50; |
|||
|
|||
Rect rect = new Rect(position.x + 50, position.y, position.width, 49); |
|||
|
|||
// Display non-editable fields
|
|||
if (GUI.enabled == false) |
|||
{ |
|||
int unicode = prop_Unicode.intValue; |
|||
EditorGUI.LabelField(new Rect(rect.x, rect.y, 120f, 18), new GUIContent("Unicode: <color=#FFFF80>0x" + unicode.ToString("X") + "</color>"), style); |
|||
EditorGUI.LabelField(new Rect(rect.x + 115, rect.y, 120f, 18), unicode <= 0xFFFF ? new GUIContent("UTF16: <color=#FFFF80>\\u" + unicode.ToString("X4") + "</color>") : new GUIContent("UTF32: <color=#FFFF80>\\U" + unicode.ToString("X8") + "</color>"), style); |
|||
EditorGUI.LabelField(new Rect(rect.x, rect.y + 18, 120, 18), new GUIContent("Glyph ID: <color=#FFFF80>" + prop_GlyphIndex.intValue + "</color>"), style); |
|||
EditorGUI.LabelField(new Rect(rect.x, rect.y + 36, 80, 18), new GUIContent("Scale: <color=#FFFF80>" + prop_Scale.floatValue + "</color>"), style); |
|||
|
|||
// Draw Glyph (if exists)
|
|||
DrawGlyph((uint)prop_GlyphIndex.intValue, new Rect(position.x, position.y, 48, 58), property); |
|||
} |
|||
else // Display editable fields
|
|||
{ |
|||
EditorGUIUtility.labelWidth = 55f; |
|||
GUI.SetNextControlName("Unicode Input"); |
|||
EditorGUI.BeginChangeCheck(); |
|||
string unicode = EditorGUI.TextField(new Rect(rect.x, rect.y, 120, 18), "Unicode:", prop_Unicode.intValue.ToString("X")); |
|||
|
|||
if (GUI.GetNameOfFocusedControl() == "Unicode Input") |
|||
{ |
|||
//Filter out unwanted characters.
|
|||
char chr = Event.current.character; |
|||
if ((chr < '0' || chr > '9') && (chr < 'a' || chr > 'f') && (chr < 'A' || chr > 'F')) |
|||
{ |
|||
Event.current.character = '\0'; |
|||
} |
|||
} |
|||
|
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
// Update Unicode value
|
|||
prop_Unicode.intValue = TMP_TextUtilities.StringHexToInt(unicode); |
|||
} |
|||
|
|||
// Cache current glyph index in case it needs to be restored if the new glyph index is invalid.
|
|||
int currentGlyphIndex = prop_GlyphIndex.intValue; |
|||
|
|||
EditorGUIUtility.labelWidth = 59f; |
|||
EditorGUI.BeginChangeCheck(); |
|||
EditorGUI.DelayedIntField(new Rect(rect.x, rect.y + 18, 100, 18), prop_GlyphIndex, new GUIContent("Glyph ID:")); |
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
// Get a reference to the font asset
|
|||
TMP_FontAsset fontAsset = property.serializedObject.targetObject as TMP_FontAsset; |
|||
|
|||
// Make sure new glyph index is valid.
|
|||
int elementIndex = fontAsset.glyphTable.FindIndex(item => item.index == prop_GlyphIndex.intValue); |
|||
|
|||
if (elementIndex == -1) |
|||
prop_GlyphIndex.intValue = currentGlyphIndex; |
|||
else |
|||
fontAsset.IsFontAssetLookupTablesDirty = true; |
|||
} |
|||
|
|||
int glyphIndex = prop_GlyphIndex.intValue; |
|||
|
|||
// Reset glyph selection if new character has been selected.
|
|||
if (GUI.enabled && m_GlyphSelectedForEditing != glyphIndex) |
|||
m_GlyphSelectedForEditing = -1; |
|||
|
|||
// Display button to edit the glyph data.
|
|||
if (GUI.Button(new Rect(rect.x + 120, rect.y + 18, 75, 18), new GUIContent("Edit Glyph"))) |
|||
{ |
|||
if (m_GlyphSelectedForEditing == -1) |
|||
m_GlyphSelectedForEditing = glyphIndex; |
|||
else |
|||
m_GlyphSelectedForEditing = -1; |
|||
|
|||
// Button clicks should not result in potential change.
|
|||
GUI.changed = false; |
|||
} |
|||
|
|||
// Show the glyph property drawer if selected
|
|||
if (glyphIndex == m_GlyphSelectedForEditing && GUI.enabled) |
|||
{ |
|||
// Get a reference to the font asset
|
|||
TMP_FontAsset fontAsset = property.serializedObject.targetObject as TMP_FontAsset; |
|||
|
|||
if (fontAsset != null) |
|||
{ |
|||
// Get the index of the glyph in the font asset glyph table.
|
|||
int elementIndex = fontAsset.glyphTable.FindIndex(item => item.index == glyphIndex); |
|||
|
|||
if (elementIndex != -1) |
|||
{ |
|||
SerializedProperty prop_GlyphTable = property.serializedObject.FindProperty("m_GlyphTable"); |
|||
SerializedProperty prop_Glyph = prop_GlyphTable.GetArrayElementAtIndex(elementIndex); |
|||
|
|||
SerializedProperty prop_GlyphMetrics = prop_Glyph.FindPropertyRelative("m_Metrics"); |
|||
SerializedProperty prop_GlyphRect = prop_Glyph.FindPropertyRelative("m_GlyphRect"); |
|||
|
|||
Rect newRect = EditorGUILayout.GetControlRect(false, 115); |
|||
EditorGUI.DrawRect(new Rect(newRect.x + 52, newRect.y - 20, newRect.width - 52, newRect.height - 5), new Color(0.1f, 0.1f, 0.1f, 0.45f)); |
|||
EditorGUI.DrawRect(new Rect(newRect.x + 53, newRect.y - 19, newRect.width - 54, newRect.height - 7), new Color(0.3f, 0.3f, 0.3f, 0.8f)); |
|||
|
|||
// Display GlyphRect
|
|||
newRect.x += 55; |
|||
newRect.y -= 18; |
|||
newRect.width += 5; |
|||
EditorGUI.PropertyField(newRect, prop_GlyphRect); |
|||
|
|||
// Display GlyphMetrics
|
|||
newRect.y += 45; |
|||
EditorGUI.PropertyField(newRect, prop_GlyphMetrics); |
|||
|
|||
rect.y += 120; |
|||
} |
|||
} |
|||
} |
|||
|
|||
EditorGUIUtility.labelWidth = 39f; |
|||
EditorGUI.PropertyField(new Rect(rect.x, rect.y + 36, 80, 18), prop_Scale, new GUIContent("Scale:")); |
|||
|
|||
// Draw Glyph (if exists)
|
|||
DrawGlyph((uint)prop_GlyphIndex.intValue, new Rect(position.x, position.y, 48, 58), property); |
|||
} |
|||
} |
|||
|
|||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) |
|||
{ |
|||
return 58; |
|||
} |
|||
|
|||
void DrawGlyph(uint glyphIndex, Rect glyphDrawPosition, SerializedProperty property) |
|||
{ |
|||
// Get a reference to the serialized object which can either be a TMP_FontAsset or FontAsset.
|
|||
SerializedObject so = property.serializedObject; |
|||
if (so == null) |
|||
return; |
|||
|
|||
if (m_GlyphLookupDictionary == null) |
|||
m_GlyphLookupDictionary = TMP_PropertyDrawerUtilities.GetGlyphProxyLookupDictionary(so); |
|||
|
|||
// Try getting a reference to the glyph for the given glyph index.
|
|||
if (!m_GlyphLookupDictionary.TryGetValue(glyphIndex, out GlyphProxy glyph)) |
|||
return; |
|||
|
|||
Texture2D atlasTexture; |
|||
if (TMP_PropertyDrawerUtilities.TryGetAtlasTextureFromSerializedObject(so, glyph.atlasIndex, out atlasTexture) == false) |
|||
return; |
|||
|
|||
Material mat; |
|||
if (TMP_PropertyDrawerUtilities.TryGetMaterial(so, atlasTexture, out mat) == false) |
|||
return; |
|||
|
|||
int padding = so.FindProperty("m_AtlasPadding").intValue; |
|||
GlyphRect glyphRect = glyph.glyphRect; |
|||
int glyphOriginX = glyphRect.x - padding; |
|||
int glyphOriginY = glyphRect.y - padding; |
|||
int glyphWidth = glyphRect.width + padding * 2; |
|||
int glyphHeight = glyphRect.height + padding * 2; |
|||
|
|||
SerializedProperty faceInfoProperty = so.FindProperty("m_FaceInfo"); |
|||
float ascentLine = faceInfoProperty.FindPropertyRelative("m_AscentLine").floatValue; |
|||
float descentLine = faceInfoProperty.FindPropertyRelative("m_DescentLine").floatValue; |
|||
|
|||
float normalizedHeight = ascentLine - descentLine; |
|||
float scale = glyphDrawPosition.width / normalizedHeight; |
|||
|
|||
// Compute the normalized texture coordinates
|
|||
Rect texCoords = new Rect((float)glyphOriginX / atlasTexture.width, (float)glyphOriginY / atlasTexture.height, (float)glyphWidth / atlasTexture.width, (float)glyphHeight / atlasTexture.height); |
|||
|
|||
if (Event.current.type == EventType.Repaint) |
|||
{ |
|||
glyphDrawPosition.x += (glyphDrawPosition.width - glyphWidth * scale) / 2; |
|||
glyphDrawPosition.y += (glyphDrawPosition.height - glyphHeight * scale) / 2; |
|||
glyphDrawPosition.width = glyphWidth * scale; |
|||
glyphDrawPosition.height = glyphHeight * scale; |
|||
|
|||
// Could switch to using the default material of the font asset which would require passing scale to the shader.
|
|||
Graphics.DrawTexture(glyphDrawPosition, atlasTexture, texCoords, 0, 0, 0, 0, new Color(1f, 1f, 1f), mat); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 01ada73c4792aba4c937ff5d92cce866 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,106 @@ |
|||
using UnityEngine; |
|||
using UnityEngine.TextCore; |
|||
using UnityEditor; |
|||
using System.Collections.Generic; |
|||
|
|||
|
|||
namespace TMPro.EditorUtilities |
|||
{ |
|||
|
|||
[CustomPropertyDrawer(typeof(Glyph))] |
|||
public class TMP_GlyphPropertyDrawer : PropertyDrawer |
|||
{ |
|||
private static readonly GUIContent k_ScaleLabel = new GUIContent("Scale:", "The scale of this glyph."); |
|||
private static readonly GUIContent k_AtlasIndexLabel = new GUIContent("Atlas Index:", "The index of the atlas texture that contains this glyph."); |
|||
private static readonly GUIContent k_ClassTypeLabel = new GUIContent("Class Type:", "The class definition type of this glyph."); |
|||
|
|||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) |
|||
{ |
|||
SerializedProperty prop_GlyphIndex = property.FindPropertyRelative("m_Index"); |
|||
SerializedProperty prop_GlyphMetrics = property.FindPropertyRelative("m_Metrics"); |
|||
SerializedProperty prop_GlyphRect = property.FindPropertyRelative("m_GlyphRect"); |
|||
SerializedProperty prop_Scale = property.FindPropertyRelative("m_Scale"); |
|||
SerializedProperty prop_AtlasIndex = property.FindPropertyRelative("m_AtlasIndex"); |
|||
SerializedProperty prop_ClassDefinitionType = property.FindPropertyRelative("m_ClassDefinitionType"); |
|||
|
|||
GUIStyle style = new GUIStyle(EditorStyles.label); |
|||
style.richText = true; |
|||
|
|||
Rect rect = new Rect(position.x + 70, position.y, position.width, 49); |
|||
|
|||
float labelWidth = GUI.skin.label.CalcSize(new GUIContent("ID: " + prop_GlyphIndex.intValue)).x; |
|||
EditorGUI.LabelField(new Rect(position.x + (64 - labelWidth) / 2, position.y + 85, 64f, 18f), new GUIContent("ID: <color=#FFFF80>" + prop_GlyphIndex.intValue + "</color>"), style); |
|||
|
|||
// We get Rect since a valid position may not be provided by the caller.
|
|||
EditorGUI.PropertyField(new Rect(rect.x, rect.y, position.width, 49), prop_GlyphRect); |
|||
|
|||
rect.y += 45; |
|||
EditorGUI.PropertyField(rect, prop_GlyphMetrics); |
|||
|
|||
EditorGUIUtility.labelWidth = 40f; |
|||
EditorGUI.PropertyField(new Rect(rect.x, rect.y + 65, 75, 18), prop_Scale, k_ScaleLabel); |
|||
|
|||
EditorGUIUtility.labelWidth = 70f; |
|||
EditorGUI.PropertyField(new Rect(rect.x + 85, rect.y + 65, 95, 18), prop_AtlasIndex, k_AtlasIndexLabel); |
|||
|
|||
if (prop_ClassDefinitionType != null) |
|||
{ |
|||
EditorGUIUtility.labelWidth = 70f; |
|||
float minWidth = Mathf.Max(90, rect.width - 270); |
|||
EditorGUI.PropertyField(new Rect(rect.x + 190, rect.y + 65, minWidth, 18), prop_ClassDefinitionType, k_ClassTypeLabel); |
|||
} |
|||
|
|||
DrawGlyph(new Rect(position.x, position.y + 2, 64, 80), property); |
|||
} |
|||
|
|||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) |
|||
{ |
|||
return 130f; |
|||
} |
|||
|
|||
void DrawGlyph(Rect glyphDrawPosition, SerializedProperty property) |
|||
{ |
|||
// Get a reference to the serialized object which can either be a TMP_FontAsset or FontAsset.
|
|||
SerializedObject so = property.serializedObject; |
|||
if (so == null) |
|||
return; |
|||
|
|||
Texture2D atlasTexture; |
|||
int atlasIndex = property.FindPropertyRelative("m_AtlasIndex").intValue; |
|||
int padding = so.FindProperty("m_AtlasPadding").intValue; |
|||
if (TMP_PropertyDrawerUtilities.TryGetAtlasTextureFromSerializedObject(so, atlasIndex, out atlasTexture) == false) |
|||
return; |
|||
|
|||
Material mat; |
|||
if (TMP_PropertyDrawerUtilities.TryGetMaterial(so, atlasTexture, out mat) == false) |
|||
return; |
|||
|
|||
GlyphRect glyphRect = TMP_PropertyDrawerUtilities.GetGlyphRectFromGlyphSerializedProperty(property); |
|||
int glyphOriginX = glyphRect.x - padding; |
|||
int glyphOriginY = glyphRect.y - padding; |
|||
int glyphWidth = glyphRect.width + padding * 2; |
|||
int glyphHeight = glyphRect.height + padding * 2; |
|||
|
|||
SerializedProperty faceInfoProperty = so.FindProperty("m_FaceInfo"); |
|||
float ascentLine = faceInfoProperty.FindPropertyRelative("m_AscentLine").floatValue; |
|||
float descentLine = faceInfoProperty.FindPropertyRelative("m_DescentLine").floatValue; |
|||
|
|||
float normalizedHeight = ascentLine - descentLine; |
|||
float scale = glyphDrawPosition.width / normalizedHeight; |
|||
|
|||
// Compute the normalized texture coordinates
|
|||
Rect texCoords = new Rect((float)glyphOriginX / atlasTexture.width, (float)glyphOriginY / atlasTexture.height, (float)glyphWidth / atlasTexture.width, (float)glyphHeight / atlasTexture.height); |
|||
|
|||
if (Event.current.type == EventType.Repaint) |
|||
{ |
|||
glyphDrawPosition.x += (glyphDrawPosition.width - glyphWidth * scale) / 2; |
|||
glyphDrawPosition.y += (glyphDrawPosition.height - glyphHeight * scale) / 2; |
|||
glyphDrawPosition.width = glyphWidth * scale; |
|||
glyphDrawPosition.height = glyphHeight * scale; |
|||
|
|||
// Could switch to using the default material of the font asset which would require passing scale to the shader.
|
|||
Graphics.DrawTexture(glyphDrawPosition, atlasTexture, texCoords, 0, 0, 0, 0, new Color(1f, 1f, 1f), mat); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
fileFormatVersion: 2 |
|||
guid: c4777500b5da6094e956c3d4f04de4db |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
Some files were not shown because too many files changed in this diff
Write
Preview
Loading…
Cancel
Save
Reference in new issue