Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_HQRadioSoundEntity.c
Go to the documentation of this file.
1
class
SCR_HQRadioSoundEntityClass
: GenericEntityClass
2
{
3
}
4
5
class
SCR_HQRadioSoundEntity :
GenericEntity
6
{
7
protected
SimpleSoundComponent
m_SimpleSoundComponent
;
8
protected
AudioHandle
m_PlayedRadio
=
AudioHandle
.Invalid;
9
10
protected
static
SCR_HQRadioSoundEntity s_Instance = null;
11
12
//------------------------------------------------------------------------------------------------
14
static
SCR_HQRadioSoundEntity GetInstance()
15
{
16
if
(!s_Instance)
17
{
18
SCR_GameModeCampaign
campaign =
SCR_GameModeCampaign
.GetInstance();
19
if
(!campaign)
20
return
null;
21
22
BaseWorld
world =
GetGame
().GetWorld();
23
24
if
(world)
25
{
26
Resource
resource =
Resource
.Load(campaign.GetHQRadioSoundEntityPrefab());
27
if
(!resource || !resource.IsValid())
28
return
null;
29
30
s_Instance = SCR_HQRadioSoundEntity.Cast(
GetGame
().SpawnEntityPrefab(resource, world));
31
}
32
}
33
34
return
s_Instance;
35
}
36
37
//------------------------------------------------------------------------------------------------
40
void
PlayRadioSound
(
string
soundEventName)
41
{
42
AudioSystem
.TerminateSound(
m_PlayedRadio
);
43
m_PlayedRadio
=
m_SimpleSoundComponent
.PlayStr(soundEventName);
44
45
#ifdef ENABLE_DIAG
46
if
(
m_PlayedRadio
==
AudioHandle
.Invalid)
47
Print
(
"[SCR_HQRadioSoundEntity.PlayRadioSound] soundEventName:"
+soundEventName+
" not configured."
,
LogLevel
.WARNING);
48
#endif
49
}
50
51
//------------------------------------------------------------------------------------------------
52
SimpleSoundComponent
GetSimpleSoundComponent
()
53
{
54
if
(!
m_SimpleSoundComponent
)
55
m_SimpleSoundComponent
=
SimpleSoundComponent
.Cast(FindComponent(
SimpleSoundComponent
));
56
57
return
m_SimpleSoundComponent
;
58
}
59
60
//------------------------------------------------------------------------------------------------
61
// destructor
62
void
~SCR_HQRadioSoundEntity
()
63
{
64
s_Instance = null;
65
}
66
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
SCR_GameModeCampaign
void SCR_GameModeCampaign(IEntitySource src, IEntity parent)
Definition
SCR_GameModeCampaign.c:1812
m_PlayedRadio
AudioHandle m_PlayedRadio
Definition
SCR_HQRadioSoundEntity.c:8
GetSimpleSoundComponent
SimpleSoundComponent GetSimpleSoundComponent()
Definition
SCR_HQRadioSoundEntity.c:52
~SCR_HQRadioSoundEntity
void ~SCR_HQRadioSoundEntity()
Definition
SCR_HQRadioSoundEntity.c:62
PlayRadioSound
void PlayRadioSound(string soundEventName)
Definition
SCR_HQRadioSoundEntity.c:40
m_SimpleSoundComponent
SCR_HQRadioSoundEntityClass m_SimpleSoundComponent
AudioHandle
Definition
EnAudio.c:9
AudioSystem
Definition
AudioSystem.c:13
BaseWorld
Definition
BaseWorld.c:13
GenericEntity
Definition
GenericEntity.c:16
Resource
Object holding reference to resource. In destructor release the resource.
Definition
Resource.c:25
SCR_HQRadioSoundEntityClass
Definition
SCR_HQRadioSoundEntity.c:2
SimpleSoundComponent
Definition
SimpleSoundComponent.c:13
Print
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
LogLevel
Enum with severity of the logging message.
Definition
LogLevel.c:14
scripts
Game
Campaign
SCR_HQRadioSoundEntity.c
Generated by
1.17.0