1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 |
--Particle System
ZO_ParticleSystem . particleClassToPool = { }
return obj
end
if not ZO_ParticleSystem . particleClassToPool [ particleClass ] then
end
ZO_ParticleSystem . particleClassToPool [ particleClass ] = pool
end
end
end
end
if particlesPerSecond > 0 then
else
end
end
end
end
end
end
--This is the sound that will play on start, or on each burst if it's a burst system
end
end
end
end
end
--This function takes N parameter names and one value generator. The result of the value generator will be applied to the
--named parameters when the particle is created. A simple example is, SetParticleParameter("alpha", ZO_UniformRangeGenerator:New(0, 1)).
--This would set the parameter "alpha" to a random value between 0 and 1 on creation. For a more complex example,
--SetParticleParameter("x", "y", "z", ZO_RandomSpherePoint:New(10)). This would generate a random point on a sphere of size 10 and then
--set each of "x", "y", and "z" on the particle. This allows for one generator to produce multiple linked values. You can also use a direct
--value instead of using a generator class if you just want to use the value always. For example, SetParticle("scale", 1.5).
if numArguments >= 2 then
--See if we already have a generator for these parameter names. We assume that they won't do something like setting generators for
--both "x" and "x" , "y".
local existingKey
for i = 1 , numArguments - 1 do
break
end
end
existingKey = parameterNames
break
end
end
local parameterNames
if existingKey then
parameterNames = existingKey
else
parameterNames = { }
for i = 1 , numArguments - 1 do
end
end
end
end
-- With priming, we pretend like the system had started some time ago and let the system play catch up
-- This allows for situations like an emitter seeming like it had already been emitting before we ever showed the scene,
-- so that the player doesn't see it filling out in the beginning
end
end
else
end
end
if numParticlesToSpawn == 0 then
return
end
local MAX_PARTICLES_TO_SPAWN_PER_FRAME = 300
if not intervalS then
intervalS = ( endTimeS - startTimeS ) / numParticlesToSpawn
end
local particleSpawnTimeS = startTimeS + intervalS
for particleSpawnIndex = 1 , numParticlesToSpawn do
local isParticleAlreadyDead = false
-- This is the prime for the individual particle, not for the system
local spawnTimePrimeS = 0
if valueGeneratorIsObject then
end
if parameterName == "DurationS" then
if particleSpawnTimeS + durationS < nowS then
-- Don't bother starting up a particle that's effectively already dead
isParticleAlreadyDead = true
break
end
elseif parameterName == "PrimeS" then
end
if valueGeneratorIsObject then
else
end
end
end
if isParticleAlreadyDead then
else
end
particleSpawnTimeS = particleSpawnTimeS + intervalS
end
end
end
end
end
end
do
local g_removeParticles = { }
if durationS then
end
end
end
else
--Spawn New Particles
if elapsedTimeS > 0 then
-- How far into the current cycle are we?
-- When did the current cycle begin?
local timeCycleStartedS = timeS - timeInCycleS
-- New burst
end
--We're after when we would have started emitting, and we haven't emitted enough particles
local progress = 1
end
end
--Play the sound the first time particles start bursting
end
end
end
--Any "partial" particles that are left over we store off as unused delta time and then add that into the next update.
self : SpawnParticles ( numParticlesToSpawn , timeS - secondsSinceLastParticle , timeS , self . secondsBetweenParticles )
end
end
--Update Particles
else
end
end
--Remove Dead Particles
if # g_removeParticles then
end
end
end
end
--Stop and kill all particles
end
end
end
--Stop making new particles but let existing particles finish
end
end
--Scene Graph Particle System
end
end
end
--Control Particle System
ZO_ControlParticleSystem = ZO_ParticleSystem
--Particle System Manager
return obj
end
EVENT_MANAGER : RegisterForUpdate ( "ZO_ParticleSystemManager" , 0 , function ( timeMS ) self : OnUpdate ( timeMS / 1000 ) end )
end
end
end
end
if searchParticleSystem == particleSystem then
break
end
end
end
textureControl . key = key
return textureControl
end
end
function ZO_ParticleSystemManager : GetAnimation ( control , playbackInfo , animationType , easingFunction , durationS , offsetS )
--Collect all of the timelines until FinishBuildingAnimationTimelines is called
end
local playbackType = ANIMATION_PLAYBACK_ONE_SHOT
local loopCount = 1
if playbackInfo then
playbackType = playbackInfo . playbackType or ANIMATION_PLAYBACK_ONE_SHOT
loopCount = playbackInfo . loopCount or 1
end
offsetS = offsetS or 0
local timeline
--One shot animations all belong to the same timeline. LOOP and PING_PONG animations use separate timelines so they can LOOP and PING_PONG at their own durations.
if playbackType == ANIMATION_PLAYBACK_ONE_SHOT then
if self . buildingAnimationTimelinePlaybackTypes [ i ] == playbackType and self . buildingAnimationTimelineLoopCounts [ i ] == loopCount then
break
end
end
end
if not timeline then
local key
timeline . key = key
end
if not animation then
else
end
return animation
end
return timelines
else
return nil
end
end
end
end
end
|