DayZ
1.24
Loading...
Searching...
No Matches
PluginDoorRuler.c
Go to the documentation of this file.
1
class
PluginDoorRuler
extends
PluginBase
2
{
3
PluginDeveloper m_ModuleDeveloper;
4
ItemBase
m_Ruler
;
5
ref
Timer
m_Timer
;
6
bool
m_Initialized
;
7
8
void
CheckInit
()
9
{
10
if
(
FreeDebugCamera
.GetInstance().IsActive())
11
Init
();
12
}
13
14
void
Init
()
15
{
16
if
(m_Ruler)
17
m_Ruler.Delete();
18
19
m_Initialized
=
true
;
20
m_Ruler =
ItemBase
.Cast(
GetGame
().CreateObject(
"DoorTestCamera"
,
FreeDebugCamera
.GetInstance().GetPosition(),
false
,
false
/*ai*/
));
21
}
22
23
override
void
OnUpdate
(
float
delta_time
)
24
{
25
if
(!
m_Initialized
)
return
;
26
if
(!
FreeDebugCamera
.GetInstance().IsActive())
return
;
27
if
(!m_Ruler)
return
;
28
vector
cam_pos
=
FreeDebugCamera
.GetInstance().GetPosition();
29
vector
ruler_pos
= m_Ruler.GetPosition();
30
vector
camera_dir
=
FreeDebugCamera
.GetInstance().GetDirection();
31
camera_dir
.Normalize();
32
m_Ruler.SetPosition(
FreeDebugCamera
.GetInstance().GetPosition() + (
camera_dir
* 2));
33
m_Ruler.SetAngles(
FreeDebugCamera
.GetInstance().GetAngles());
34
}
35
}
Init
override Widget Init()
Definition
DayZGame.c:120
m_Timer
ref Timer m_Timer
Definition
DayZGame.c:675
m_Initialized
bool m_Initialized
Definition
UiHintPanel.c:309
ItemBase
Definition
InventoryItem.c:697
Param3
Definition
EntityAI.c:95
PluginBase
Definition
PluginBase.c:2
PluginBase::CheckInit
void CheckInit()
Definition
PluginDoorRuler.c:8
PluginBase::Init
void Init()
Definition
PluginDoorRuler.c:14
PluginBase::m_Ruler
ItemBase m_Ruler
Definition
PluginDoorRuler.c:4
PluginBase::OnUpdate
override void OnUpdate(float delta_time)
Definition
PluginDoorRuler.c:23
Timer
Definition
DayZPlayerImplement.c:61
vector
Definition
EnConvert.c:106
GetGame
proto native CGame GetGame()
scripts
4_World
Plugins
PluginBase
PluginDeveloper
PluginDoorRuler.c
Generated by
1.10.0