mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-13 21:25:09 +00:00
Fixed rods not recoloring (#441)
This commit is contained in:
parent
5cbcc39c8b
commit
a6931693be
1 changed files with 14 additions and 0 deletions
|
@ -97,6 +97,7 @@ namespace HeavenStudio.Games
|
|||
private Material[] gridMaterials;
|
||||
private Material[] firstPatternLights;
|
||||
private Material[] secondPatternLights;
|
||||
private Material[] elevatorObjectMats;
|
||||
|
||||
[Header("Properties")]
|
||||
[SerializeField] float beltSpeed = 1f;
|
||||
|
@ -127,6 +128,15 @@ namespace HeavenStudio.Games
|
|||
elevatorMaterials = elevatorRenderer.materials;
|
||||
beltMaterial = Instantiate(environmentMaterials[8]);
|
||||
environmentMaterials[8] = beltMaterial;
|
||||
elevatorObjectMats = new Material[]
|
||||
{
|
||||
Instantiate(elevatorMaterials[0]),
|
||||
Instantiate(elevatorMaterials[1]),
|
||||
Instantiate(elevatorMaterials[2]),
|
||||
};
|
||||
elevatorMaterials[0] = elevatorObjectMats[0];
|
||||
elevatorMaterials[1] = elevatorObjectMats[1];
|
||||
elevatorMaterials[2] = elevatorObjectMats[2];
|
||||
elevatorMaterial = Instantiate(elevatorMaterials[3]);
|
||||
elevatorMaterials[3] = elevatorMaterial;
|
||||
gridMaterials = new Material[]
|
||||
|
@ -199,6 +209,10 @@ namespace HeavenStudio.Games
|
|||
{
|
||||
mat.SetColor("_Color", currentEnvironmentColor);
|
||||
}
|
||||
foreach (var mat in elevatorObjectMats)
|
||||
{
|
||||
mat.SetColor("_Color", currentObjectColor);
|
||||
}
|
||||
if (!lighting)
|
||||
{
|
||||
foreach (var mat in firstPatternLights)
|
||||
|
|
Loading…
Reference in a new issue