|
@@ -187,6 +187,7 @@ private class ParticleInstance extends h3d.scene.Object {
|
|
class EmitterObject extends h3d.scene.Object {
|
|
class EmitterObject extends h3d.scene.Object {
|
|
|
|
|
|
public var enable : Bool;
|
|
public var enable : Bool;
|
|
|
|
+ public var particleVisibility(default, null) : Bool;
|
|
|
|
|
|
public var particleTemplate : hide.prefab.Object3D;
|
|
public var particleTemplate : hide.prefab.Object3D;
|
|
public var maxCount = 20;
|
|
public var maxCount = 20;
|
|
@@ -234,6 +235,7 @@ class EmitterObject extends h3d.scene.Object {
|
|
var instances : Array<ParticleInstance> = [];
|
|
var instances : Array<ParticleInstance> = [];
|
|
|
|
|
|
public function reset() {
|
|
public function reset() {
|
|
|
|
+ particleVisibility = true;
|
|
enable = true;
|
|
enable = true;
|
|
random.init(randomSeed);
|
|
random.init(randomSeed);
|
|
curTime = 0.0;
|
|
curTime = 0.0;
|
|
@@ -244,6 +246,13 @@ class EmitterObject extends h3d.scene.Object {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function setParticleVibility( b : Bool ){
|
|
|
|
+ for(inst in instances) {
|
|
|
|
+ inst.visible = b;
|
|
|
|
+ }
|
|
|
|
+ particleVisibility = b;
|
|
|
|
+ }
|
|
|
|
+
|
|
function doEmit(count: Int) {
|
|
function doEmit(count: Int) {
|
|
if(count == 0)
|
|
if(count == 0)
|
|
return;
|
|
return;
|
|
@@ -259,6 +268,7 @@ class EmitterObject extends h3d.scene.Object {
|
|
|
|
|
|
for(i in 0...count) {
|
|
for(i in 0...count) {
|
|
var part = new ParticleInstance(this, instDef);
|
|
var part = new ParticleInstance(this, instDef);
|
|
|
|
+ part.visible = particleVisibility;
|
|
context.local3d = part;
|
|
context.local3d = part;
|
|
var ctx = particleTemplate.makeInstance(context);
|
|
var ctx = particleTemplate.makeInstance(context);
|
|
|
|
|