@@ -37,16 +37,15 @@ namespace Ichni.RhythmGame
|
||||
public override void Refresh()
|
||||
{
|
||||
base.Refresh();
|
||||
if (shadowRenderer == null || shadowRenderer.material == null) return;
|
||||
var mat = shadowRenderer.material;
|
||||
MaterialPropertyBlock materialPropertyBlock = new MaterialPropertyBlock();
|
||||
materialPropertyBlock.SetColor("_Color", colorSubmodule.currentBaseColor);
|
||||
materialPropertyBlock.SetColor("_ShadowColor", colorSubmodule.currentEmissionColor);
|
||||
materialPropertyBlock.SetFloat("_ShadowThreshold", shadowThreshold);
|
||||
materialPropertyBlock.SetFloat("_ShadowSmoothness", shadowSmoothness);
|
||||
materialPropertyBlock.SetVector("_FakeLightDir", new Vector4(fakeLightDir.x, fakeLightDir.y, fakeLightDir.z, 0));
|
||||
materialPropertyBlock.SetFloat("_UseWorldLight", useWorldLight ? 1 : 0);
|
||||
shadowRenderer.SetPropertyBlock(materialPropertyBlock);
|
||||
Material material = shadowRenderer.material;
|
||||
material.SetColor("_Color", colorSubmodule.currentBaseColor);
|
||||
material.SetColor("_ShadowColor", colorSubmodule.currentEmissionColor);
|
||||
material.SetFloat("_ShadowThreshold", shadowThreshold);
|
||||
material.SetFloat("_ShadowSmoothness", shadowSmoothness);
|
||||
material.SetVector("_FakeLightDir", new Vector4(fakeLightDir.x, fakeLightDir.y, fakeLightDir.z, 0));
|
||||
if (useWorldLight) material.EnableKeyword("_USEWORLDLIGHT");
|
||||
else material.DisableKeyword("_USEWORLDLIGHT");
|
||||
|
||||
}
|
||||
|
||||
// 可选:在属性变更时自动刷新
|
||||
|
||||
Reference in New Issue
Block a user