Skip to content

Commit 52bd8da

Browse files
committed
feat: load custom emitter particle image
1 parent fcd1f1c commit 52bd8da

87 files changed

Lines changed: 856 additions & 63 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

contributes/meta3d-action-mod-unit-publish-to-game/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "meta3d-action-mod-unit-publish-to-game",
3-
"version": "1.3.49",
3+
"version": "1.3.53",
44
"publisher": "meta3d",
55
"protocol": {
66
"name": "meta3d-action-mod-unit-publish-to-game-protocol"

contributes/meta3d-action-mod-unit-quicktest/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "meta3d-action-mod-unit-quicktest",
3-
"version": "1.3.29",
3+
"version": "1.3.30",
44
"publisher": "meta3d",
55
"protocol": {
66
"name": "meta3d-action-mod-unit-quicktest-protocol"

contributes/meta3d-action-mod-unit-set-emittertype/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "meta3d-action-mod-unit-set-emittertype",
3-
"version": "1.3.4",
3+
"version": "1.3.6",
44
"publisher": "meta3d",
55
"repoLink": "",
66
"protocol": {

contributes/meta3d-action-mod-unit-set-emittertype/src/Main.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { actionContribute, service as editorWholeService } from "meta3d-editor-w
33
import { actionName, state, uiData } from "meta3d-action-mod-unit-set-emittertype-protocol"
44
import { eventName, inputData } from "meta3d-action-mod-unit-set-emittertype-protocol/src/EventType"
55
import { actionName as initActionName, state as initState } from "meta3d-action-mod-unit-init-protocol"
6+
import { actionName as uploadParticleInstanceActionName, state as uploadParticleInstanceState } from "meta3d-action-mod-unit-upload-particle-instance-protocol"
7+
import { actionName as uploadParticleImageActionName, state as uploadParticleImageState } from "meta3d-action-mod-unit-upload-particle-image-protocol"
68

79
export let getContribute: getContributeMeta3D<actionContribute<uiData, state>> = (api) => {
810
return {
@@ -21,6 +23,18 @@ export let getContribute: getContributeMeta3D<actionContribute<uiData, state>> =
2123
[emitterTypeFieldName]: state.allEmitterTypes.get(index)
2224
})
2325

26+
state = api.nullable.getExn(api.action.getActionState<any>(meta3dState, uploadParticleImageActionName))
27+
meta3dState = api.action.setActionState<uploadParticleImageState>(meta3dState, uploadParticleImageActionName, {
28+
...state,
29+
images: state.images.remove(selectedSkillObjectEmitterParticleImageIndexFieldName)
30+
})
31+
32+
state = api.nullable.getExn(api.action.getActionState<any>(meta3dState, uploadParticleInstanceActionName))
33+
meta3dState = api.action.setActionState<uploadParticleInstanceState>(meta3dState, uploadParticleInstanceActionName, {
34+
...state,
35+
instances: state.instances.remove(selectedSkillObjectEmitterInstanceIndexFieldName)
36+
})
37+
2438
return Promise.resolve(meta3dState)
2539
}, (meta3dState) => {
2640
return Promise.resolve(meta3dState)

contributes/meta3d-action-mod-unit-upload-model-snapshot/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "meta3d-action-mod-unit-upload-model-snapshot",
3-
"version": "1.3.7",
3+
"version": "1.3.8",
44
"publisher": "meta3d",
55
"protocol": {
66
"name": "meta3d-action-mod-unit-upload-model-snapshot-protocol"

contributes/meta3d-action-mod-unit-upload-model-snapshot/src/Main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ let _loadSnapshot = (api: api): Promise<base64> => {
2222
console.log(`loading ${loaded / total} %`)
2323
}, () => {
2424
resolve(api.nullable.getEmpty())
25-
}, 1 * 1024 * 1024)
25+
}, 0.5 * 1024 * 1024)
2626
})
2727
}
2828

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
.DS_Store
2+
.merlin
3+
.log
4+
.ninja_log
5+
.cmi
6+
.ast
7+
.cmt
8+
.bsdeps
9+
.compiler.log
10+
11+
.idea/
12+
.vscode/
13+
jest_0/
14+
reference/
15+
node_modules/
16+
mine/
17+
dist/
18+
lib/bs/
19+
.bs.js
20+
.gen.tsx
21+
lib/js/
22+
lib/es6_global/
23+
24+
coverage
25+
26+
dist/
27+
28+
npm-debug
29+
30+
.bsb.lock
31+
32+
yarn.lock
33+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
var gulp = require("gulp");
2+
var path = require("path");
3+
var fs = require("fs");
4+
var publish = require("meta3d-tool-publish")
5+
var bundle = require("meta3d-tool-bundle-to-custom")
6+
var clipboard = require('clipboardy')
7+
8+
gulp.task("publish_local_env_bundle", function (done) {
9+
let filePath = "./src/Main.ts"
10+
11+
let bundleContent = bundle.bundle(
12+
bundle.getLocalModulePath(
13+
filePath
14+
),
15+
fs.readFileSync(filePath, "utf-8")
16+
)
17+
18+
let clipedBundleContent = `import { api } from "meta3d-type"
19+
import { service as editorWholeService } from "meta3d-editor-whole-protocol/src/service/ServiceType"
20+
` + bundleContent
21+
clipedBundleContent = clipedBundleContent.replace(/getContribute\s\=\s\(api\)/g, "getContribute = (api:api)")
22+
23+
clipboard.default.writeSync(
24+
clipedBundleContent
25+
)
26+
27+
28+
29+
publish.publishBundledContribute(
30+
"local",
31+
path.join(__dirname, "package.json"),
32+
bundleContent
33+
).then(() => {
34+
done()
35+
})
36+
});
37+
38+
39+
40+
// gulp.task("publish_local_env", function (done) {
41+
// publish.publishContribute(
42+
// "local",
43+
// path.join(__dirname, "package.json"),
44+
// path.join(__dirname, "dist/static/js", "main.js")
45+
// ).then(() => {
46+
// done()
47+
// })
48+
// });
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// declare module 'asset-loader!*' {
2+
// // const contents: { default: string }
3+
// const contents: string
4+
// // const contents: ArrayBuffer
5+
// export = contents
6+
// }
7+
8+
declare module '*' {
9+
// const contents: { default: string }
10+
const contents: string
11+
// const contents: ArrayBuffer
12+
export = contents
13+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "meta3d-action-mod-unit-upload-particle-image",
3+
"version": "1.3.2",
4+
"publisher": "meta3d",
5+
"protocol": {
6+
"name": "meta3d-action-mod-unit-upload-particle-image-protocol"
7+
},
8+
"license": "MIT",
9+
"scripts": {
10+
"watch": "tsc -w -noEmit",
11+
"webpack": "webpack --config webpack.config.js",
12+
"meta3d:publish_dev_auto": "yarn version --patch --no-git-tag-version && yarn meta3d:publish_dev",
13+
"meta3d:publish_dev": "cross-env NODE_ENV=development npm run webpack && gulp publish_local_env_bundle"
14+
},
15+
"keywords": [],
16+
"dependencies": {
17+
"meta3d-action-mod-unit-upload-particle-image-protocol": "^1.3.0",
18+
"meta3d-editor-whole-protocol": "^1.3.0",
19+
"meta3d-type": "^1.3.0"
20+
},
21+
"devDependencies": {
22+
"clean-webpack-plugin": "^4.0.0",
23+
"clipboardy": "^5.0.2",
24+
"cross-env": "^7.0.3",
25+
"cz-customizable": "^6.3.0",
26+
"gulp": "^4.0.2",
27+
"meta3d-tool-publish": "^1.3.0",
28+
"source-map-loader": "^3.0.0",
29+
"ts-loader": "^9.2.6",
30+
"typescript": "^5.1.0",
31+
"webpack": "^5.62.1",
32+
"webpack-cli": "^4.9.1"
33+
}
34+
}

0 commit comments

Comments
 (0)