Created
May 29, 2018 16:56
-
-
Save ronyx69/4856d3bb49f706281d3e0c9ce881f101 to your computer and use it in GitHub Desktop.
Change the shader of a building sub mesh to prop default in asset editor.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var subMesh = 0; // sub mesh id, order as in ui, starting from 0 | |
var shader = Shader.Find("Custom/Props/Prop/Default"); // the shader to use | |
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as BuildingInfo; | |
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