Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Change the shader of a vehicle sub mesh to prop default in asset editor.
var subMesh = 1; // sub mesh id, order as in ui, starting from 1
var shader = Shader.Find("Custom/Props/Prop/Default"); // the shader to use
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as VehicleInfo;
asset.m_subMeshes[subMesh].m_subInfo.m_material.shader = shader;
asset.m_subMeshes[subMesh].m_subInfo.m_lodMaterial.shader = shader;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment