Пример #1
0
        private static void CopyThumbnail(Store <AppState> store)
        {
            var buildOutputDir    = SharePackageUtils.GetBuildOutputDirectory();
            var thumbnailDestPath = Path.Combine(buildOutputDir, thumbnail);

            File.Delete(thumbnailDestPath);

            string thumbnailDir = SharePackageUtils.GetThumbnailPath();

            if (string.IsNullOrEmpty(thumbnailDir))
            {
                return;
            }

            FileUtil.CopyFileOrDirectory(thumbnailDir, thumbnailDestPath);
        }
Пример #2
0
        private static void ZipAndShare(string title, Store <AppState> store)
        {
            store.Dispatch(new TitleChangeAction {
                title = title
            });

            if (!SharePackageUtils.LastBuildIsValid())
            {
                store.Dispatch(new OnErrorAction {
                    errorMsg = "Please build project first!"
                });
                return;
            }

            string buildOutputDir = SharePackageUtils.GetBuildOutputDirectory();

            if (!Zip(store, buildOutputDir))
            {
                return;
            }
            store.Dispatch(new UploadStartAction());
        }
        void SetupUploadTab()
        {
            SetupButton("btnShare", OnShareClicked, true);
            SetupButton("btnSelectImage", OnSelectImageClicked, true);
            SetupImage("imgThumbnail", SharePackageUtils.GetThumbnailPath());

            TextField txtProjectName = root.Query <TextField>("txtProjectName");

            txtProjectName.RegisterValueChangedCallback(OnGameTitleChanged);
            txtProjectName.value = gameTitle;

            if (SharePackageUtils.LastBuildIsValid())
            {
                string lastOutputDirectory = SharePackageUtils.GetBuildOutputDirectory();
                SetupLabel(
                    "lblLastBuildInfo",
                    $"Last build located at {lastOutputDirectory}, created {File.GetLastWriteTime(lastOutputDirectory)}"
                    );
                return;
            }

            //[NOTE]: you should never get here
            SetupLabel("lblLastBuildInfo", "No previous build available...");
        }