Script Dokumentation LS 2015 - SimParticleSystem (Patch 1.3)
scripts/objects/SimParticleSystem.lua
Copyright (c) 2008-2015 GIANTS Software GmbH, Confidential, All Rights Reserved.
This document is to be published solely by ls-mods.de
1 | -- SimParticleSystem class |
2 | -- |
3 | -- This pre-simulates a particle system so it doesn't start at zero when the game begins |
4 | -- |
5 | -- Copyright (C) GIANTS Software GmbH, Confidential, All Rights Reserved. |
6 | |
7 | SimParticleSystem = {} |
8 | |
9 | local SimParticleSystem_mt = Class(SimParticleSystem); |
10 | |
11 | function SimParticleSystem:onCreate(id) |
12 | g_currentMission:addNonUpdateable(SimParticleSystem:new(id)); |
13 | end; |
14 | |
15 | function SimParticleSystem:new(name) |
16 | local self = {}; |
17 | setmetatable(self, SimParticleSystem_mt); |
18 | self.id = name; |
19 | |
20 | local particleSystem = nil; |
21 | |
22 | if getClassName(self.id) == "Shape" then |
23 | local geometry = getGeometry(self.id); |
24 | if geometry ~= 0 then |
25 | if getClassName(geometry) == "ParticleSystem" then |
26 | particleSystem = geometry; |
27 | end; |
28 | end; |
29 | end; |
30 | |
31 | if particleSystem ~= nil then |
32 | local lifespan = getParticleSystemLifespan(particleSystem); |
33 | addParticleSystemSimulationTime(particleSystem, lifespan); |
34 | end; |
35 | |
36 | return self; |
37 | end; |
38 | |
39 | function SimParticleSystem:delete() |
40 | |
41 | end;
|
Copyright (c) 2008-2015 GIANTS Software GmbH, Confidential, All Rights Reserved.
This document is to be published solely by ls-mods.de