Skip to content

Instantly share code, notes, and snippets.

@snaka
Created July 30, 2014 13:02
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 snaka/7639e820cc8915cc8f25 to your computer and use it in GitHub Desktop.
Save snaka/7639e820cc8915cc8f25 to your computer and use it in GitHub Desktop.
実行時にシェーダを差し替える ref: http://qiita.com/snaka/items/f7065604ce7306282821
// change shader
var defaultShader = Shader.Find ("Sprites/Default");
var renderers = ((GameObject)instance).GetComponentsInChildren<SpriteRenderer>();
foreach (var r in renderers) {
r.material.shader = defaultShader;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment