jp.keijiro.klutter-tools 2.5.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.attestation.p7m +0 -0
- package/CHANGELOG.md +14 -0
- package/Editor/AwaitableExtensions.cs +24 -0
- package/Editor/AwaitableExtensions.cs.meta +2 -0
- package/Editor/Downloader/DownloaderWindow.cs +26 -0
- package/Editor/Downloader/DownloaderWindow.uxml +1 -0
- package/Editor/Downloader/FileEntry.cs +1 -2
- package/Editor/Downloader/Launcher.cs +5 -2
- package/package.json +3 -3
package/.attestation.p7m
CHANGED
|
Binary file
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
6
6
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.6.0] - 2026-01-25
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Added a Download All button to the Downloader tool.
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [2.5.1] - 2026-01-21
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- Adjusted Downloader launch delay to be applied when constructing the launcher.
|
|
20
|
+
- Avoided setting the Downloader visible flag when the window is not shown.
|
|
21
|
+
|
|
8
22
|
## [2.5.0] - 2026-01-17
|
|
9
23
|
|
|
10
24
|
### Added
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using UnityEngine;
|
|
3
|
+
|
|
4
|
+
namespace KlutterTools.Downloader {
|
|
5
|
+
|
|
6
|
+
public static class AwaitableExtensions
|
|
7
|
+
{
|
|
8
|
+
public static async void Forget(this Awaitable awaitable)
|
|
9
|
+
{
|
|
10
|
+
try
|
|
11
|
+
{
|
|
12
|
+
await awaitable;
|
|
13
|
+
}
|
|
14
|
+
catch (OperationCanceledException)
|
|
15
|
+
{
|
|
16
|
+
}
|
|
17
|
+
catch (Exception e)
|
|
18
|
+
{
|
|
19
|
+
Debug.LogException(e);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
} // namespace KlutterTools.Downloader
|
|
@@ -32,9 +32,35 @@ sealed class DownloaderWindow : EditorWindow
|
|
|
32
32
|
list.bindItem = BindItem;
|
|
33
33
|
list.itemsSource = GlobalManifest.Instance.FileEntries;
|
|
34
34
|
|
|
35
|
+
// Download-all button setup
|
|
36
|
+
var button = doc.Q<Button>("download-all-button");
|
|
37
|
+
button.clicked += () => DownloadAllAsync(list, button).Forget();
|
|
38
|
+
|
|
35
39
|
rootVisualElement.Add(doc);
|
|
36
40
|
}
|
|
37
41
|
|
|
42
|
+
async Awaitable DownloadAllAsync(ListView list, Button button)
|
|
43
|
+
{
|
|
44
|
+
button.enabledSelf = false;
|
|
45
|
+
button.text = "Downloading...";
|
|
46
|
+
try
|
|
47
|
+
{
|
|
48
|
+
foreach (var entry in GlobalManifest.Instance.FileEntries)
|
|
49
|
+
{
|
|
50
|
+
if (entry.CurrentState != FileState.Missing) continue;
|
|
51
|
+
var download = entry.DownloadAsync();
|
|
52
|
+
list.RefreshItems(); // To disable download button
|
|
53
|
+
await download;
|
|
54
|
+
}
|
|
55
|
+
list.RefreshItems();
|
|
56
|
+
AssetDatabase.Refresh();
|
|
57
|
+
}
|
|
58
|
+
finally
|
|
59
|
+
{
|
|
60
|
+
button.text = "Done";
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
38
64
|
// List view item binding
|
|
39
65
|
void BindItem(VisualElement element, int index)
|
|
40
66
|
{
|
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
<ui:VisualElement name="root-container" style="margin-top: 8px; margin-right: 8px; margin-bottom: 8px; margin-left: 8px;">
|
|
3
3
|
<ui:Label text="Some files are missing:" name="caption-label" style="margin-bottom: 8px; white-space: normal;"/>
|
|
4
4
|
<ui:ListView item-template="project://database/Packages/jp.keijiro.klutter-tools/Editor/Downloader/FileEntry.uxml?fileID=9197481963319205126&guid=e5fb5605902c247d8b81f9a365e2b6e4&type=3#FileEntry" binding-source-selection-mode="AutoAssign" name="entry-list"/>
|
|
5
|
+
<ui:Button name="download-all-button" text="Download All" class="toolbar-button" />
|
|
5
6
|
</ui:VisualElement>
|
|
6
7
|
</ui:UXML>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
using System;
|
|
2
2
|
using System.IO;
|
|
3
|
-
using System.Threading.Tasks;
|
|
4
3
|
using Unity.Properties;
|
|
5
4
|
using UnityEngine;
|
|
6
5
|
using UnityEngine.Networking;
|
|
@@ -53,7 +52,7 @@ public sealed class FileEntry
|
|
|
53
52
|
}
|
|
54
53
|
|
|
55
54
|
// Asynchronous file download method
|
|
56
|
-
public async
|
|
55
|
+
public async Awaitable<bool> DownloadAsync()
|
|
57
56
|
{
|
|
58
57
|
var destPath = DestinationPath;
|
|
59
58
|
var tempPath = TemporaryPath;
|
|
@@ -6,11 +6,13 @@ namespace KlutterTools.Downloader {
|
|
|
6
6
|
static class Launcher
|
|
7
7
|
{
|
|
8
8
|
static Launcher()
|
|
9
|
+
=> EditorApplication.delayCall += CheckAndShow;
|
|
10
|
+
|
|
11
|
+
static void CheckAndShow()
|
|
9
12
|
{
|
|
10
13
|
// Session state check
|
|
11
14
|
const string sessionKey = "KlutterTools.Downloader.Shown";
|
|
12
15
|
if (SessionState.GetBool(sessionKey, false)) return;
|
|
13
|
-
SessionState.SetBool(sessionKey, true);
|
|
14
16
|
|
|
15
17
|
// Manifest existence check
|
|
16
18
|
if (GlobalManifest.Instance == null) return;
|
|
@@ -19,7 +21,8 @@ static class Launcher
|
|
|
19
21
|
if (GlobalManifest.Instance.CheckAllDownloaded()) return;
|
|
20
22
|
|
|
21
23
|
// Downloader window open
|
|
22
|
-
|
|
24
|
+
DownloaderWindow.ShowWindow();
|
|
25
|
+
SessionState.SetBool(sessionKey, true);
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
28
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jp.keijiro.klutter-tools",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"displayName": "Klutter Tools",
|
|
5
5
|
"description": "Miscellaneous editor tools.",
|
|
6
6
|
"unity": "6000.0",
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"licensesUrl": "https://github.com/keijiro/KlutterTools/blob/main/LICENSE",
|
|
12
12
|
"license": "Unlicense",
|
|
13
13
|
"_upm": {
|
|
14
|
-
"changelog": "<b>Added</b><br>- Added
|
|
14
|
+
"changelog": "<b>Added</b><br>- Added a Download All button to the Downloader tool."
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
17
|
"url": "git@github.com:keijiro/KlutterTools.git",
|
|
18
18
|
"type": "git",
|
|
19
|
-
"revision": "
|
|
19
|
+
"revision": "62e7014667eb3ad15c8e68a744528e419ceee5d5"
|
|
20
20
|
}
|
|
21
21
|
}
|