Reimport upgraded TextMesh Pro, modified.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 243e06394e614e5d99fab26083b707fa
|
||||
guid: fa01d66f44e9d4a42ae8ca989003a496
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
3
Assets/TextMesh Pro/Editor Resources/GUID CONVERT.json
Normal file
3
Assets/TextMesh Pro/Editor Resources/GUID CONVERT.json
Normal file
@@ -0,0 +1,3 @@
|
||||
*** DO NOT REMOVE THIS FILE ***
|
||||
|
||||
// This is a special file to control automatic GUID remapping of TMP resources such as <TMP_FontAsset> to the Unity internal <FontAsset> type.
|
@@ -1,8 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d82c1b31c7e74239bff1220585707d2b
|
||||
timeCreated: 1425440388
|
||||
licenseType: Store
|
||||
guid: 2ade62400bece1a4f9093a91ca22b276
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,9 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4aecb92fff08436c8303b10eab8da368
|
||||
guid: e93ec7eb6de342aabd156833e253f838
|
||||
folderAsset: yes
|
||||
timeCreated: 1441876950
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
8
Assets/TextMesh Pro/Editor Resources/Shaders.meta
Normal file
8
Assets/TextMesh Pro/Editor Resources/Shaders.meta
Normal file
@@ -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:
|
132
Assets/TextMesh Pro/Editor Resources/Shaders/TMP_SDF_SSD.cginc
Normal file
132
Assets/TextMesh Pro/Editor Resources/Shaders/TMP_SDF_SSD.cginc
Normal file
@@ -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:
|
8
Assets/TextMesh Pro/Editor Resources/Textures.meta
Normal file
8
Assets/TextMesh Pro/Editor Resources/Textures.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f8e6a2d47aba4c6c9b3c5a72d9f48da5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
BIN
Assets/TextMesh Pro/Editor Resources/Textures/btn_AlignFlush.psd
Normal file
BIN
Assets/TextMesh Pro/Editor Resources/Textures/btn_AlignFlush.psd
Normal file
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
BIN
Assets/TextMesh Pro/Editor Resources/Textures/btn_AlignLeft.psd
Normal file
BIN
Assets/TextMesh Pro/Editor Resources/Textures/btn_AlignLeft.psd
Normal file
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
BIN
Assets/TextMesh Pro/Editor Resources/Textures/btn_AlignRight.psd
Normal file
BIN
Assets/TextMesh Pro/Editor Resources/Textures/btn_AlignRight.psd
Normal file
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
BIN
Assets/TextMesh Pro/Editor Resources/Textures/btn_AlignTop.psd
Normal file
BIN
Assets/TextMesh Pro/Editor Resources/Textures/btn_AlignTop.psd
Normal file
Binary file not shown.
@@ -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:
|
Binary file not shown.
@@ -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:
|
@@ -1 +0,0 @@
|
||||
)]}〕〉》」』】〙〗〟’”⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、%,.:;。!?]):;=}¢°"†‡℃〆%,.
|
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fade42e8bc714b018fac513c043d323b
|
||||
timeCreated: 1425440388
|
||||
licenseType: Store
|
||||
TextScriptImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1 +0,0 @@
|
||||
([{〔〈《「『【〘〖〝‘“⦅«$—…‥〳〴〵\[({£¥"々〇$¥₩ #
|
@@ -1,68 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ab2114bdc8544297b417dfefe9f1e410, type: 3}
|
||||
m_Name: Default Style Sheet
|
||||
m_EditorClassIdentifier:
|
||||
m_StyleList:
|
||||
- m_Name: H1
|
||||
m_HashCode: 2425
|
||||
m_OpeningDefinition: <size=2em><b><#40ff80>*
|
||||
m_ClosingDefinition: '*</size></b></color>'
|
||||
m_OpeningTagArray: 3c00000073000000690000007a000000650000003d00000032000000650000006d0000003e0000003c000000620000003e0000003c000000230000003400000030000000660000006600000038000000300000003e0000002a000000
|
||||
m_ClosingTagArray: 2a0000003c0000002f00000073000000690000007a000000650000003e0000003c0000002f000000620000003e0000003c0000002f000000630000006f0000006c0000006f000000720000003e000000
|
||||
- m_Name: Quote
|
||||
m_HashCode: 92254330
|
||||
m_OpeningDefinition: <i><size=75%><margin=10%>
|
||||
m_ClosingDefinition: </i></size></width></margin>
|
||||
m_OpeningTagArray: 3c000000690000003e0000003c00000073000000690000007a000000650000003d0000003700000035000000250000003e0000003c0000006d000000610000007200000067000000690000006e0000003d0000003100000030000000250000003e000000
|
||||
m_ClosingTagArray: 3c0000002f000000690000003e0000003c0000002f00000073000000690000007a000000650000003e0000003c0000002f00000077000000690000006400000074000000680000003e0000003c0000002f0000006d000000610000007200000067000000690000006e0000003e000000
|
||||
- m_Name: Link
|
||||
m_HashCode: 2687968
|
||||
m_OpeningDefinition: <u><#40a0ff><link="ID_01">
|
||||
m_ClosingDefinition: </u></color></link>
|
||||
m_OpeningTagArray: 3c000000750000003e0000003c000000230000003400000030000000610000003000000066000000660000003e0000003c0000006c000000690000006e0000006b0000003d0000002200000049000000440000005f0000003000000031000000220000003e000000
|
||||
m_ClosingTagArray: 3c0000002f000000750000003e0000003c0000002f000000630000006f0000006c0000006f000000720000003e0000003c0000002f0000006c000000690000006e0000006b0000003e000000
|
||||
- m_Name: Title
|
||||
m_HashCode: 98732960
|
||||
m_OpeningDefinition: <size=125%><b><align=center>
|
||||
m_ClosingDefinition: </size></b></align>
|
||||
m_OpeningTagArray: 3c00000073000000690000007a000000650000003d000000310000003200000035000000250000003e0000003c000000620000003e0000003c000000610000006c00000069000000670000006e0000003d00000063000000650000006e0000007400000065000000720000003e000000
|
||||
m_ClosingTagArray: 3c0000002f00000073000000690000007a000000650000003e0000003c0000002f000000620000003e0000003c0000002f000000610000006c00000069000000670000006e0000003e000000
|
||||
- m_Name: H2
|
||||
m_HashCode: 2426
|
||||
m_OpeningDefinition: <size=1.5em><b><#4080FF>
|
||||
m_ClosingDefinition: </size></b></color>
|
||||
m_OpeningTagArray: 3c00000073000000690000007a000000650000003d000000310000002e00000035000000650000006d0000003e0000003c000000620000003e0000003c000000230000003400000030000000380000003000000046000000460000003e000000
|
||||
m_ClosingTagArray: 3c0000002f00000073000000690000007a000000650000003e0000003c0000002f000000620000003e0000003c0000002f000000630000006f0000006c0000006f000000720000003e000000
|
||||
- m_Name: H3
|
||||
m_HashCode: 2427
|
||||
m_OpeningDefinition: <size=1.17em><b><#FF8040>
|
||||
m_ClosingDefinition: </size></b></color>
|
||||
m_OpeningTagArray: 3c00000073000000690000007a000000650000003d000000310000002e0000003100000037000000650000006d0000003e0000003c000000620000003e0000003c000000230000004600000046000000380000003000000034000000300000003e000000
|
||||
m_ClosingTagArray: 3c0000002f00000073000000690000007a000000650000003e0000003c0000002f000000620000003e0000003c0000002f000000630000006f0000006c0000006f000000720000003e000000
|
||||
- m_Name: C1
|
||||
m_HashCode: 2194
|
||||
m_OpeningDefinition: <color=#ffff40>
|
||||
m_ClosingDefinition: </color>
|
||||
m_OpeningTagArray: 3c000000630000006f0000006c0000006f000000720000003d000000230000006600000066000000660000006600000034000000300000003e000000
|
||||
m_ClosingTagArray: 3c0000002f000000630000006f0000006c0000006f000000720000003e000000
|
||||
- m_Name: C2
|
||||
m_HashCode: 2193
|
||||
m_OpeningDefinition: <color=#ff40FF><size=125%>
|
||||
m_ClosingDefinition: </color></size>
|
||||
m_OpeningTagArray: 3c000000630000006f0000006c0000006f000000720000003d000000230000006600000066000000340000003000000046000000460000003e0000003c00000073000000690000007a000000650000003d000000310000003200000035000000250000003e000000
|
||||
m_ClosingTagArray: 3c0000002f000000630000006f0000006c0000006f000000720000003e0000003c0000002f00000073000000690000007a000000650000003e000000
|
||||
- m_Name: C3
|
||||
m_HashCode: 2192
|
||||
m_OpeningDefinition: <color=#80A0FF><b>
|
||||
m_ClosingDefinition: </color></b>
|
||||
m_OpeningTagArray: 3c000000630000006f0000006c0000006f000000720000003d000000230000003800000030000000410000003000000046000000460000003e0000003c000000620000003e000000
|
||||
m_ClosingTagArray: 3c0000002f000000630000006f0000006c0000006f000000720000003e0000003c0000002f000000620000003e000000
|
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f952c082cb03451daed3ee968ac6c63e
|
||||
timeCreated: 1432805430
|
||||
licenseType: Store
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3f5b5dff67a942289a9defa416b206f3
|
||||
timeCreated: 1436653997
|
||||
licenseType: Pro
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/TextMesh Pro/Scripts.meta
Normal file
8
Assets/TextMesh Pro/Scripts.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 26b31616c8395e84c8101989aae56ba6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/TextMesh Pro/Scripts/Editor.meta
Normal file
8
Assets/TextMesh Pro/Scripts/Editor.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 651f9a260a3765242b8026f1d4db06e4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/TextMesh Pro/Scripts/Editor/HDRP.meta
Normal file
8
Assets/TextMesh Pro/Scripts/Editor/HDRP.meta
Normal file
@@ -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:
|
8
Assets/TextMesh Pro/Scripts/Editor/PropertyDrawers.meta
Normal file
8
Assets/TextMesh Pro/Scripts/Editor/PropertyDrawers.meta
Normal file
@@ -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: 705d3db7bce31a7439cc4c95cde5b04f
|
||||
timeCreated: 1464818008
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,273 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace TMPro.EditorUtilities
|
||||
{
|
||||
|
||||
[CustomPropertyDrawer(typeof(TextAlignmentOptions))]
|
||||
public class TMP_TextAlignmentDrawer : PropertyDrawer
|
||||
{
|
||||
const int k_AlignmentButtonWidth = 24;
|
||||
const int k_AlignmentButtonHeight = 20;
|
||||
const int k_WideViewWidth = 504;
|
||||
const int k_ControlsSpacing = 6;
|
||||
const int k_GroupWidth = k_AlignmentButtonWidth * 6;
|
||||
static readonly int k_TextAlignmentHash = "DoTextAligmentControl".GetHashCode();
|
||||
|
||||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
|
||||
{
|
||||
return EditorGUIUtility.currentViewWidth > k_WideViewWidth ? k_AlignmentButtonHeight : k_AlignmentButtonHeight * 2 + 3;
|
||||
}
|
||||
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
var id = GUIUtility.GetControlID(k_TextAlignmentHash, FocusType.Keyboard, position);
|
||||
|
||||
EditorGUI.BeginProperty(position, label, property);
|
||||
{
|
||||
var controlArea = EditorGUI.PrefixLabel(position, id, label);
|
||||
|
||||
var horizontalAligment = new Rect(controlArea.x, controlArea.y, k_GroupWidth, k_AlignmentButtonHeight);
|
||||
var verticalAligment = new Rect(!(EditorGUIUtility.currentViewWidth > k_WideViewWidth) ? controlArea.x : horizontalAligment.xMax + k_ControlsSpacing, !(EditorGUIUtility.currentViewWidth > k_WideViewWidth) ? controlArea.y + k_AlignmentButtonHeight + 3 : controlArea.y, k_GroupWidth, k_AlignmentButtonHeight);
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
|
||||
var selectedHorizontal = DoHorizontalAligmentControl(horizontalAligment, property);
|
||||
var selectedVertical = DoVerticalAligmentControl(verticalAligment, property);
|
||||
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
var value = (0x1 << selectedHorizontal) | (0x100 << selectedVertical);
|
||||
property.intValue = value;
|
||||
}
|
||||
}
|
||||
EditorGUI.EndProperty();
|
||||
}
|
||||
|
||||
static int DoHorizontalAligmentControl(Rect position, SerializedProperty alignment)
|
||||
{
|
||||
var selected = TMP_EditorUtility.GetHorizontalAlignmentGridValue(alignment.intValue);
|
||||
|
||||
var values = new bool[6];
|
||||
|
||||
values[selected] = true;
|
||||
|
||||
if (alignment.hasMultipleDifferentValues)
|
||||
{
|
||||
foreach (var obj in alignment.serializedObject.targetObjects)
|
||||
{
|
||||
var text = obj as TMP_Text;
|
||||
if (text != null)
|
||||
{
|
||||
values[TMP_EditorUtility.GetHorizontalAlignmentGridValue((int)text.alignment)] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
position.width = k_AlignmentButtonWidth;
|
||||
|
||||
for (var i = 0; i < values.Length; i++)
|
||||
{
|
||||
var oldValue = values[i];
|
||||
var newValue = TMP_EditorUtility.EditorToggle(position, oldValue, TMP_UIStyleManager.alignContentA[i], i == 0 ? TMP_UIStyleManager.alignmentButtonLeft : (i == 5 ? TMP_UIStyleManager.alignmentButtonRight : TMP_UIStyleManager.alignmentButtonMid));
|
||||
if (newValue != oldValue)
|
||||
{
|
||||
selected = i;
|
||||
}
|
||||
position.x += position.width;
|
||||
}
|
||||
|
||||
return selected;
|
||||
}
|
||||
|
||||
static int DoVerticalAligmentControl(Rect position, SerializedProperty alignment)
|
||||
{
|
||||
var selected = TMP_EditorUtility.GetVerticalAlignmentGridValue(alignment.intValue);
|
||||
|
||||
var values = new bool[6];
|
||||
|
||||
values[selected] = true;
|
||||
|
||||
if (alignment.hasMultipleDifferentValues)
|
||||
{
|
||||
foreach (var obj in alignment.serializedObject.targetObjects)
|
||||
{
|
||||
var text = obj as TMP_Text;
|
||||
if (text != null)
|
||||
{
|
||||
values[TMP_EditorUtility.GetVerticalAlignmentGridValue((int)text.alignment)] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
position.width = k_AlignmentButtonWidth;
|
||||
|
||||
for (var i = 0; i < values.Length; i++)
|
||||
{
|
||||
var oldValue = values[i];
|
||||
var newValue = TMP_EditorUtility.EditorToggle(position, oldValue, TMP_UIStyleManager.alignContentB[i], i == 0 ? TMP_UIStyleManager.alignmentButtonLeft : (i == 5 ? TMP_UIStyleManager.alignmentButtonRight : TMP_UIStyleManager.alignmentButtonMid));
|
||||
if (newValue != oldValue)
|
||||
{
|
||||
selected = i;
|
||||
}
|
||||
position.x += position.width;
|
||||
}
|
||||
|
||||
return selected;
|
||||
}
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(HorizontalAlignmentOptions))]
|
||||
public class TMP_HorizontalAlignmentDrawer : PropertyDrawer
|
||||
{
|
||||
const int k_AlignmentButtonWidth = 24;
|
||||
const int k_AlignmentButtonHeight = 20;
|
||||
const int k_WideViewWidth = 504;
|
||||
const int k_ControlsSpacing = 6;
|
||||
const int k_GroupWidth = k_AlignmentButtonWidth * 6;
|
||||
static readonly int k_TextAlignmentHash = "DoTextAligmentControl".GetHashCode();
|
||||
|
||||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
|
||||
{
|
||||
return EditorGUIUtility.currentViewWidth > k_WideViewWidth ? k_AlignmentButtonHeight : k_AlignmentButtonHeight * 2 + 3;
|
||||
}
|
||||
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
var id = GUIUtility.GetControlID(k_TextAlignmentHash, FocusType.Keyboard, position);
|
||||
|
||||
EditorGUI.BeginProperty(position, label, property);
|
||||
{
|
||||
var controlArea = EditorGUI.PrefixLabel(position, id, label);
|
||||
|
||||
var horizontalAligment = new Rect(controlArea.x, controlArea.y, k_GroupWidth, k_AlignmentButtonHeight);
|
||||
//var verticalAligment = new Rect(!(EditorGUIUtility.currentViewWidth > k_WideViewWidth) ? controlArea.x : horizontalAligment.xMax + k_ControlsSpacing, !(EditorGUIUtility.currentViewWidth > k_WideViewWidth) ? controlArea.y + k_AlignmentButtonHeight + 3 : controlArea.y, k_GroupWidth, k_AlignmentButtonHeight);
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
|
||||
var selectedHorizontal = DoHorizontalAligmentControl(horizontalAligment, property);
|
||||
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
var value = 0x1 << selectedHorizontal;
|
||||
property.intValue = value;
|
||||
}
|
||||
}
|
||||
EditorGUI.EndProperty();
|
||||
}
|
||||
|
||||
static int DoHorizontalAligmentControl(Rect position, SerializedProperty alignment)
|
||||
{
|
||||
var selected = TMP_EditorUtility.GetHorizontalAlignmentGridValue(alignment.intValue);
|
||||
|
||||
var values = new bool[6];
|
||||
|
||||
values[selected] = true;
|
||||
|
||||
if (alignment.hasMultipleDifferentValues)
|
||||
{
|
||||
foreach (var obj in alignment.serializedObject.targetObjects)
|
||||
{
|
||||
var text = obj as TMP_Text;
|
||||
if (text != null)
|
||||
{
|
||||
values[TMP_EditorUtility.GetHorizontalAlignmentGridValue((int)text.horizontalAlignment)] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
position.width = k_AlignmentButtonWidth;
|
||||
|
||||
for (var i = 0; i < values.Length; i++)
|
||||
{
|
||||
var oldValue = values[i];
|
||||
var newValue = TMP_EditorUtility.EditorToggle(position, oldValue, TMP_UIStyleManager.alignContentA[i], i == 0 ? TMP_UIStyleManager.alignmentButtonLeft : (i == 5 ? TMP_UIStyleManager.alignmentButtonRight : TMP_UIStyleManager.alignmentButtonMid));
|
||||
if (newValue != oldValue)
|
||||
{
|
||||
selected = i;
|
||||
}
|
||||
position.x += position.width;
|
||||
}
|
||||
|
||||
return selected;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[CustomPropertyDrawer(typeof(VerticalAlignmentOptions))]
|
||||
public class TMP_VerticalAlignmentDrawer : PropertyDrawer
|
||||
{
|
||||
const int k_AlignmentButtonWidth = 24;
|
||||
const int k_AlignmentButtonHeight = 20;
|
||||
const int k_WideViewWidth = 504;
|
||||
const int k_ControlsSpacing = 6;
|
||||
const int k_GroupWidth = k_AlignmentButtonWidth * 6;
|
||||
static readonly int k_TextAlignmentHash = "DoTextAligmentControl".GetHashCode();
|
||||
|
||||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
|
||||
{
|
||||
return EditorGUIUtility.currentViewWidth > k_WideViewWidth ? k_AlignmentButtonHeight : k_AlignmentButtonHeight * 2 + 3;
|
||||
}
|
||||
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
var id = GUIUtility.GetControlID(k_TextAlignmentHash, FocusType.Keyboard, position);
|
||||
|
||||
EditorGUI.BeginProperty(position, label, property);
|
||||
{
|
||||
var controlArea = EditorGUI.PrefixLabel(position, id, label);
|
||||
|
||||
var horizontalAligment = new Rect(controlArea.x, controlArea.y, k_GroupWidth, k_AlignmentButtonHeight);
|
||||
var verticalAligment = new Rect(!(EditorGUIUtility.currentViewWidth > k_WideViewWidth) ? controlArea.x : horizontalAligment.xMax + k_ControlsSpacing, !(EditorGUIUtility.currentViewWidth > k_WideViewWidth) ? controlArea.y + k_AlignmentButtonHeight + 3 : controlArea.y, k_GroupWidth, k_AlignmentButtonHeight);
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
|
||||
//var selectedHorizontal = DoHorizontalAligmentControl(horizontalAligment, property);
|
||||
var selectedVertical = DoVerticalAligmentControl(verticalAligment, property);
|
||||
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
var value = 0x100 << selectedVertical;
|
||||
property.intValue = value;
|
||||
}
|
||||
}
|
||||
EditorGUI.EndProperty();
|
||||
}
|
||||
|
||||
static int DoVerticalAligmentControl(Rect position, SerializedProperty alignment)
|
||||
{
|
||||
var selected = TMP_EditorUtility.GetVerticalAlignmentGridValue(alignment.intValue);
|
||||
|
||||
var values = new bool[6];
|
||||
|
||||
values[selected] = true;
|
||||
|
||||
if (alignment.hasMultipleDifferentValues)
|
||||
{
|
||||
foreach (var obj in alignment.serializedObject.targetObjects)
|
||||
{
|
||||
var text = obj as TMP_Text;
|
||||
if (text != null)
|
||||
{
|
||||
values[TMP_EditorUtility.GetVerticalAlignmentGridValue((int)text.verticalAlignment)] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
position.width = k_AlignmentButtonWidth;
|
||||
|
||||
for (var i = 0; i < values.Length; i++)
|
||||
{
|
||||
var oldValue = values[i];
|
||||
var newValue = TMP_EditorUtility.EditorToggle(position, oldValue, TMP_UIStyleManager.alignContentB[i], i == 0 ? TMP_UIStyleManager.alignmentButtonLeft : (i == 5 ? TMP_UIStyleManager.alignmentButtonRight : TMP_UIStyleManager.alignmentButtonMid));
|
||||
if (newValue != oldValue)
|
||||
{
|
||||
selected = i;
|
||||
}
|
||||
position.x += position.width;
|
||||
}
|
||||
|
||||
return selected;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea87c857d2c45f64ebe967330244a515
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
1390
Assets/TextMesh Pro/Scripts/Editor/TMP_BaseEditorPanel.cs
Normal file
1390
Assets/TextMesh Pro/Scripts/Editor/TMP_BaseEditorPanel.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 53dc282e104b7b3499778bb50cb28216
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
699
Assets/TextMesh Pro/Scripts/Editor/TMP_BaseShaderGUI.cs
Normal file
699
Assets/TextMesh Pro/Scripts/Editor/TMP_BaseShaderGUI.cs
Normal file
@@ -0,0 +1,699 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.TextCore.Text;
|
||||
using UnityEditor;
|
||||
|
||||
|
||||
namespace TMPro.EditorUtilities
|
||||
{
|
||||
/// <summary>Base class for TextMesh Pro shader GUIs.</summary>
|
||||
public abstract class TMP_BaseShaderGUI : ShaderGUI
|
||||
{
|
||||
/// <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_BaseShaderGUI()
|
||||
{
|
||||
// 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;
|
||||
private int m_ShaderID;
|
||||
|
||||
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.
|
||||
TextEventManager.ON_MATERIAL_PROPERTY_CHANGED(true, m_Material);
|
||||
}
|
||||
|
||||
s_LastSeenUndoRedoCount = s_UndoRedoCount;
|
||||
}
|
||||
|
||||
public override void OnGUI(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())
|
||||
{
|
||||
TextEventManager.ON_MATERIAL_PROPERTY_CHANGED(true, m_Material);
|
||||
}
|
||||
|
||||
DoDragAndDropEnd();
|
||||
}
|
||||
|
||||
public override void AssignNewShaderToMaterial(Material material, Shader oldShader, Shader newShader)
|
||||
{
|
||||
base.AssignNewShaderToMaterial(material, oldShader, newShader);
|
||||
|
||||
TextEventManager.ON_MATERIAL_PROPERTY_CHANGED(true, material);
|
||||
}
|
||||
|
||||
/// <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;
|
||||
}
|
||||
|
||||
public 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 <= 330f && (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;
|
||||
}
|
||||
|
||||
protected 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;
|
||||
}
|
||||
}
|
||||
|
||||
bool IsNewShader()
|
||||
{
|
||||
if (m_Material == null)
|
||||
return false;
|
||||
|
||||
int currentShaderID = m_Material.shader.GetInstanceID();
|
||||
|
||||
if (m_ShaderID == currentShaderID)
|
||||
return false;
|
||||
|
||||
m_ShaderID = currentShaderID;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
else if (evt.type == EventType.DragExited)
|
||||
{
|
||||
if (IsNewShader())
|
||||
TextEventManager.ON_MATERIAL_PROPERTY_CHANGED(true, m_Material);
|
||||
}
|
||||
}
|
||||
|
||||
void PerformDrop(Material droppedMaterial)
|
||||
{
|
||||
Texture droppedTex = droppedMaterial.GetTexture(ShaderUtilities.ID_MainTex);
|
||||
if (!droppedTex)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Texture currentTex = m_Material.GetTexture(ShaderUtilities.ID_MainTex);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
TextEventManager.ON_DRAG_AND_DROP_MATERIAL_CHANGED(o, m_Material, droppedMaterial);
|
||||
EditorUtility.SetDirty(o);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user