mirror of
https://github.com/drewcassidy/KSP-Conformal-Decals.git
synced 2024-09-01 18:23:54 +00:00
Fix text rendering yet again
This commit is contained in:
parent
5f23ce2a31
commit
436c56e6eb
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c052218d804b37076ca9ffc2b0793a679927fc9cc4ce66b34c683a6b60f8da5f
|
||||
size 85504
|
||||
oid sha256:cedff4e96de1dfcaee14eb43cc6a258bf17be3c6fcec42f6e48249668d8aefa9
|
||||
size 87040
|
||||
|
|
|
@ -6,7 +6,7 @@ using UnityEngine;
|
|||
using UnityEngine.Events;
|
||||
|
||||
namespace ConformalDecals.Text {
|
||||
[KSPAddon(KSPAddon.Startup.Instantly, true)]
|
||||
[KSPAddon(KSPAddon.Startup.EveryScene, false)]
|
||||
public class TextRenderer : MonoBehaviour {
|
||||
public const TextureFormat TextTextureFormat = TextureFormat.RG16;
|
||||
public const RenderTextureFormat TextRenderTextureFormat = RenderTextureFormat.R8;
|
||||
|
@ -166,6 +166,7 @@ namespace ConformalDecals.Text {
|
|||
_tmp.fontSize = FontSize;
|
||||
|
||||
// GENERATE MESH
|
||||
_tmp.ClearMesh(false);
|
||||
_tmp.ForceMeshUpdate();
|
||||
|
||||
var meshFilters = gameObject.GetComponentsInChildren<MeshFilter>();
|
||||
|
@ -180,7 +181,7 @@ namespace ConformalDecals.Text {
|
|||
var renderer = meshFilters[i].gameObject.GetComponent<MeshRenderer>();
|
||||
|
||||
meshes[i] = meshFilters[i].mesh;
|
||||
meshes[i].RecalculateBounds();
|
||||
if (i == 0) meshes[i] = _tmp.mesh;
|
||||
|
||||
materials[i] = Instantiate(renderer.material);
|
||||
materials[i].shader = _blitShader;
|
||||
|
|
Loading…
Reference in New Issue
Block a user