//------------------------------------------------- void OnEnable() { if ( Selection.activeTransform != null ) { TeleportArea_NVR teleportArea = Selection.activeTransform.GetComponent<TeleportArea_NVR>(); if ( teleportArea != null ) { teleportArea.UpdateVisualsInEditor(); } } }
//------------------------------------------------- public override void OnInspectorGUI() { DrawDefaultInspector(); if ( Selection.activeTransform != null ) { TeleportArea_NVR teleportArea = Selection.activeTransform.GetComponent<TeleportArea_NVR>(); if ( GUI.changed && teleportArea != null ) { teleportArea.UpdateVisualsInEditor(); } } }