mirror of
https://github.com/PorktoberRevolution/ReStocked
synced 2024-09-01 17:34:42 +00:00
Fix depth mask interaction with part repairs
This commit is contained in:
parent
7fcb091c5f
commit
af43cd8f70
Binary file not shown.
@ -44,12 +44,14 @@ namespace Restock
|
|||||||
// the part variant system is implemented extremely stupidly
|
// the part variant system is implemented extremely stupidly
|
||||||
// so we have to make this whole module more complicated as a result
|
// so we have to make this whole module more complicated as a result
|
||||||
GameEvents.onVariantApplied.Add(OnVariantApplied);
|
GameEvents.onVariantApplied.Add(OnVariantApplied);
|
||||||
|
GameEvents.onPartRepaired.Add(OnPartRepaired);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void OnDestroy()
|
private void OnDestroy()
|
||||||
{
|
{
|
||||||
GameEvents.onVariantApplied.Remove(OnVariantApplied);
|
GameEvents.onVariantApplied.Remove(OnVariantApplied);
|
||||||
|
GameEvents.onPartRepaired.Remove(OnPartRepaired);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -95,6 +97,12 @@ namespace Restock
|
|||||||
if (appliedPart == this.part) UpdateAllMaterials();
|
if (appliedPart == this.part) UpdateAllMaterials();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void OnPartRepaired(Part repairedPart)
|
||||||
|
{
|
||||||
|
// Part repair resets part of the mesh from the prefab, so it needs to be reapplied
|
||||||
|
if (repairedPart == this.part) UpdateAllMaterials();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void UpdateAllMaterials()
|
private void UpdateAllMaterials()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user