Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add dependency map #2476

Open
wants to merge 27 commits into
base: dev/1.4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c3b2aef
fix(pick): fix pick not avalid for sprite renderer
singlecoder Aug 17, 2022
e82a3fc
fix(pick): fix pick not valid for sprite renderer
singlecoder Aug 17, 2022
ba86d40
fix(pick): opt code
singlecoder Aug 17, 2022
880cb70
fix(pick): opt code
singlecoder Aug 17, 2022
de6f83c
Merge branch 'main' of https://github.com/oasis-engine/engine
singlecoder Aug 17, 2022
97a13a7
Merge branch 'main' of https://github.com/oasis-engine/engine
singlecoder Aug 19, 2022
5d0f426
Merge branch 'main' of https://github.com/oasis-engine/engine
singlecoder Aug 22, 2022
5e7d7ab
Merge branch 'main' of https://github.com/oasis-engine/engine
singlecoder Sep 7, 2022
d10530b
fix(text): fix set font size not valid error
singlecoder Sep 7, 2022
8ca3c9c
refactor: opt code (#5)
GuoLei1990 Sep 8, 2022
98042c1
merge
johanzhu Oct 26, 2024
1130b13
Merge branch 'main' of https://github.com/galacean/engine
Nov 27, 2024
94b7be4
feat: merge
Dec 4, 2024
f5a51b0
Merge branch 'dev/1.4' of https://github.com/galacean/engine into dev…
Dec 13, 2024
5bf17b3
Merge branch 'dev/1.4' of https://github.com/galacean/engine into dev…
Dec 19, 2024
f739fcf
Merge branch 'dev/1.4' of https://github.com/galacean/engine into dev…
Dec 24, 2024
8a9a2e2
feat: add dep
Dec 24, 2024
8de27d3
feat: add dep
Dec 24, 2024
a6eb435
feat: fix lint
Dec 25, 2024
ff7ca78
feat: fix lint
Dec 25, 2024
d79fd47
feat: fix lint
Dec 25, 2024
c534e51
feat: delete console
Dec 25, 2024
5174b59
Merge branch 'dev/1.4' of https://github.com/galacean/engine into fea…
Dec 26, 2024
b54f336
feat: fix cr problem
Dec 26, 2024
6b1c196
feat: fix cr problem
Dec 26, 2024
9a413e6
feat: fix cr problem
Dec 26, 2024
4155cc1
feat: change name
Dec 26, 2024
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"vitest": "2.1.3"
},
"lint-staged": {
"*.{ts}": [
"*.{ts,tsx}": [
"eslint --fix",
"git add"
]
Expand Down
13 changes: 12 additions & 1 deletion packages/core/src/asset/ResourceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,8 @@
_editorResourceConfig: EditorResourceConfig = Object.create(null);
/** @internal */
_virtualPathMap: Record<string, string> = Object.create(null);
/** @internal */
_dependencyMap: Record<string, { [key: string]: string }> = Object.create(null);

/**
* @internal
Expand Down Expand Up @@ -594,6 +596,9 @@
config.forEach((element) => {
this._virtualPathMap[element.virtualPath] = element.path;
this._editorResourceConfig[element.id] = element;
if (element.dependentAssetMap) {
this._dependencyMap[element.virtualPath] = element.dependentAssetMap;
}

Check warning on line 601 in packages/core/src/asset/ResourceManager.ts

View check run for this annotation

Codecov / codecov/patch

packages/core/src/asset/ResourceManager.ts#L600-L601

Added lines #L600 - L601 were not covered by tests
});
}
//-----------------Editor temp solution-----------------
Expand Down Expand Up @@ -631,7 +636,13 @@
"g"
);

type EditorResourceItem = { virtualPath: string; path: string; type: string; id: string };
type EditorResourceItem = {
virtualPath: string;
path: string;
type: string;
id: string;
dependentAssetMap: { [key: string]: string };
};
type EditorResourceConfig = Record<string, EditorResourceItem>;
type SubAssetPromiseCallbacks<T> = Record<
// main asset url, ie. "https://***.glb"
Expand Down
Loading