playcanvas
Version:
PlayCanvas WebGL game engine
42 lines (40 loc) • 1.05 kB
JavaScript
class AnimTarget {
constructor(func, type, components, targetPath){
if (func.set) {
this._set = func.set;
this._get = func.get;
} else {
this._set = func;
}
this._type = type;
this._components = components;
this._targetPath = targetPath;
this._isTransform = this._targetPath.substring(this._targetPath.length - 13) === 'localRotation' || this._targetPath.substring(this._targetPath.length - 13) === 'localPosition' || this._targetPath.substring(this._targetPath.length - 10) === 'localScale';
this._isWeight = this._targetPath.indexOf('weight.') !== -1;
}
get set() {
return this._set;
}
get get() {
return this._get;
}
get type() {
return this._type;
}
get components() {
return this._components;
}
get targetPath() {
return this._targetPath;
}
get isTransform() {
return this._isTransform;
}
get isWeight() {
return this._isWeight;
}
get usesLayerBlending() {
return this._isTransform || this._isWeight;
}
}
export { AnimTarget };