Skip to content

Instantly share code, notes, and snippets.

@ronyx69
Last active March 12, 2019 02:51
Show Gist options
  • Save ronyx69/a5029e0369e45117285b113ffe1a6d48 to your computer and use it in GitHub Desktop.
Save ronyx69/a5029e0369e45117285b113ffe1a6d48 to your computer and use it in GitHub Desktop.
Change the shader of a building to Default in asset editor.
var shader = Shader.Find("Custom/Buildings/Building/Default");
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as BuildingInfo;
if(asset.m_material != null) asset.m_material.shader = shader;
if(asset.m_lodMaterial != null) asset.m_lodMaterial.shader = shader;
asset.m_requireHeightMap = false;
@cborelc
Copy link

cborelc commented Mar 12, 2019

How do I use this - I have the Modtools console running but I don't see a place where to paste it or load it from a file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment