public override void OnInspectorGUI() { isoTexture = target as IsoTexture; if (GUILayout.Button("Open texture assistant")) { TextureAssistant.OpenWindowEditor(isoTexture); } }
public static void OpenWindowEditor(IsoTexture selected) { TextureAssistant assistant = EditorWindow.GetWindow(typeof(TextureAssistant)) as TextureAssistant; assistant.currentText = selected; IsoTexture[] textures = TextureManager.getInstance().textureList(); for (int i = 0; i < textures.Length; i++) if (selected == textures[i]) assistant.selected = i; }