Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

How do i call a function in main script from editor script?

$
0
0
Hi. I made a javascript ("DetailMassPlace") to autogenerate grass detail on a terrain. I need to make another script ("DetailMassPlaceEditor") to create a button in the inspector to apply the grass. My editor-script looks like this: @CustomEditor(DetailMassPlace) public class DetailMassPlaceEditor extends Editor { override function OnInspectorGUI () { DrawDefaultInspector(); if(GUILayout.Button("Apply")) { updateLayer(); } } } The updateLayer() function is a function inside "DetailMassPlace". How do i call that function from the other script "DetailMassPlaceEditor"?

Viewing all articles
Browse latest Browse all 171066

Latest Images

Trending Articles



Latest Images

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