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