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,45 +3,54 @@
"_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": { "comps": {
"cc.Sprite": { "cc.Sprite": {
"spriteFrame": [ "spriteFrame": []
{ }
"frame": 0.016666666666666666, },
"value": { "paths": {
"__uuid__": "095037c3-3d64-4271-9765-3618bf126cfb" "Body": {
} "comps": {
}, "cc.Sprite": {
{ "spriteFrame": [
"frame": 0.5, {
"value": { "frame": 0,
"__uuid__": "b7eb72f8-b83d-46af-8655-1973518a1f6a" "value": {
} "__uuid__": "095037c3-3d64-4271-9765-3618bf126cfb"
}, }
{ },
"frame": 1, {
"value": { "frame": 0.48333333333333334,
"__uuid__": "b4b90137-3a8e-48b8-9faa-ae9b30fa7928" "value": {
} "__uuid__": "b7eb72f8-b83d-46af-8655-1973518a1f6a"
}, }
{ },
"frame": 1.5, {
"value": { "frame": 0.9833333333333333,
"__uuid__": "4a368e85-1e8c-4e15-b64c-2441b5123882" "value": {
} "__uuid__": "b4b90137-3a8e-48b8-9faa-ae9b30fa7928"
}, }
{ },
"frame": 2, {
"value": { "frame": 1.4833333333333334,
"__uuid__": "095037c3-3d64-4271-9765-3618bf126cfb" "value": {
} "__uuid__": "4a368e85-1e8c-4e15-b64c-2441b5123882"
}
},
{
"frame": 1.9833333333333334,
"value": {
"__uuid__": "095037c3-3d64-4271-9765-3618bf126cfb"
}
}
]
} }
] }
} }
} }
}, },