DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ OnVariablesSynchronized()

override void OnVariablesSynchronized ( )
private

См. определение в файле WoodBase.c строка 301

302 {
303 if (m_RadiusSync != m_Radius)
304 {
305 array<Object> objects = new array<Object>;
307 EffectParticleGeneral newEffect;
308
309 foreach (EffectParticleGeneral oldEffect : m_Effects)
310 {
311 SEffectManager.DestroyEffect(oldEffect);
312 }
313
314 m_Effects.Clear();
315
316 GetGame().GetObjectsAtPosition(GetWorldPosition(), m_RadiusSync, objects, proxies);
317
318 for (int i = 0; i < objects.Count(); i++)
319 {
320 WoodBase plant = WoodBase.Cast(objects[i]);
321 if (plant)
322 {
323 string particle;
324 int particleID;
325 string configPath = "CfgNonAIVehicles " + plant.GetType() + " FxFallingParticleEffect particle";
326 GetGame().ConfigGetText(configPath, particle);
327
328 if (particle != "")
329 {
330 particleID = ParticleList.RegisterParticle(particle);
331 }
332
333 if (particleID > 0)
334 {
335 LOD lod = plant.GetLODByName(LOD.NAME_MEMORY);
336 Selection selection = lod.GetSelectionByName("ptcFalling");
337 if (selection)
338 {
339 vector selectionPos;
340 for (int j = 0; j < selection.GetVertexCount(); j++)
341 {
342 newEffect = new EffectParticleGeneral();
343 newEffect.SetParticle(particleID);
344 selectionPos = selection.GetVertexPosition(lod, j);
345 SEffectManager.PlayInWorld(newEffect, plant.GetPosition() + selectionPos);
346 m_Effects.Insert(newEffect);
347 }
348
349 //play accompanying sounds
350 selectionPos = ModelToWorld(selectionPos);
351 EffectSound sound = SEffectManager.PlaySoundEnviroment("snow_fallen_trees_SoundSet", selectionPos);
352 sound.SetAutodestroy(true);
353 }
354 }
355 }
356 }
357 }
358
360 {
361 foreach (EffectParticleGeneral effect : m_Effects)
362 {
363 switch (m_CommandSync)
364 {
365 case EffecterCommands.START:
366 if (effect && !effect.IsPlaying())
367 {
368 effect.SetParticle(effect.m_LastParticleID);
369 effect.Start();
370 }
371 break;
372
373 case EffecterCommands.STOP:
374 if (effect && effect.IsPlaying())
375 {
376 effect.Stop();
377 }
378 break;
379
380 case EffecterCommands.REACTIVATE0:
381 case EffecterCommands.REACTIVATE1:
382 if (effect)
383 {
384 effect.SetParticle(effect.m_LastParticleID);
385 }
386 if (!effect.IsPlaying())
387 {
388 effect.Start();
389 }
390 break;
391
392 default:
393 break;
394 }
395 }
397 }
398 }
float m_Radius
Определения AIGroupBehaviour.c:10
void EffectParticleGeneral()
Определения EffectManager.c:852
int m_Command
Определения EffectManager.c:687
int m_CommandSync
Определения EffectManager.c:688
float m_RadiusSync
Определения WoodBase.c:276
TreeEffecterParameters m_Effects
void WoodBase()
Определения WoodBase.c:30
proto native void GetObjectsAtPosition(vector pos, float radius, out array< Object > objects, out array< CargoBase > proxyCargos)
Returns list of all objects in circle "radius" around position "pos".
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
Определения EffectSound.c:603
Wrapper class for managing sound through SEffectManager.
Определения EffectSound.c:5
Selection GetSelectionByName(string name)
Определения gameplay.c:222
static const string NAME_MEMORY
Определения gameplay.c:209
LOD class.
Определения gameplay.c:204
static int RegisterParticle(string file_name)
Определения ParticleList.c:374
Определения ParticleList.c:12
static EffectSound PlaySoundEnviroment(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound, updating environment variables.
Определения EffectManager.c:228
static int PlayInWorld(notnull Effect eff, vector pos)
Play an Effect.
Определения EffectManager.c:47
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
Определения EffectManager.c:271
Manager class for managing Effect (EffectParticle, EffectSound)
Определения EffectManager.c:6
vector GetVertexPosition(LOD lod, int index)
Определения gameplay.c:188
proto native int GetVertexCount()
Selection class.
Определения gameplay.c:180
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Определения EnConvert.c:106
proto native CGame GetGame()

Перекрестные ссылки CGame::ConfigGetText(), SEffectManager::DestroyEffect(), EffectParticleGeneral(), GetGame(), CGame::GetObjectsAtPosition(), LOD::GetSelectionByName(), Selection::GetVertexCount(), Selection::GetVertexPosition(), m_Command, m_CommandSync, m_Effects, m_Radius, m_RadiusSync, LOD::NAME_MEMORY, SEffectManager::PlayInWorld(), SEffectManager::PlaySoundEnviroment(), ParticleList::RegisterParticle(), EffectSound::SetAutodestroy() и WoodBase().