Sprache Deutsch Language English

Script Dokumentation LS 2015 - SimParticleSystem (Patch 1.3)

Script Dokumentation Übersicht

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
7SimParticleSystem = {}
8
9local SimParticleSystem_mt = Class(SimParticleSystem);
10
11function SimParticleSystem:onCreate(id)
12 g_currentMission:addNonUpdateable(SimParticleSystem:new(id));
13end;
14
15function 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;
37end;
38
39function SimParticleSystem:delete()
40
41end;
Copyright (c) 2008-2015 GIANTS Software GmbH, Confidential, All Rights Reserved.
This document is to be published solely by ls-mods.de
Script Dokumentation Übersicht