Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Change the shader of a prop to Fence in asset editor.
var shader = Shader.Find("Custom/Props/Prop/Fence");
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as PropInfo;
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