diff --git a/packages/core/src/particle/modules/ParticleGradient.ts b/packages/core/src/particle/modules/ParticleGradient.ts index 03c055c3d6..717c58f6a1 100644 --- a/packages/core/src/particle/modules/ParticleGradient.ts +++ b/packages/core/src/particle/modules/ParticleGradient.ts @@ -245,7 +245,7 @@ export class GradientColorKey { set time(value: number) { this._time = value; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); } /** @@ -293,7 +293,7 @@ export class GradientAlphaKey { set time(value: number) { this._time = value; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); } /** @@ -305,7 +305,7 @@ export class GradientAlphaKey { set alpha(value: number) { this._alpha = value; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); } /** diff --git a/packages/math/src/Color.ts b/packages/math/src/Color.ts index cb67fa1c26..4e7f40b5d9 100644 --- a/packages/math/src/Color.ts +++ b/packages/math/src/Color.ts @@ -63,7 +63,7 @@ export class Color implements IClone, ICopy { out._g = left._g + right._g; out._b = left._b + right._b; out._a = left._a + right._a; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); return out; } @@ -79,7 +79,7 @@ export class Color implements IClone, ICopy { out._g = left._g - right._g; out._b = left._b - right._b; out._a = left._a - right._a; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -94,7 +94,7 @@ export class Color implements IClone, ICopy { out._g = left._g * s; out._b = left._b * s; out._a = left._a * s; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); return out; } @@ -112,7 +112,7 @@ export class Color implements IClone, ICopy { out._g = _g + (end._g - _g) * t; out._b = _b + (end._b - _b) * t; out._a = _a + (end._a - _a) * t; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); return out; } @@ -137,7 +137,7 @@ export class Color implements IClone, ICopy { public set r(value: number) { this._r = value; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); } /** @@ -149,7 +149,7 @@ export class Color implements IClone, ICopy { public set g(value: number) { this._g = value; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); } /** @@ -161,7 +161,7 @@ export class Color implements IClone, ICopy { public set b(value: number) { this._b = value; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); } /** @@ -173,7 +173,7 @@ export class Color implements IClone, ICopy { public set a(value: number) { this._a = value; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); } /** @@ -203,7 +203,7 @@ export class Color implements IClone, ICopy { this._g = g; this._b = b; this._a = a; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -217,7 +217,7 @@ export class Color implements IClone, ICopy { this._g += color._g; this._b += color._b; this._a += color._a; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -231,7 +231,7 @@ export class Color implements IClone, ICopy { this._g *= s; this._b *= s; this._a *= s; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -254,7 +254,7 @@ export class Color implements IClone, ICopy { this._g = source.g; this._b = source.b; this._a = source.a; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -282,7 +282,7 @@ export class Color implements IClone, ICopy { this._g = source[offset + 1]; this._b = source[offset + 2]; this._a = source[offset + 3]; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -307,7 +307,7 @@ export class Color implements IClone, ICopy { out._r = Color.gammaToLinearSpace(this._r); out._g = Color.gammaToLinearSpace(this._g); out._b = Color.gammaToLinearSpace(this._b); - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); return out; } @@ -320,7 +320,7 @@ export class Color implements IClone, ICopy { out._r = Color.linearToGammaSpace(this._r); out._g = Color.linearToGammaSpace(this._g); out._b = Color.linearToGammaSpace(this._b); - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); return out; } diff --git a/packages/math/src/Matrix.ts b/packages/math/src/Matrix.ts index 8be087a654..92afa3f79e 100644 --- a/packages/math/src/Matrix.ts +++ b/packages/math/src/Matrix.ts @@ -1066,7 +1066,7 @@ export class Matrix implements IClone, ICopy { out._z = 0.25 * s; } - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); return out; } diff --git a/packages/math/src/Quaternion.ts b/packages/math/src/Quaternion.ts index 112dcc12db..e87669c1c7 100644 --- a/packages/math/src/Quaternion.ts +++ b/packages/math/src/Quaternion.ts @@ -24,7 +24,7 @@ export class Quaternion implements IClone, ICopy, ICopy, ICopy, ICopy, ICopy, ICopy, ICopy, ICopy, ICopy, ICopy, ICopy, ICopy, ICopy, ICopy, ICopy, ICopy, ICopy, ICopy, ICopy, ICopy, ICopy, ICopy, ICopy, ICopy, ICopy, ICopy, ICopy, ICopy { set x(value: number) { this._x = value; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); } /** @@ -35,7 +35,7 @@ export class Rect implements IClone, ICopy { set y(value: number) { this._y = value; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); } /** @@ -47,7 +47,7 @@ export class Rect implements IClone, ICopy { set width(value: number) { this._width = value; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); } /** @@ -59,7 +59,7 @@ export class Rect implements IClone, ICopy { set height(value: number) { this._height = value; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); } /** @@ -89,7 +89,7 @@ export class Rect implements IClone, ICopy { this._y = y; this._width = width; this._height = height; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -111,7 +111,7 @@ export class Rect implements IClone, ICopy { this._y = source.y; this._width = source.width; this._height = source.height; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } } diff --git a/packages/math/src/Vector2.ts b/packages/math/src/Vector2.ts index 61670830ea..5d6de38a98 100644 --- a/packages/math/src/Vector2.ts +++ b/packages/math/src/Vector2.ts @@ -20,7 +20,7 @@ export class Vector2 implements IClone, ICopy { static add(left: Vector2, right: Vector2, out: Vector2): void { out._x = left._x + right._x; out._y = left._y + right._y; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -32,7 +32,7 @@ export class Vector2 implements IClone, ICopy { static subtract(left: Vector2, right: Vector2, out: Vector2): void { out._x = left._x - right._x; out._y = left._y - right._y; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -44,7 +44,7 @@ export class Vector2 implements IClone, ICopy { static multiply(left: Vector2, right: Vector2, out: Vector2): void { out._x = left._x * right._x; out._y = left._y * right._y; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -56,7 +56,7 @@ export class Vector2 implements IClone, ICopy { static divide(left: Vector2, right: Vector2, out: Vector2): void { out._x = left._x / right._x; out._y = left._y / right._y; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -114,7 +114,7 @@ export class Vector2 implements IClone, ICopy { const { _x, _y } = left; out._x = _x + (right._x - _x) * t; out._y = _y + (right._y - _y) * t; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -126,7 +126,7 @@ export class Vector2 implements IClone, ICopy { static max(left: Vector2, right: Vector2, out: Vector2): void { out._x = Math.max(left._x, right._x); out._y = Math.max(left._y, right._y); - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -138,7 +138,7 @@ export class Vector2 implements IClone, ICopy { static min(left: Vector2, right: Vector2, out: Vector2): void { out._x = Math.min(left._x, right._x); out._y = Math.min(left._y, right._y); - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -149,7 +149,7 @@ export class Vector2 implements IClone, ICopy { static negate(left: Vector2, out: Vector2): void { out._x = -left._x; out._y = -left._y; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -164,7 +164,7 @@ export class Vector2 implements IClone, ICopy { len = 1 / len; out._x = _x * len; out._y = _y * len; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } } @@ -177,7 +177,7 @@ export class Vector2 implements IClone, ICopy { static scale(left: Vector2, s: number, out: Vector2): void { out._x = left._x * s; out._y = left._y * s; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @internal */ @@ -196,7 +196,7 @@ export class Vector2 implements IClone, ICopy { public set x(value: number) { this._x = value; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); } /** @@ -208,7 +208,7 @@ export class Vector2 implements IClone, ICopy { public set y(value: number) { this._y = value; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); } /** @@ -230,7 +230,7 @@ export class Vector2 implements IClone, ICopy { set(x: number, y: number): Vector2 { this._x = x; this._y = y; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -242,7 +242,7 @@ export class Vector2 implements IClone, ICopy { add(right: Vector2): Vector2 { this._x += right._x; this._y += right._y; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -254,7 +254,7 @@ export class Vector2 implements IClone, ICopy { subtract(right: Vector2): Vector2 { this._x -= right._x; this._y -= right._y; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -266,7 +266,7 @@ export class Vector2 implements IClone, ICopy { multiply(right: Vector2): Vector2 { this._x *= right._x; this._y *= right._y; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -278,7 +278,7 @@ export class Vector2 implements IClone, ICopy { divide(right: Vector2): Vector2 { this._x /= right._x; this._y /= right._y; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -307,7 +307,7 @@ export class Vector2 implements IClone, ICopy { negate(): Vector2 { this._x = -this._x; this._y = -this._y; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -328,7 +328,7 @@ export class Vector2 implements IClone, ICopy { scale(s: number): Vector2 { this._x *= s; this._y *= s; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -348,7 +348,7 @@ export class Vector2 implements IClone, ICopy { copyFrom(source: Vector2Like): Vector2 { this._x = source.x; this._y = source.y; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -372,7 +372,7 @@ export class Vector2 implements IClone, ICopy { copyFromArray(array: ArrayLike, offset: number = 0): Vector2 { this._x = array[offset]; this._y = array[offset + 1]; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } diff --git a/packages/math/src/Vector3.ts b/packages/math/src/Vector3.ts index db6f2cb9f5..c668ae9851 100644 --- a/packages/math/src/Vector3.ts +++ b/packages/math/src/Vector3.ts @@ -24,7 +24,7 @@ export class Vector3 implements IClone, ICopy { out._x = left._x + right._x; out._y = left._y + right._y; out._z = left._z + right._z; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -37,7 +37,7 @@ export class Vector3 implements IClone, ICopy { out._x = left._x - right._x; out._y = left._y - right._y; out._z = left._z - right._z; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -50,7 +50,7 @@ export class Vector3 implements IClone, ICopy { out._x = left._x * right._x; out._y = left._y * right._y; out._z = left._z * right._z; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -63,7 +63,7 @@ export class Vector3 implements IClone, ICopy { out._x = left._x / right._x; out._y = left._y / right._y; out._z = left._z / right._z; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -143,7 +143,7 @@ export class Vector3 implements IClone, ICopy { out._x = _x + (end._x - _x) * t; out._y = _y + (end._y - _y) * t; out._z = _z + (end._z - _z) * t; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -156,7 +156,7 @@ export class Vector3 implements IClone, ICopy { out._x = Math.max(left._x, right._x); out._y = Math.max(left._y, right._y); out._z = Math.max(left._z, right._z); - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -169,7 +169,7 @@ export class Vector3 implements IClone, ICopy { out._x = Math.min(left._x, right._x); out._y = Math.min(left._y, right._y); out._z = Math.min(left._z, right._z); - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -181,7 +181,7 @@ export class Vector3 implements IClone, ICopy { out._x = -a._x; out._y = -a._y; out._z = -a._z; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -208,7 +208,7 @@ export class Vector3 implements IClone, ICopy { out._x = a._x * s; out._y = a._y * s; out._z = a._z * s; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -229,7 +229,7 @@ export class Vector3 implements IClone, ICopy { out._x = _x * e[0] + _y * e[4] + _z * e[8]; out._y = _x * e[1] + _y * e[5] + _z * e[9]; out._z = _x * e[2] + _y * e[6] + _z * e[10]; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -245,7 +245,7 @@ export class Vector3 implements IClone, ICopy { out._x = _x * e[0] + _y * e[4] + _z * e[8] + e[12]; out._y = _x * e[1] + _y * e[5] + _z * e[9] + e[13]; out._z = _x * e[2] + _y * e[6] + _z * e[10] + e[14]; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -261,7 +261,7 @@ export class Vector3 implements IClone, ICopy { out._y = _x * e[1] + _y * e[5] + _z * e[9] + e[13]; out._z = _x * e[2] + _y * e[6] + _z * e[10] + e[14]; out._w = _x * e[3] + _y * e[7] + _z * e[11] + e[15]; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -286,7 +286,7 @@ export class Vector3 implements IClone, ICopy { out._x = (_x * e[0] + _y * e[4] + _z * e[8] + e[12]) * w; out._y = (_x * e[1] + _y * e[5] + _z * e[9] + e[13]) * w; out._z = (_x * e[2] + _y * e[6] + _z * e[10] + e[14]) * w; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -309,7 +309,7 @@ export class Vector3 implements IClone, ICopy { out._x = ix * qw - iw * qx - iy * qz + iz * qy; out._y = iy * qw - iw * qy - iz * qx + ix * qz; out._z = iz * qw - iw * qz - ix * qy + iy * qx; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @internal */ @@ -330,7 +330,7 @@ export class Vector3 implements IClone, ICopy { public set x(value: number) { this._x = value; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); } /** @@ -342,7 +342,7 @@ export class Vector3 implements IClone, ICopy { public set y(value: number) { this._y = value; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); } /** @@ -354,7 +354,7 @@ export class Vector3 implements IClone, ICopy { public set z(value: number) { this._z = value; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); } /** @@ -380,7 +380,7 @@ export class Vector3 implements IClone, ICopy { this._x = x; this._y = y; this._z = z; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -393,7 +393,7 @@ export class Vector3 implements IClone, ICopy { this._x += right._x; this._y += right._y; this._z += right._z; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -406,7 +406,7 @@ export class Vector3 implements IClone, ICopy { this._x -= right._x; this._y -= right._y; this._z -= right._z; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -419,7 +419,7 @@ export class Vector3 implements IClone, ICopy { this._x *= right._x; this._y *= right._y; this._z *= right._z; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -432,7 +432,7 @@ export class Vector3 implements IClone, ICopy { this._x /= right._x; this._y /= right._y; this._z /= right._z; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -462,7 +462,7 @@ export class Vector3 implements IClone, ICopy { this._x = -this._x; this._y = -this._y; this._z = -this._z; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -484,7 +484,7 @@ export class Vector3 implements IClone, ICopy { this._x *= s; this._y *= s; this._z *= s; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -557,7 +557,7 @@ export class Vector3 implements IClone, ICopy { this._x = source.x; this._y = source.y; this._z = source.z; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -583,7 +583,7 @@ export class Vector3 implements IClone, ICopy { this._x = array[offset]; this._y = array[offset + 1]; this._z = array[offset + 2]; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } diff --git a/packages/math/src/Vector4.ts b/packages/math/src/Vector4.ts index 7884f8330d..cf6c98fcc3 100644 --- a/packages/math/src/Vector4.ts +++ b/packages/math/src/Vector4.ts @@ -24,7 +24,7 @@ export class Vector4 implements IClone, ICopy { out._y = left._y + right._y; out._z = left._z + right._z; out._w = left._w + right._w; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -38,7 +38,7 @@ export class Vector4 implements IClone, ICopy { out._y = left._y - right._y; out._z = left._z - right._z; out._w = left._w - right._w; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -52,7 +52,7 @@ export class Vector4 implements IClone, ICopy { out._y = left._y * right._y; out._z = left._z * right._z; out._w = left._w * right._w; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -66,7 +66,7 @@ export class Vector4 implements IClone, ICopy { out._y = left._y / right._y; out._z = left._z / right._z; out._w = left._w / right._w; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -135,7 +135,7 @@ export class Vector4 implements IClone, ICopy { out._y = _y + (end._y - _y) * t; out._z = _z + (end._z - _z) * t; out._w = _w + (end._w - _w) * t; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -149,7 +149,7 @@ export class Vector4 implements IClone, ICopy { out._y = Math.max(left._y, right._y); out._z = Math.max(left._z, right._z); out._w = Math.max(left._w, right._w); - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -163,7 +163,7 @@ export class Vector4 implements IClone, ICopy { out._y = Math.min(left._y, right._y); out._z = Math.min(left._z, right._z); out._w = Math.min(left._w, right._w); - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -176,7 +176,7 @@ export class Vector4 implements IClone, ICopy { out._y = -a._y; out._z = -a._z; out._w = -a._w; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -193,7 +193,7 @@ export class Vector4 implements IClone, ICopy { out._y = _y * len; out._z = _z * len; out._w = _w * len; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } } @@ -208,7 +208,7 @@ export class Vector4 implements IClone, ICopy { out._y = a._y * s; out._z = a._z * s; out._w = a._w * s; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -224,7 +224,7 @@ export class Vector4 implements IClone, ICopy { out._y = _x * e[1] + _y * e[5] + _z * e[9] + _w * e[13]; out._z = _x * e[2] + _y * e[6] + _z * e[10] + _w * e[14]; out._w = _x * e[3] + _y * e[7] + _z * e[11] + _w * e[15]; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @@ -251,7 +251,7 @@ export class Vector4 implements IClone, ICopy { out._y = iy * qw - iw * qy - iz * qx + ix * qz; out._z = iz * qw - iw * qz - ix * qy + iy * qx; out._w = w; - out._onValueChanged && out._onValueChanged(); + out._onValueChanged?.(); } /** @internal */ @@ -274,7 +274,7 @@ export class Vector4 implements IClone, ICopy { public set x(value: number) { this._x = value; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); } /** @@ -286,7 +286,7 @@ export class Vector4 implements IClone, ICopy { public set y(value: number) { this._y = value; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); } /** @@ -298,7 +298,7 @@ export class Vector4 implements IClone, ICopy { public set z(value: number) { this._z = value; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); } /** @@ -310,7 +310,7 @@ export class Vector4 implements IClone, ICopy { public set w(value: number) { this._w = value; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); } /** @@ -340,7 +340,7 @@ export class Vector4 implements IClone, ICopy { this._y = y; this._z = z; this._w = w; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -354,7 +354,7 @@ export class Vector4 implements IClone, ICopy { this._y += right._y; this._z += right._z; this._w += right._w; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -368,7 +368,7 @@ export class Vector4 implements IClone, ICopy { this._y -= right._y; this._z -= right._z; this._w -= right._w; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -382,7 +382,7 @@ export class Vector4 implements IClone, ICopy { this._y *= right._y; this._z *= right._z; this._w *= right._w; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -396,7 +396,7 @@ export class Vector4 implements IClone, ICopy { this._y /= right._y; this._z /= right._z; this._w /= right._w; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -427,7 +427,7 @@ export class Vector4 implements IClone, ICopy { this._y = -this._y; this._z = -this._z; this._w = -this._w; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -450,7 +450,7 @@ export class Vector4 implements IClone, ICopy { this._y *= s; this._z *= s; this._w *= s; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -473,7 +473,7 @@ export class Vector4 implements IClone, ICopy { this._y = source.y; this._z = source.z; this._w = source.w; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; } @@ -501,7 +501,7 @@ export class Vector4 implements IClone, ICopy { this._y = array[offset + 1]; this._z = array[offset + 2]; this._w = array[offset + 3]; - this._onValueChanged && this._onValueChanged(); + this._onValueChanged?.(); return this; }