/// <summary>Destroys a game object with the specified Rail component attached</summary> /// <param name="rail">The Rail component whose game object to destroy</param> private void RemoveRail(Rail rail) { if (EditorUtility.DisplayDialog("Remove Rail?", "Do you really want to remove " + rail.gameObject.name + " from the scene?", "Remove", "Cancel")) { _currentRailIndex = -1; GUIUtilities.RemoveChildObject(rail.gameObject); } }
/// <summary>Destroys a game object with the specified Trigger component attached</summary> /// <param name="trigger">The Trigger component whose game object to destroy</param> private void RemoveTrigger(Trigger trigger) { if (EditorUtility.DisplayDialog("Remove Trigger?", "Do you really want to remove " + trigger.gameObject.name + " from the scene?", "Remove", "Cancel")) { _currentTriggerIndex = -1; GUIUtilities.RemoveChildObject(trigger.gameObject); } }