Skip to content

Commit ebca441

Browse files
committed
emitOnly with custom function now sets the correct one.
1 parent 61f222a commit ebca441

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

v3/src/gameobjects/particles/EmitterOp.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var EmitterOp = new Class({
3333

3434
loadConfig: function (config, newKey)
3535
{
36-
if (config === undefined) { config = {} };
36+
if (config === undefined) { config = {}; }
3737

3838
if (newKey)
3939
{
@@ -86,7 +86,7 @@ var EmitterOp = new Class({
8686
}
8787
else if (t === 'function')
8888
{
89-
// The same as setting just the onUpdate function and no onEmit
89+
// The same as setting just the onUpdate function and no onEmit (unless this op is an emitOnly one)
9090
// Custom callback, must return a value:
9191

9292
/*
@@ -96,7 +96,14 @@ var EmitterOp = new Class({
9696
}
9797
*/
9898

99-
this.onUpdate = value;
99+
if (this.emitOnly)
100+
{
101+
this.onEmit = value;
102+
}
103+
else
104+
{
105+
this.onUpdate = value;
106+
}
100107
}
101108
else if (t === 'object' && (this.has(value, 'random') || this.hasBoth(value, 'start', 'end') || this.hasBoth(value, 'min', 'max')))
102109
{

0 commit comments

Comments
 (0)