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