Code cleanup.

This commit is contained in:
2023-02-21 18:43:21 +08:00
parent f04cd370f1
commit 39db8dfa45
2 changed files with 2 additions and 3 deletions

View File

@@ -123,10 +123,8 @@ namespace Cryville.Crtr.Components {
}
mesh.Renderer.enabled = true;
mesh.Renderer.sharedMaterial.mainTexture = frame.Frame.Texture;
UpdateShader();
UpdateUV();
UpdateScale();
UpdateZIndex();
}
Shader m_shader;
public string Shader {
@@ -139,6 +137,7 @@ namespace Cryville.Crtr.Components {
if (!mesh.Initialized) return;
if (m_shader == null) m_shader = GenericResources.Shaders["default"];
mesh.Renderer.sharedMaterial.shader = m_shader;
UpdateZIndex();
}
readonly Vector2[] _uvs = new Vector2[4];
protected virtual void UpdateUV() {
@@ -183,6 +182,7 @@ namespace Cryville.Crtr.Components {
public override void Init() {
InternalInit();
OnFrameUpdate();
UpdateShader();
}
}
}

View File

@@ -1,5 +1,4 @@
using Cryville.Common.Pdt;
using Cryville.Crtr.Event;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Profiling;