@@ -39,12 +39,14 @@ namespace Ichni.RhythmGame
|
||||
base.Refresh();
|
||||
if (shadowRenderer == null || shadowRenderer.material == null) return;
|
||||
var mat = shadowRenderer.material;
|
||||
mat.SetColor("_Color", colorSubmodule.currentBaseColor);
|
||||
mat.SetColor("_ShadowColor", colorSubmodule.currentEmissionColor);
|
||||
mat.SetFloat("_ShadowThreshold", shadowThreshold);
|
||||
mat.SetFloat("_ShadowSmoothness", shadowSmoothness);
|
||||
mat.SetVector("_FakeLightDir", new Vector4(fakeLightDir.x, fakeLightDir.y, fakeLightDir.z, 0));
|
||||
mat.SetFloat("_UseWorldLight", useWorldLight ? 1 : 0);
|
||||
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);
|
||||
}
|
||||
|
||||
// 可选:在属性变更时自动刷新
|
||||
|
||||
Reference in New Issue
Block a user