public override void OnInspectorGUI() { DrawDefaultInspector(); if (GUI.changed) { ZippyTerrain2DChild tar = (target as ZippyTerrain2DChild); tar.PositionOnTerrain(); tar.lastPos = tar.transform.localPosition; } }
void Update() { ZippyTerrain2DChild tar = (target as ZippyTerrain2DChild); if (target == null) { return; } if (tar.lastPos != tar.transform.localPosition) { tar.PositionOnTerrain(); tar.lastPos = tar.transform.localPosition; } }