mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[ts][pixi-v7][pixi-v8] Fix multiple autoUpdate calls setting multiple tickers.
This commit is contained in:
parent
e2bd01aef0
commit
97d2667818
@ -297,15 +297,15 @@ export class Spine extends Container {
|
|||||||
beforeUpdateWorldTransforms: (object: Spine) => void = () => { };
|
beforeUpdateWorldTransforms: (object: Spine) => void = () => { };
|
||||||
afterUpdateWorldTransforms: (object: Spine) => void = () => { };
|
afterUpdateWorldTransforms: (object: Spine) => void = () => { };
|
||||||
|
|
||||||
private _autoUpdate: boolean = true;
|
private _autoUpdate: boolean = false;
|
||||||
public get autoUpdate (): boolean {
|
public get autoUpdate (): boolean {
|
||||||
return this._autoUpdate;
|
return this._autoUpdate;
|
||||||
}
|
}
|
||||||
/** When `true`, the Spine AnimationState and the Skeleton will be automatically updated using the {@link Ticker.shared} instance. */
|
/** When `true`, the Spine AnimationState and the Skeleton will be automatically updated using the {@link Ticker.shared} instance. */
|
||||||
public set autoUpdate (value: boolean) {
|
public set autoUpdate (value: boolean) {
|
||||||
if (value) {
|
if (value && !this._autoUpdate) {
|
||||||
Ticker.shared.add(this.internalUpdate, this);
|
Ticker.shared.add(this.internalUpdate, this);
|
||||||
} else {
|
} else if (!value && this._autoUpdate) {
|
||||||
Ticker.shared.remove(this.internalUpdate, this);
|
Ticker.shared.remove(this.internalUpdate, this);
|
||||||
}
|
}
|
||||||
this._autoUpdate = value;
|
this._autoUpdate = value;
|
||||||
|
|||||||
@ -351,16 +351,16 @@ export class Spine extends ViewContainer {
|
|||||||
this._debug = value;
|
this._debug = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _autoUpdate = true;
|
private _autoUpdate = false;
|
||||||
|
|
||||||
public get autoUpdate (): boolean {
|
public get autoUpdate (): boolean {
|
||||||
return this._autoUpdate;
|
return this._autoUpdate;
|
||||||
}
|
}
|
||||||
/** When `true`, the Spine AnimationState and the Skeleton will be automatically updated using the {@link Ticker.shared} instance. */
|
/** When `true`, the Spine AnimationState and the Skeleton will be automatically updated using the {@link Ticker.shared} instance. */
|
||||||
public set autoUpdate (value: boolean) {
|
public set autoUpdate (value: boolean) {
|
||||||
if (value) {
|
if (value && !this._autoUpdate) {
|
||||||
Ticker.shared.add(this.internalUpdate, this);
|
Ticker.shared.add(this.internalUpdate, this);
|
||||||
} else {
|
} else if (!value && this._autoUpdate) {
|
||||||
Ticker.shared.remove(this.internalUpdate, this);
|
Ticker.shared.remove(this.internalUpdate, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user