Click or drag to resize

MeshesUpdateMaterials Method

Sets the specified values to material of all the child renderers in the parent's object.

Namespace:  KSPDev.ModelUtils
Assembly:  KSPDev_Utils.2.5 (in KSPDev_Utils.2.5.dll) Version: 2.5 for KSP v1
Syntax
C#
public static void UpdateMaterials(
	GameObject parent,
	string newShaderName = null,
	Color? newColor = null
)
Request Example View Source

Parameters

parent
Type: UnityEngineGameObject
Game object to start searching for renderers from.
newShaderName (Optional)
Type: SystemString
New shader name. If null then it will not be changed.
newColor (Optional)
Type: SystemNullableColor
Color to set. If null then it will not be changed.
Remarks
Shared material is affected, so if there are unrelated meshes that use the same material then they will be affected as well. In general, it's a bad idea to share material between several parts. And it's a good practice to share materials within the same part.
See Also