4 ref SCR_AudioSourceConfiguration m_AudioSourceConfiguration;
13 ResourceName m_Particle;
15 [
Attribute(
"0", uiwidget: UIWidgets.ComboBox,
"Desired type of Game Material effect",
"", ParamEnumArray.FromEnum(EParticleEffectInfoType),
category:
"VFX")]
16 int m_iGameMaterialEffect;
22 bool m_bFirstContactOnly;
25 bool m_bParticleOriented;
28 enum EParticleEffectInfoType
41 if (!soundManagerEntity)
44 if (!prefabData.m_AudioSourceConfiguration || !prefabData.m_AudioSourceConfiguration.IsValid())
48 SCR_AudioSource audioSource = soundManagerEntity.CreateAudioSource(owner, prefabData.m_AudioSourceConfiguration);
53 if (prefabData.m_bSurfaceSignal)
57 audioSource.SetSignalValue(
SCR_AudioSource.SURFACE_SIGNAL_NAME, material.GetSoundInfo().GetSignalValue());
64 Math3D.MatrixIdentity4(mat);
65 mat[3] = contact.Position;
67 soundManagerEntity.PlayAudioSource(audioSource, mat);
70 soundManagerEntity.PlayAudioSource(audioSource);
80 SetEventMask(owner, EntityEvent.CONTACT);
83 DiagMenu.RegisterBool(
SCR_DebugMenuID.DEBUGUI_PARTICLES_CONTACT_COMPONENT,
"",
"Show Particle Contacts",
"Particles");
89 override void EOnContact(IEntity owner, IEntity other, Contact contact)
95 ClearEventMask(owner, EntityEvent.CONTACT);
103 if (prefabData.m_bPlayParticle)
107 if (prefabData.m_iGameMaterialEffect == 1)
114 prefabData.m_Particle = effectInfo.GetVehicleDustResource(prefabData.m_iEffectIndex);
117 else if (prefabData.m_iGameMaterialEffect == 2)
124 prefabData.m_Particle = effectInfo.GetBlastResource(prefabData.m_iEffectIndex);
128 if (prefabData.m_Particle !=
string.Empty)
130 ParticleEffectEntitySpawnParams spawnParams();
131 spawnParams.UseFrameEvent =
true;
133 if (prefabData.m_bParticleOriented)
134 Math3D.AnglesToMatrix(contact.Normal, spawnParams.Transform);
136 spawnParams.Transform[3] = contact.Position;
137 ParticleEffectEntity.SpawnParticleEffect(prefabData.m_Particle, spawnParams);
140 if (!DiagMenu.GetBool(
SCR_DebugMenuID.DEBUGUI_PARTICLES_CONTACT_COMPONENT))
143 DebugTextWorldSpace.Create(
GetOwner().GetWorld(), contact.Material2.GetName(), DebugTextFlags.CENTER, contact.Position[0], contact.Position[1], contact.Position[2]);
149 if (prefabData.m_bFirstContactOnly)
150 ClearEventMask(owner, EntityEvent.CONTACT);