DayZ 1.30
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 #ifndef NO_GUI
44 m_Decal = g_Game.CreateObjectEx(
46 m_Parent.GetPosition() + m_Settings.m_PositionOffset,
48 );
49
50 if (m_Decal)
51 {
52 if (m_Settings.m_RandomizeRotation)
53 {
54 vector v;
55 v[0] = Math.RandomFloat(-Math.PI, Math.PI);
56 m_Decal.SetOrientation(v * Math.RAD2DEG);
57 }
58
59 m_Decal.SetScale(m_Settings.m_ScaleMin);
60 }
61 #endif
62 #endif
63 }
64
66 {
67 #ifndef SERVER
68 #ifndef NO_GUI
69 if (m_Decal)
70 m_Decal.Delete();
71 #endif
72 #endif
73 }
74
75 void UpdateSize(float pScaleValue)
76 {
77 #ifndef SERVER
78 if (m_Decal)
79 {
80 if (pScaleValue != m_LastScaleValue)
81 {
82 m_LastScaleValue = m_Decal.GetScale();
83 m_Decal.SetScale(Math.Clamp(pScaleValue, m_Settings.m_ScaleMin, m_Settings.m_ScaleMax));
84 }
85 }
86 #endif
87 }
88}
Entity m_Parent
Определения CachedEquipmentStorageBase.c:17
const int ECE_LOCAL
Определения CentralEconomy.c:25
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:38
DayZGame g_Game
Определения DayZGame.c:4074
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:13
Определения Surface.c:2
static const vector Zero
Определения EnConvert.c:123
Определения EnConvert.c:119
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