DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
UnderObjectDecalSpawnComponent.c
См. документацию.
10
12{
13 private const string SURFACE_PARAM_DECAL_NAME = "underObjectDecal";
14
16
17 protected Object m_Parent;
18 protected Object m_Decal;
19
20 private float m_LastScaleValue;
21
23 {
24 m_Settings = pSettings;
25 m_Parent = pParent;
26 }
27
28 private string GetObjectNameFromSurfaceConfig(string surfaceParamName = SURFACE_PARAM_DECAL_NAME)
29 {
30 string surfaceType
31 int liquidType;
32 g_Game.SurfaceUnderObjectCorrectedLiquid(m_Parent, surfaceType, liquidType);
33
34 return Surface.GetParamText(surfaceType, surfaceParamName);
35 }
36
38 {
39 if (m_Decal)
40 return;
41
42 #ifndef SERVER
43 m_Decal = g_Game.CreateObjectEx(
45 m_Parent.GetPosition() + m_Settings.m_PositionOffset,
47 );
48
49 if (m_Decal)
50 {
51 if (m_Settings.m_RandomizeRotation)
52 {
53 vector v;
54 v[0] = Math.RandomFloat(-Math.PI, Math.PI);
55 m_Decal.SetOrientation(v * Math.RAD2DEG);
56 }
57
58 m_Decal.SetScale(m_Settings.m_ScaleMin);
59 }
60 #endif
61 }
62
64 {
65 #ifndef SERVER
66 if (m_Decal)
67 m_Decal.Delete();
68 #endif
69 }
70
71 void UpdateSize(float pScaleValue)
72 {
73 #ifndef SERVER
74 if (m_Decal)
75 {
76 if (pScaleValue != m_LastScaleValue)
77 {
78 m_LastScaleValue = m_Decal.GetScale();
79 m_Decal.SetScale(Math.Clamp(pScaleValue, m_Settings.m_ScaleMin, m_Settings.m_ScaleMax));
80 }
81 }
82 #endif
83 }
84}
const int ECE_LOCAL
Определения CentralEconomy.c:24
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:37
DayZGame g_Game
Определения DayZGame.c:3868
Widget m_Parent
Определения SizeToChild.c:92
Object m_Decal
void RemoveDecal()
string GetObjectNameFromSurfaceConfig(string surfaceParamName=SURFACE_PARAM_DECAL_NAME)
ref UnderObjectDecalSpawnSettings m_Settings
class UnderObjectDecalSpawnSettings SURFACE_PARAM_DECAL_NAME
float m_LastScaleValue
void SpawnDecal()
void UpdateSize(float pScaleValue)
void UnderObjectDecalSpawnComponent(notnull UnderObjectDecalSpawnSettings pSettings, notnull Object pParent)
Определения EnMath.c:7
Определения ObjectTyped.c:2
static string GetParamText(string surfaceName, string paramName)
Определения Surface.c:23
Определения Surface.c:2
static const vector Zero
Определения EnConvert.c:110
Определения EnConvert.c:106
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static const float RAD2DEG
Определения EnMath.c:16
static const float PI
Определения EnMath.c:12