static void ShowWindow() { TransferFunctionEditorWindow tf1dWnd = (TransferFunctionEditorWindow)EditorWindow.GetWindow(typeof(TransferFunctionEditorWindow)); if (tf1dWnd != null) { tf1dWnd.Close(); } TransferFunction2DEditorWindow tf2dWnd = (TransferFunction2DEditorWindow)EditorWindow.GetWindow(typeof(TransferFunction2DEditorWindow)); tf2dWnd.Show(); tf2dWnd.SetInitialPosition(); }
public static void ShowWindow() { // Close all (if any) 1D TF editor windows TransferFunctionEditorWindow[] tf1dWnds = Resources.FindObjectsOfTypeAll <TransferFunctionEditorWindow>(); foreach (TransferFunctionEditorWindow tf1dWnd in tf1dWnds) { tf1dWnd.Close(); } TransferFunction2DEditorWindow tf2dWnd = (TransferFunction2DEditorWindow)EditorWindow.GetWindow(typeof(TransferFunction2DEditorWindow)); tf2dWnd.Show(); tf2dWnd.SetInitialPosition(); }