转载:https://blog.csdn.net/Wenhao_China/article/details/122009744
1、创建一个Shader
Shader "Custom/3D Text Shader" {
Properties{
_MainTex("Font Texture", 2D) = "white" {}
_Color("Text Color", Color) = (1,1,1,1)
}
SubShader{
Tags{ "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
Lighting Off Cull Off ZWrite On Fog { Mode Off }
Blend SrcAlpha OneMinusSrcAlpha
Pass {
Color[_Color]
SetTexture[_MainTex] {
combine primary, texture * primary
}
}
}
}
2、创建一个Material
然后Shader改为刚刚创建的这个Shader
3、给Material赋值字体
把你想要用的字体拖拽到Unity中来,然后字体下边的Font Texture,赋值给当前的Material。
4、给3DText属性赋值
3DText 的字体设置为刚才的字体,material设置为刚才创建的