Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# UnityExtractor
<div align="center">

![LOGO](./src-tauri/icons/128x128.png)


A Unity asset extractor base on `Tauri` + `Vue` + `Vuetify`

Make All Asset Extract action in **ONE** App
Making All Asset Extract action in **ONE** App
</div>


## App current appearance

![Main Page](./preview/preview-main.png)
![Preview Page](./preview/preview-preview.png)
| MainPage | Preview |
| :------: | :-----: |
| ![Main Page](./preview/preview-main.png) | ![Preview Page](./preview/preview-preview.png) |

## Feature

Expand Down
7 changes: 4 additions & 3 deletions description.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## UnityExtractor v0.1.2
# UnityExtractor v0.1.3

## :bug: Bug Fix
## :sparkles: What's new

- fix: preview image overflow
- using New Logo
- support drag file to loading (only load file)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "unity-extractor",
"version": "0.1.2",
"version": "0.1.3",
"private": true,
"scripts": {
"serve": "vite preview",
Expand Down
Binary file modified preview/preview-main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified preview/preview-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
185 changes: 185 additions & 0 deletions rust-unity.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "unity-extractor"
version = "0.1.2"
version = "0.1.3"
description = "A Tauri App"
authors = ["FrozenString<frozenstringstable@gmail.com>"]
license-file = "../LICENSE"
Expand Down
Binary file modified src-tauri/icons/128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/128x128@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square107x107Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square142x142Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square150x150Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square284x284Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square30x30Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square310x310Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square44x44Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square71x71Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square89x89Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/StoreLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/icon.icns
Binary file not shown.
Binary file modified src-tauri/icons/icon.ico
Binary file not shown.
Binary file modified src-tauri/icons/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 11 additions & 5 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
mod preview;
mod unity;

use tauri::{AppHandle, Manager, WindowEvent::CloseRequested};
use tauri::{AppHandle, Manager, WindowEvent::{CloseRequested, self}, async_runtime};

// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
#[tauri::command]
fn greet(name: &str) -> String {
format!("Hello, {}! You've been greeted from Rust!", name)
}
use preview::{preview_image, preview_text};
use unity::{load_unity_asset, preview_object};
use unity::{load_unity_asset, preview_object, dropped_unity_asset};

use crate::unity::{export_bundle, export_file_type, export_object, sync_loaded_asset};

Expand All @@ -33,9 +33,15 @@ fn main() {
let windows = app.get_window("main").expect("Main windows not found");
let app_handle = app.app_handle();
windows.on_window_event(move |event| {
if let CloseRequested { api, .. } = event {
api.prevent_close();
app_handle.exit(0)
match event {
CloseRequested { api, .. } => {
api.prevent_close();
app_handle.exit(0)
}
WindowEvent::FileDrop(tauri::FileDropEvent::Dropped(paths)) => {
async_runtime::spawn(dropped_unity_asset(app_handle.clone(), paths.clone()));
},
_ => (),
}
});
#[cfg(debug_assertions)]
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/unity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ fn get_opened_unity_asset() -> &'static DashMap<Uuid, StoreUnityBundle> {

pub use commands::{
export_bundle, export_file_type, export_object, load_unity_asset, preview_object,
sync_loaded_asset,
sync_loaded_asset,dropped_unity_asset
};
2 changes: 1 addition & 1 deletion src-tauri/src/unity/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ mod import;
mod preview;

pub use export::{export_bundle, export_file_type, export_object};
pub use import::{load_unity_asset, sync_loaded_asset};
pub use import::{load_unity_asset, sync_loaded_asset,dropped_unity_asset};
pub use preview::preview_object;
20 changes: 19 additions & 1 deletion src-tauri/src/unity/commands/import.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::path::PathBuf;

use tauri::{command, AppHandle};
use tauri::{command, AppHandle, Manager};
use uuid::Uuid;

use crate::{
Expand All @@ -12,6 +12,8 @@ use crate::{
},
};

const LOAD_ASSET_DONE: &str = "unity-bundle-load-done";

#[command(async)]
pub async fn load_unity_asset(app: AppHandle, path: String) -> UnityResult<UnityAsset> {
let key = Uuid::new_v5(&Uuid::NAMESPACE_OID, path.as_bytes());
Expand All @@ -33,6 +35,22 @@ pub async fn load_unity_asset(app: AppHandle, path: String) -> UnityResult<Unity
loading_done(app)?;
Ok(asset)
}

pub async fn dropped_unity_asset(app: AppHandle, paths: Vec<PathBuf>) -> UnityResult<()> {
app.emit_all("loading", true)?;
let mut result = Vec::new();
for path in paths.into_iter().filter(|path| path.is_file()) {
let Some(path) = path.as_os_str().to_str() else{
continue;
};
if let Ok(ua) = load_unity_asset(app.clone(), path.to_string()).await {
result.push(ua)
}
}
app.emit_to("main", LOAD_ASSET_DONE, result)?;
Ok(())
}

#[command]
pub fn sync_loaded_asset() -> Vec<UnityAsset> {
get_opened_unity_asset()
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"withGlobalTauri": false
},
"package": {
"productName": "unity-extractor",
"version": "0.1.2"
"productName": "UnityExtractor",
"version": "0.1.3"
},
"tauri": {
"allowlist": {
Expand Down
21 changes: 20 additions & 1 deletion src/components/MainPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { ref } from "vue";
import { BtnDefine } from "../tauri_pack/pack.ts";
import TopBtnBar from "./TopBtnBar.vue";
import ExpandableList from "./ExpandableList.vue";
import { openOneFile } from "../tauri_pack/pack";
import { loadDone, openOneFile } from "../tauri_pack/pack";
import {
loadUnityAsset,
syncLoadedAsset,
Expand Down Expand Up @@ -76,19 +76,38 @@ const buttons: BtnDefine[] = [
];

const unliten = ref<UnlistenFn | null>();
const unLitenAsset = ref<UnlistenFn | null>();
onMounted(async () => {
unliten.value = await listen<boolean>(
"loading",
({ payload }: { payload: boolean }) => {
loading.value = payload;
}
);

unLitenAsset.value = await listen<UnityAsset[]>(
"unity-bundle-load-done",
({ payload }: { payload: UnityAsset[] }) => {
payload.forEach((element) => {
let idx = unityAsset.value.findIndex(
(value: UnityAsset) => value.id == element.id
);
if (idx == -1) {
unityAsset.value.push(element);
}
});
loadDone();
}
);
});

onUnmounted(() => {
if (unliten.value) {
unliten.value();
}
if (unLitenAsset.value) {
unLitenAsset.value();
}
});
</script>

Expand Down