public static void CreateWindowWithContext(GameObject ctx) { LDtkNativeExportWindow window = ConstructWindow(); window._project = ctx; window.OnEnable(); window.Show(); }
private static LDtkNativeExportWindow ConstructWindow() { LDtkNativeExportWindow window = GetWindow <LDtkNativeExportWindow>(); window.titleContent = new GUIContent() { text = "Export", image = LDtkIconUtility.LoadSimpleIcon() }; window.minSize = new Vector2(250, 140); return(window); }
private void DrawExportButton() { GUIContent content = new GUIContent() { text = "Export", tooltip = "Export Native Prefab" }; GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); bool button = GUILayout.Button(content, GUILayout.Width(45)); GUILayout.EndHorizontal(); if (button) { GameObject gameObject = (GameObject)assetTarget; LDtkNativeExportWindow.CreateWindowWithContext(gameObject); } LDtkEditorGUIUtility.DrawDivider(); }