Skip to content

Instantly share code, notes, and snippets.

@hisasann
Created August 29, 2014 10:49
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 hisasann/0ad918e66f49050bdcea to your computer and use it in GitHub Desktop.
Save hisasann/0ad918e66f49050bdcea to your computer and use it in GitHub Desktop.
GameObjectを破棄するときにMaterialも破棄するメソッド
private void DestroyObject ()
{
foreach (Transform t in transform) {
Destroy (t.gameObject.renderer.material);
Destroy (t.gameObject);
}
Destroy (gameObject.renderer.material);
Destroy (gameObject);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment