public static void HideWindow()
    {
        CubeTexturingEditorWindow window = GetCubeTextureWindow();

        ToEdit = null;
        window.Close();
    }
    public static void ShowWindow(CubeTexturing toEdit)
    {
        CubeTexturingEditorWindow window = GetCubeTextureWindow();

        ToEdit = toEdit;
        window.Show();
    }
    public override void OnInspectorGUI()
    {
        CubeTexturing toEdit = (CubeTexturing)target;

        if (GUILayout.Button("Toggle Texture Placer"))
        {
            CubeTexturingEditorWindow.ToggleWindow(toEdit);
        }
        DrawDefaultInspector();
    }
 public static void ToggleWindow(CubeTexturing toEdit)
 {
     if (ToEdit != null)
     {
         HideWindow();
     }
     else
     {
         ShowWindow(toEdit);
     }
 }