File tree 1 file changed +21
-1
lines changed
Packages/bullet-storm-unity/Scripts/Runtime/Emitters
1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -29,11 +29,14 @@ public class AutoShapeEmitter : AutoEmitterBase
29
29
[ Tooltip ( "A list where you can config every emission here." ) , ReorderableList , SerializeField ]
30
30
private ShapeConfig [ ] emissions ;
31
31
32
+ [ ShowNativeProperty ]
33
+ private float TotalTime => emissions ? . Aggregate ( 0f , ( f , config ) => f + config . TotalTime ) ?? 0 ;
34
+
32
35
#region reflection use only
33
36
34
37
// ReSharper disable once UnusedMember.Local
35
38
private float EmitTimes =>
36
- emissions ? . Aggregate ( 0 , ( i , config ) => i + ( config . repeat ? config . repeatTimes : 1 ) ) ?? 0 ;
39
+ emissions ? . Aggregate ( 0 , ( i , config ) => i + config . RepeatTimes ) ?? 0 ;
37
40
38
41
#endregion
39
42
@@ -124,6 +127,23 @@ public IReadOnlyList<BulletEmitParam> OverridenShape
124
127
return copy ;
125
128
}
126
129
}
130
+
131
+ public int RepeatTimes => repeat ? repeatTimes : 1 ;
132
+
133
+ public float TotalTime
134
+ {
135
+ get
136
+ {
137
+ var time = 0f ;
138
+ if ( oneByOne && shape )
139
+ {
140
+ time += shape . shape . Count > 0 ? ( shape . shape . Count - 1 ) * interval : 0 ;
141
+ }
142
+ time += wait ;
143
+ time *= RepeatTimes ;
144
+ return time ;
145
+ }
146
+ }
127
147
}
128
148
}
129
149
}
You can’t perform that action at this time.
0 commit comments