void DeleteOptionWindow(int id, int idOfType)
    {
        EntityDeleted(id);
        EditorInfo.OptionsIndexes.RemoveAt(idOfType);
        EditorInfo.Options--;

        CurrentOptions.RemoveAt(idOfType);

        ClearAllConnectionsPending();

        int[] keys = new int[EditorInfo.NodesOptionsFoldouts.Count];
        EditorInfo.NodesOptionsFoldouts.Keys.CopyTo(keys, 0);
        for (int i = 0; i < keys.Length; i++)
        {
            EditorInfo.NodesOptionsFoldouts[keys[i]].Remove(idOfType);

            int[] optionsKeys = new int[EditorInfo.NodesOptionsFoldouts[keys[i]].Count];
            EditorInfo.NodesOptionsFoldouts[keys[i]].Keys.CopyTo(optionsKeys, 0);

            for (int j = 0; j < optionsKeys.Length; j++)
            {
                int key = optionsKeys[j];

                if (key > idOfType)
                {
                    bool value = EditorInfo.NodesOptionsFoldouts[keys[i]][key];
                    EditorInfo.NodesOptionsFoldouts[keys[i]].Remove(key);
                    key--;
                    EditorInfo.NodesOptionsFoldouts[keys[i]].Add(key, value);
                }
            }
        }

        DecrementIndexes(id);
        UpdateTargetAfterDeletion(id, idOfType, NodeType.Option);

        WriteDebug("Deleting option " + idOfType + " and it's associations.");
    }