Quantcast
Channel: Answers for "Change material with EditorScript"
Viewing all articles
Browse latest Browse all 6

Answer by aymeric

$
0
0
It works now! i used the code like this: Make sure you begin with "Assets" in the path. @CustomEditor (scriptname) class NewBehaviourScript extends Editor{ function OnInspectorGUI() { var thePath = "Assets/ExampleMaterial.mat"; var loadedMaterial = AssetDatabase.LoadAssetAtPath(thePath, Material); Debug.Log("Just loaded this material: " + loadedMaterial.name); target.renderer.material = loadedMaterial; } } Thanks Jahroy

Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>