Skip to content

Instantly share code, notes, and snippets.

@boformer
Created October 22, 2015 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boformer/38d97d663779d48a21ed to your computer and use it in GitHub Desktop.
Save boformer/38d97d663779d48a21ed to your computer and use it in GitHub Desktop.
// Possible Values:
// "Custom/Props/Decal/Blend"
// "Custom/Props/Decal/Solid"
// "Custom/Props/Prop/Fence"
// "Custom/Props/Prop/Default"
var shader = Shader.Find("Custom/Props/Decal/Blend");
// set this to true if the prop should conform to the terrain, otherwise false
var requireHeightMap = true;
// --- end of settings ---
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as PropInfo;
if(asset == null) { Debug.Log("Error: Not a prop!"); return; }
asset.m_requireHeightMap = requireHeightMap;
if(asset.m_material != null) asset.m_material.shader = shader;
if(asset.m_lodMaterial != null) asset.m_lodMaterial.shader = shader;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment