mirror of
				https://github.com/szrpf/ActionShadowDemo.git
				synced 2025-10-30 19:05:42 +00:00 
			
		
		
		
	Signed-off-by: szrpf <27185709@qq.com>
This commit is contained in:
		
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -86,12 +86,15 @@ export default class ActionShadow extends cc.Component { | ||||
|     private shadowData: ShadowData[] = []; | ||||
|  | ||||
|     protected start() { | ||||
|         let shadowNodeName = 'ActionShadow_' + this.node.name; | ||||
|         let shadowNodeName = this.node.name + '<ActionShadow>'; | ||||
|         this.shadowNode = this.node.parent.getChildByName(shadowNodeName) | ||||
|         if (!this.shadowNode) { | ||||
|             this.shadowNode = new cc.Node(shadowNodeName); | ||||
|             this.shadowNode.setParent(this.node.parent); | ||||
|             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'].LockedInEditor; | ||||
|         } | ||||
| @@ -163,7 +166,7 @@ export default class ActionShadow extends cc.Component { | ||||
|         this.shadowNode.destroyAllChildren(); | ||||
|         for (let i = 0, len = this.shadowNum; i < len; ++i) { | ||||
|             let node = cc.instantiate(this.node); | ||||
|             node.name = 'Shadow' + i; | ||||
|             node.name = `${this.node.name}${i}`; | ||||
|             let cmps = node['_components']; | ||||
|             for (let j = cmps.length - 1; j >= 0; --j) { | ||||
|                 if (cmps[j] instanceof cc.RenderComponent) continue; | ||||
|   | ||||
| @@ -3,45 +3,54 @@ | ||||
|   "_name": "Enemy", | ||||
|   "_objFlags": 0, | ||||
|   "_native": "", | ||||
|   "_duration": 2.0166666666666666, | ||||
|   "_duration": 2, | ||||
|   "sample": 60, | ||||
|   "speed": 1, | ||||
|   "wrapMode": 2, | ||||
|   "curveData": { | ||||
|     "comps": { | ||||
|       "cc.Sprite": { | ||||
|         "spriteFrame": [ | ||||
|           { | ||||
|             "frame": 0.016666666666666666, | ||||
|             "value": { | ||||
|               "__uuid__": "095037c3-3d64-4271-9765-3618bf126cfb" | ||||
|             } | ||||
|           }, | ||||
|           { | ||||
|             "frame": 0.5, | ||||
|             "value": { | ||||
|               "__uuid__": "b7eb72f8-b83d-46af-8655-1973518a1f6a" | ||||
|             } | ||||
|           }, | ||||
|           { | ||||
|             "frame": 1, | ||||
|             "value": { | ||||
|               "__uuid__": "b4b90137-3a8e-48b8-9faa-ae9b30fa7928" | ||||
|             } | ||||
|           }, | ||||
|           { | ||||
|             "frame": 1.5, | ||||
|             "value": { | ||||
|               "__uuid__": "4a368e85-1e8c-4e15-b64c-2441b5123882" | ||||
|             } | ||||
|           }, | ||||
|           { | ||||
|             "frame": 2, | ||||
|             "value": { | ||||
|               "__uuid__": "095037c3-3d64-4271-9765-3618bf126cfb" | ||||
|             } | ||||
|         "spriteFrame": [] | ||||
|       } | ||||
|     }, | ||||
|     "paths": { | ||||
|       "Body": { | ||||
|         "comps": { | ||||
|           "cc.Sprite": { | ||||
|             "spriteFrame": [ | ||||
|               { | ||||
|                 "frame": 0, | ||||
|                 "value": { | ||||
|                   "__uuid__": "095037c3-3d64-4271-9765-3618bf126cfb" | ||||
|                 } | ||||
|               }, | ||||
|               { | ||||
|                 "frame": 0.48333333333333334, | ||||
|                 "value": { | ||||
|                   "__uuid__": "b7eb72f8-b83d-46af-8655-1973518a1f6a" | ||||
|                 } | ||||
|               }, | ||||
|               { | ||||
|                 "frame": 0.9833333333333333, | ||||
|                 "value": { | ||||
|                   "__uuid__": "b4b90137-3a8e-48b8-9faa-ae9b30fa7928" | ||||
|                 } | ||||
|               }, | ||||
|               { | ||||
|                 "frame": 1.4833333333333334, | ||||
|                 "value": { | ||||
|                   "__uuid__": "4a368e85-1e8c-4e15-b64c-2441b5123882" | ||||
|                 } | ||||
|               }, | ||||
|               { | ||||
|                 "frame": 1.9833333333333334, | ||||
|                 "value": { | ||||
|                   "__uuid__": "095037c3-3d64-4271-9765-3618bf126cfb" | ||||
|                 } | ||||
|               } | ||||
|             ] | ||||
|           } | ||||
|         ] | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|   }, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user