Prechádzať zdrojové kódy

BufferAttribute: `warnOnce` for deprecated methods (#27595)

hybridherbst 2 rokov pred
rodič
commit
597b839e17

+ 2 - 1
src/core/BufferAttribute.js

@@ -3,6 +3,7 @@ import { Vector2 } from '../math/Vector2.js';
 import { denormalize, normalize } from '../math/MathUtils.js';
 import { StaticDrawUsage, FloatType } from '../constants.js';
 import { fromHalfFloat, toHalfFloat } from '../extras/DataUtils.js';
+import { warnOnce } from '../utils.js';
 
 const _vector = /*@__PURE__*/ new Vector3();
 const _vector2 = /*@__PURE__*/ new Vector2();
@@ -45,7 +46,7 @@ class BufferAttribute {
 
 	get updateRange() {
 
-		console.warn( 'THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead.' ); // @deprecated, r159
+		warnOnce( 'THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead.' ); // @deprecated, r159
 		return this._updateRange;
 
 	}

+ 2 - 1
src/core/InterleavedBuffer.js

@@ -1,5 +1,6 @@
 import * as MathUtils from '../math/MathUtils.js';
 import { StaticDrawUsage } from '../constants.js';
+import { warnOnce } from '../utils.js';
 
 class InterleavedBuffer {
 
@@ -31,7 +32,7 @@ class InterleavedBuffer {
 
 	get updateRange() {
 
-		console.warn( 'THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead.' ); // @deprecated, r159
+		warnOnce( 'THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead.' ); // @deprecated, r159
 		return this._updateRange;
 
 	}

粤ICP备19079148号