Signed-off-by: szrpf <27185709@qq.com>

This commit is contained in:
szrpf 2023-05-16 00:17:11 +08:00
parent f7758b7952
commit febbc662f0
3 changed files with 1975 additions and 1208 deletions

File diff suppressed because it is too large Load Diff

View File

@ -86,12 +86,15 @@ export default class ActionShadow extends cc.Component {
private shadowData: ShadowData[] = []; private shadowData: ShadowData[] = [];
protected start() { protected start() {
let shadowNodeName = 'ActionShadow_' + this.node.name; let shadowNodeName = this.node.name + '<ActionShadow>';
this.shadowNode = this.node.parent.getChildByName(shadowNodeName) this.shadowNode = this.node.parent.getChildByName(shadowNodeName)
if (!this.shadowNode) { if (!this.shadowNode) {
this.shadowNode = new cc.Node(shadowNodeName); this.shadowNode = new cc.Node(shadowNodeName);
this.shadowNode.setParent(this.node.parent); this.shadowNode.setParent(this.node.parent);
this.shadowNode.setSiblingIndex(this.node.getSiblingIndex()); this.shadowNode.setSiblingIndex(this.node.getSiblingIndex());
}
if (CC_EDITOR) {
this.shadowNode['_objFlags'] = 0;
this.shadowNode['_objFlags'] |= cc.Object['Flags'].HideInHierarchy; this.shadowNode['_objFlags'] |= cc.Object['Flags'].HideInHierarchy;
this.shadowNode['_objFlags'] |= cc.Object['Flags'].LockedInEditor; this.shadowNode['_objFlags'] |= cc.Object['Flags'].LockedInEditor;
} }
@ -163,7 +166,7 @@ export default class ActionShadow extends cc.Component {
this.shadowNode.destroyAllChildren(); this.shadowNode.destroyAllChildren();
for (let i = 0, len = this.shadowNum; i < len; ++i) { for (let i = 0, len = this.shadowNum; i < len; ++i) {
let node = cc.instantiate(this.node); let node = cc.instantiate(this.node);
node.name = 'Shadow' + i; node.name = `${this.node.name}${i}`;
let cmps = node['_components']; let cmps = node['_components'];
for (let j = cmps.length - 1; j >= 0; --j) { for (let j = cmps.length - 1; j >= 0; --j) {
if (cmps[j] instanceof cc.RenderComponent) continue; if (cmps[j] instanceof cc.RenderComponent) continue;

View File

@ -3,40 +3,47 @@
"_name": "Enemy", "_name": "Enemy",
"_objFlags": 0, "_objFlags": 0,
"_native": "", "_native": "",
"_duration": 2.0166666666666666, "_duration": 2,
"sample": 60, "sample": 60,
"speed": 1, "speed": 1,
"wrapMode": 2, "wrapMode": 2,
"curveData": { "curveData": {
"comps": {
"cc.Sprite": {
"spriteFrame": []
}
},
"paths": {
"Body": {
"comps": { "comps": {
"cc.Sprite": { "cc.Sprite": {
"spriteFrame": [ "spriteFrame": [
{ {
"frame": 0.016666666666666666, "frame": 0,
"value": { "value": {
"__uuid__": "095037c3-3d64-4271-9765-3618bf126cfb" "__uuid__": "095037c3-3d64-4271-9765-3618bf126cfb"
} }
}, },
{ {
"frame": 0.5, "frame": 0.48333333333333334,
"value": { "value": {
"__uuid__": "b7eb72f8-b83d-46af-8655-1973518a1f6a" "__uuid__": "b7eb72f8-b83d-46af-8655-1973518a1f6a"
} }
}, },
{ {
"frame": 1, "frame": 0.9833333333333333,
"value": { "value": {
"__uuid__": "b4b90137-3a8e-48b8-9faa-ae9b30fa7928" "__uuid__": "b4b90137-3a8e-48b8-9faa-ae9b30fa7928"
} }
}, },
{ {
"frame": 1.5, "frame": 1.4833333333333334,
"value": { "value": {
"__uuid__": "4a368e85-1e8c-4e15-b64c-2441b5123882" "__uuid__": "4a368e85-1e8c-4e15-b64c-2441b5123882"
} }
}, },
{ {
"frame": 2, "frame": 1.9833333333333334,
"value": { "value": {
"__uuid__": "095037c3-3d64-4271-9765-3618bf126cfb" "__uuid__": "095037c3-3d64-4271-9765-3618bf126cfb"
} }
@ -44,6 +51,8 @@
] ]
} }
} }
}
}
}, },
"events": [] "events": []
} }