Skip to content

Commit

Permalink
shader graph depend new version change to 3.8.3 (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
knoxHuang authored Dec 6, 2023
1 parent 7d190a6 commit 9a1f4bd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion extensions/shader-graph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
},
"devDependencies": {
"@editor/asset-db": "2.7.0",
"@editor/library-type": "3.9.0-90615",
"@types/adm-zip": "^0.5.4",
"@types/fs-extra": "^9.0.5",
"@types/node": "^16.0.1",
Expand Down
4 changes: 2 additions & 2 deletions extensions/shader-graph/src/effect-utils.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { gte } from 'semver';

export async function buildEffect(name: string, content: string) {
if (gte(Editor.App.version, '3.9.0')) {
if (gte(Editor.App.version, '3.8.3')) {
return await Editor.Message.request('asset-db', 'execute-custom-operation', 'effect', 'build-effect', name, content);
} else {
return await Editor.Message.request('engine-extends', 'build-effect', name, content);
}
}

export async function addChunk(name: string, content: string) {
if (gte(Editor.App.version, '3.9.0')) {
if (gte(Editor.App.version, '3.8.3')) {
await Editor.Message.request('asset-db', 'execute-custom-operation', 'effect', 'add-chunk', name, content);
} else {
return await Editor.Message.request('engine-extends', 'add-chunk', name, content);
Expand Down
4 changes: 2 additions & 2 deletions extensions/shader-graph/src/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { gte } from 'semver';
*/
exports.register = async function(info: { [key: string]: any}) {
const version = Editor.App.version;
// 3.9.0 使用新版本的添加菜单方式,移除旧的方式
if (gte(version, '3.9.0')) {
// 3.8.3 使用新版本的添加菜单方式,移除旧的方式
if (gte(version, '3.8.3')) {
delete info.contributions.assets.menu;
}
};

0 comments on commit 9a1f4bd

Please sign in to comment.