@@ -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);
|
||||
}
|
||||
|
||||
// 可选:在属性变更时自动刷新
|
||||
|
||||
@@ -15,7 +15,6 @@ Material:
|
||||
- _FX_LIGHT_MODE_UNLIT
|
||||
m_InvalidKeywords:
|
||||
- _CADDTEXUVT_ON
|
||||
- _CUSTOMDATA
|
||||
- _CUSTOMDATA_OFF
|
||||
- _DISSOLVEAR_ON
|
||||
- _DISSOLVEPLUSTEXAR_ON
|
||||
@@ -191,7 +190,7 @@ Material:
|
||||
- _W9ParticleCustomDataFlag3: 0
|
||||
- _W9ParticleShaderColorChannelFlag: 3
|
||||
- _W9ParticleShaderFlags: 2056
|
||||
- _W9ParticleShaderFlags1: 8388608
|
||||
- _W9ParticleShaderFlags1: 2097152
|
||||
- _W9ParticleShaderGUIFoldToggle: 134217743
|
||||
- _W9ParticleShaderGUIFoldToggle1: 8388608
|
||||
- _W9ParticleShaderGUIFoldToggle2: 251
|
||||
@@ -380,7 +379,7 @@ Material:
|
||||
- _Mask_rotat: 0
|
||||
- _Mask_scale: 1
|
||||
- _MatCapToggle: 0
|
||||
- _MeshSourceMode: 0
|
||||
- _MeshSourceMode: 1
|
||||
- _Mode: 0
|
||||
- _NoiseMapUVRotation: 0
|
||||
- _ParallaxMapping_Intensity: 0.05
|
||||
|
||||
@@ -15,7 +15,6 @@ Material:
|
||||
- _FX_LIGHT_MODE_UNLIT
|
||||
m_InvalidKeywords:
|
||||
- _CADDTEXUVT_ON
|
||||
- _CUSTOMDATA
|
||||
- _CUSTOMDATA_OFF
|
||||
- _DISSOLVEAR_ON
|
||||
- _DISSOLVEPLUSTEXAR_ON
|
||||
@@ -191,7 +190,7 @@ Material:
|
||||
- _W9ParticleCustomDataFlag3: 0
|
||||
- _W9ParticleShaderColorChannelFlag: 3
|
||||
- _W9ParticleShaderFlags: 10248
|
||||
- _W9ParticleShaderFlags1: 8388608
|
||||
- _W9ParticleShaderFlags1: 2097152
|
||||
- _W9ParticleShaderGUIFoldToggle: 134217743
|
||||
- _W9ParticleShaderGUIFoldToggle1: 8388608
|
||||
- _W9ParticleShaderGUIFoldToggle2: 251
|
||||
@@ -380,7 +379,7 @@ Material:
|
||||
- _Mask_rotat: 0
|
||||
- _Mask_scale: 1
|
||||
- _MatCapToggle: 0
|
||||
- _MeshSourceMode: 0
|
||||
- _MeshSourceMode: 1
|
||||
- _Mode: 0
|
||||
- _NoiseMapUVRotation: 0
|
||||
- _ParallaxMapping_Intensity: 0.05
|
||||
|
||||
@@ -16,7 +16,6 @@ Material:
|
||||
m_InvalidKeywords:
|
||||
- _ALPHAADD_ON
|
||||
- _CADDTEXUVT_ON
|
||||
- _CUSTOMDATA
|
||||
- _CUSTOMDATA_OFF
|
||||
- _DISSOLVEAR_ON
|
||||
- _DISSOLVEPLUSTEXAR_ON
|
||||
@@ -192,7 +191,7 @@ Material:
|
||||
- _W9ParticleCustomDataFlag3: 0
|
||||
- _W9ParticleShaderColorChannelFlag: 3
|
||||
- _W9ParticleShaderFlags: 8
|
||||
- _W9ParticleShaderFlags1: 8388608
|
||||
- _W9ParticleShaderFlags1: 2097152
|
||||
- _W9ParticleShaderGUIFoldToggle: 15
|
||||
- _W9ParticleShaderGUIFoldToggle1: 8388608
|
||||
- _W9ParticleShaderGUIFoldToggle2: 251
|
||||
@@ -381,7 +380,7 @@ Material:
|
||||
- _Mask_rotat: 0
|
||||
- _Mask_scale: 1
|
||||
- _MatCapToggle: 0
|
||||
- _MeshSourceMode: 0
|
||||
- _MeshSourceMode: 1
|
||||
- _Mode: 0
|
||||
- _NoiseMapUVRotation: 0
|
||||
- _ParallaxMapping_Intensity: 0.05
|
||||
|
||||
@@ -15,7 +15,6 @@ Material:
|
||||
- _FX_LIGHT_MODE_UNLIT
|
||||
m_InvalidKeywords:
|
||||
- _CADDTEXUVT_ON
|
||||
- _CUSTOMDATA
|
||||
- _CUSTOMDATA_OFF
|
||||
- _DISSOLVEAR_ON
|
||||
- _DISSOLVEPLUSTEXAR_ON
|
||||
@@ -251,8 +250,8 @@ Material:
|
||||
- _W9ParticleCustomDataFlag3: 0
|
||||
- _W9ParticleShaderColorChannelFlag: 3
|
||||
- _W9ParticleShaderFlags: 264200
|
||||
- _W9ParticleShaderFlags1: 8388608
|
||||
- _W9ParticleShaderGUIFoldToggle: 134217743
|
||||
- _W9ParticleShaderFlags1: 2097152
|
||||
- _W9ParticleShaderGUIFoldToggle: 134217742
|
||||
- _W9ParticleShaderGUIFoldToggle1: 8388608
|
||||
- _W9ParticleShaderGUIFoldToggle2: 0
|
||||
- _W9ParticleShaderWrapFlags: 0
|
||||
@@ -546,7 +545,7 @@ Material:
|
||||
- _Mask_rotat: 0
|
||||
- _Mask_scale: 1
|
||||
- _MatCapToggle: 0
|
||||
- _MeshSourceMode: 0
|
||||
- _MeshSourceMode: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _NoiseMapUVRotation: 0
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
|
||||
public MeshGenerator meshGenerator;
|
||||
public SplinePositioner headPoint, tailPoint;
|
||||
|
||||
private MaterialPropertyBlock materialPropertyBlock;
|
||||
public override Vector3 noteVisualPosition => headPoint.transform.position;
|
||||
|
||||
public new static DTMNoteVisualHold GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
@@ -29,6 +29,7 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
public override void Initialize(string name, Guid elementGuid, List<string> tags, bool isFirstGenerated, GameElement parentElement)
|
||||
{
|
||||
base.Initialize(name, elementGuid, tags, isFirstGenerated, parentElement);
|
||||
materialPropertyBlock = new();
|
||||
Observable.NextFrame().Subscribe(_ =>
|
||||
{
|
||||
Recover();
|
||||
@@ -86,8 +87,8 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
Renderer rend = part.GetComponent<Renderer>();
|
||||
if (rend != null)
|
||||
{
|
||||
rend.materials[0].SetFloat("_MainAlpha", 1f);
|
||||
rend.materials[1].SetFloat("_MainAlpha", 1f);
|
||||
materialPropertyBlock.SetFloat("_MainAlpha", 1f);
|
||||
rend.SetPropertyBlock(materialPropertyBlock);
|
||||
note.track.trackPathSubmodule.path.RebuildImmediate();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user