MissionCleanup and delete
by Isidore · in Torque Game Engine · 08/06/2003 (2:37 am) · 1 replies
Hello!
I tested a spell resource the other day, and I met these lines
( I forgot who is the author, but thanks for this :) )
and
What is actually the appropriate way to effectively clean an object when finished with it?
As far as I can see it, the code:
Does this make sense or is it completely wrong?
Now, supposing I call
I will try anyway ^^
Thank you by advance for any info.
Cheers,
Isi
I tested a spell resource the other day, and I met these lines
( I forgot who is the author, but thanks for this :) )
%p = new Explosion() {
[ datablock... ]
}
MissionCleanup.add(%p);and
%p = new ParticleEmitterNode() {
[ datablock... ]
}
%p.schedule(2000,"delete");What is actually the appropriate way to effectively clean an object when finished with it?
As far as I can see it, the code:
%p.schedule(2000,"delete");induces a call to the object's destructor after 2 secs, whereas the code:
MissionCleanup.add(%p);will clean the object when leaving the mission.
Does this make sense or is it completely wrong?
Now, supposing I call
%p.schedule(2000,"delete");but the exposion is long and is still being rendered at that time, what will happen?
I will try anyway ^^
Thank you by advance for any info.
Cheers,
Isi
Torque Owner Isidore
"What is actually the appropriate way to effectively clean an object when finished with it?"
->
or add a call to
when the object's lifetime is over
as for my other question:
the render method won't be called if the object is deleted I guess...
Anyway, consider this thread as closed.
Isi