コード例 #1
0
        public static void CreateWindowWithContext(GameObject ctx)
        {
            LDtkNativeExportWindow window = ConstructWindow();

            window._project = ctx;
            window.OnEnable();
            window.Show();
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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();
        }