Browse Source

added getter/setter on optimizers

jbousquie 10 năm trước cách đây
mục cha
commit
1a3225830b
1 tập tin đã thay đổi với 24 bổ sung21 xóa
  1. 24 21
      src/Particles/babylon.solidParticleSystem.ts

+ 24 - 21
src/Particles/babylon.solidParticleSystem.ts

@@ -318,38 +318,41 @@ module BABYLON {
             this.mesh.dispose();
         }
 
-        // Optimizers
-        public enableParticleRotation(): void {
-            this._useParticleRotation = true;
+        // Optimizer setters
+        public set useParticleRotation(val: boolean) {
+            this._useParticleRotation = val;
         }
 
-        public disableParticleRotation(): void {
-            this._useParticleRotation = false;
+        public set useParticleColor(val: boolean) {
+            this._useParticleColor = val;
         }
 
-        public enableParticleColor(): void {
-            this._useParticleColor = true;
-        }
-        public disableParticleColor(): void {
-            this._useParticleColor = false;
-        }
-
-        public enableParticleTexture(): void {
-            this._useParticleTexture = true;
+        public set useParticleTexture(val: boolean) {
+            this._useParticleTexture = val;
         } 
 
-        public disableParticleTexture(): void {
-            this._useParticleTexture = false;
+        public set useParticleVertex(val: boolean) {
+            this._useParticleVertex = val;
         } 
 
-        public enableParticleVertex(): void {
-            this._useParticleVertex = true;
-        } 
+        // getters
+         public get useParticleRotation() {
+            return this._useParticleRotation;
+        }
 
-        public disableParticleVertex(): void {
-            this._useParticleVertex = false;
+        public get useParticleColor() {
+            return this._useParticleColor;
         }
 
+        public get useParticleTexture() {
+            return this._useParticleTexture;
+        } 
+
+        public get useParticleVertex() {
+            return this._useParticleVertex;
+        } 
+       
+
         // =======================================================================
         // Particle behavior logic
         // these following methods may be overwritten by the user to fit his needs