File tree Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Original file line number Diff line number Diff line change 52
52
53
53
id action = [CCActionRemove action];
54
54
*/
55
- @interface CCActionRemove : CCActionInstant
55
+ @interface CCActionRemove : CCActionInstant {
56
+ BOOL _cleanUp;
57
+ }
58
+
59
+ +(id )action ;
60
+ +(id )actionWithCleanUp : (BOOL )cleanup ;
56
61
57
62
@end
58
63
Original file line number Diff line number Diff line change @@ -81,8 +81,35 @@ -(CCActionFiniteTime*) reverse
81
81
82
82
@implementation CCActionRemove
83
83
84
+ +(id )action {
85
+ return [[self alloc ] init ];
86
+ }
87
+
88
+ +(id )actionWithCleanUp : (BOOL )cleanup {
89
+ return [[self alloc ] initWithCleanUp: cleanup];
90
+ }
91
+
92
+ -(id )init {
93
+ self = [super init ];
94
+ if (!self) return nil ;
95
+
96
+ _cleanUp = true ;
97
+
98
+ return self;
99
+ }
100
+
101
+ -(id )initWithCleanUp : (BOOL )cleanUp {
102
+ self = [super init ];
103
+ if (!self) return nil ;
104
+
105
+ _cleanUp = cleanUp;
106
+
107
+ return self;
108
+ }
109
+
110
+
84
111
-(void ) update : (CCTime)time {
85
- [(CCNode *)_target removeFromParent ];
112
+ [(CCNode *)_target removeFromParentAndCleanup: _cleanUp ];
86
113
}
87
114
@end
88
115
You can’t perform that action at this time.
0 commit comments