瀏覽代碼

Material: use class properties (#24237)

Marco Fugaro 2 年之前
父節點
當前提交
1dc9d436cb
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      src/materials/Material.js

+ 5 - 5
src/materials/Material.js

@@ -6,6 +6,8 @@ let materialId = 0;
 
 class Material extends EventDispatcher {
 
+	#alphaTest = 0;
+
 	constructor() {
 
 		super();
@@ -73,25 +75,23 @@ class Material extends EventDispatcher {
 
 		this.version = 0;
 
-		this._alphaTest = 0;
-
 	}
 
 	get alphaTest() {
 
-		return this._alphaTest;
+		return this.#alphaTest;
 
 	}
 
 	set alphaTest( value ) {
 
-		if ( this._alphaTest > 0 !== value > 0 ) {
+		if ( this.#alphaTest > 0 !== value > 0 ) {
 
 			this.version ++;
 
 		}
 
-		this._alphaTest = value;
+		this.#alphaTest = value;
 
 	}