Skip to content

Instantly share code, notes, and snippets.

@ronyx69
Last active May 9, 2018 16:49
Show Gist options
  • Save ronyx69/7a720c7c7f767d8441b824da4e0ea5f2 to your computer and use it in GitHub Desktop.
Save ronyx69/7a720c7c7f767d8441b824da4e0ea5f2 to your computer and use it in GitHub Desktop.
Change the shader of a building to Fence in asset editor.
var shader = Shader.Find("Custom/Buildings/Building/Fence");
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 = true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment