Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
particletest.c
Go to the documentation of this file.
1 // Particle test for Maxman
2 
3 class ParticleTest extends ItemBase
4 {
5  protected int PARTICLE_PATH;
6  protected Particle m_Particle;
7 
8  // Constructor
9  void ParticleTest()
10  {
11  if ( !GetGame().IsServer() || !GetGame().IsMultiplayer() ) // Client side
12  {
13  string path = ParticleList.GetPathToParticles();
14 
15 
16 
17 
18 
19  // Enter particle ID to play when ParticleTest spawns
20  PARTICLE_PATH = ParticleList.DEBUG_DOT;
21 
22  // Alternatively, uncomment the second line and enter particle filename without *.ptc suffix instead. Example: "menu_engine_fire"
23  string particle_filename = "menu_engine_fire";
24  //PARTICLE_PATH = ParticleList.GetParticleID( path + particle_filename );
25 
26 
27 
28 
29 
30  m_Particle = ParticleManager.GetInstance().PlayOnObject( PARTICLE_PATH, this, GetPosition());
31  }
32  }
33 
34  // Destructor
35  override void EEDelete(EntityAI parent)
36  {
37  super.EEDelete(parent);
38 
39  if (m_Particle && GetGame()) // GetGame() is null when the game is being shut down
40  {
41  m_Particle.Stop();
42  GetGame().ObjectDelete(m_Particle);
43  }
44  }
45 }
ItemBase
Definition: inventoryitem.c:730
GetGame
proto native CGame GetGame()
Particle
Legacy way of using particles in the game.
Definition: particle.c:6
EEDelete
override void EEDelete(EntityAI parent)
Definition: contaminatedarea.c:69
GetPosition
class JsonUndergroundAreaTriggerData GetPosition
Definition: undergroundarealoader.c:9
ParticleList
Definition: particlelist.c:11
ParticleManager
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Definition: particlemanager.c:84
EntityAI
Definition: building.c:5
path
string path
Definition: optionselectormultistate.c:135