tsstatic things

This commit is contained in:
RandomityGuy 2023-02-13 19:48:39 +05:30
parent 26b1aad189
commit 2b5b5ce326
2 changed files with 5 additions and 3 deletions

View file

@ -889,7 +889,7 @@ class DtsObject extends GameObject {
} }
} }
if (!this.isInstanced) { if (!this.isInstanced && !this.isTSStatic) {
for (i in 0...this.materials.length) { for (i in 0...this.materials.length) {
var info = this.materialInfos.get(this.materials[i]); var info = this.materialInfos.get(this.materials[i]);
if (info == null) if (info == null)

View file

@ -795,7 +795,7 @@ class MarbleWorld extends Scheduler {
this.addDtsObject(tsShape, () -> { this.addDtsObject(tsShape, () -> {
tsShape.setTransform(mat); tsShape.setTransform(mat);
onFinish(); onFinish();
}); }, true);
} }
public function addParticleEmitterNode(element:MissionElementParticleEmitterNode) { public function addParticleEmitterNode(element:MissionElementParticleEmitterNode) {
@ -826,12 +826,14 @@ class MarbleWorld extends Scheduler {
}); });
} }
public function addDtsObject(obj:DtsObject, onFinish:Void->Void) { public function addDtsObject(obj:DtsObject, onFinish:Void->Void, isTsStatic:Bool = false) {
obj.idInLevel = this.dtsObjects.length; // Set the id of the thing obj.idInLevel = this.dtsObjects.length; // Set the id of the thing
this.dtsObjects.push(obj); this.dtsObjects.push(obj);
if (obj is ForceObject) { if (obj is ForceObject) {
this.forceObjects.push(cast obj); this.forceObjects.push(cast obj);
} }
if (isTsStatic)
obj.useInstancing = false;
obj.init(cast this, () -> { obj.init(cast this, () -> {
obj.update(this.timeState); obj.update(this.timeState);
if (obj.useInstancing) { if (obj.useInstancing) {