Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_BaseDestructionPhase.c
Go to the documentation of this file.
2{
3 [Attribute(ResourceName.Empty, UIWidgets.ResourcePickerThumbnail, "Model to use for the damage phase", "xob et")]
4 ResourceName m_sPhaseModel;
5
6 [Attribute("0", UIWidgets.CheckBox, "Use material remap from parent prefab when changing to this phase")]
7 bool m_bUseMaterialFromParent;
8
9 [Attribute("", UIWidgets.Object, "List of objects (particles, debris, etc) to spawn on destruction of the phase")]
10 ref array<ref SCR_BaseSpawnable> m_aPhaseDestroySpawnObjects;
11
12 [Attribute(defvalue: SCR_EDestructionResponseIndex.AUTOMATIC.ToString(), desc: "Value that will be used for the physics response index at this phase.\nWhen AUTOMATIC is used then response index will be set to the value between HUGE_DESTRUCTIBLE and TINY_DESTRUCTIBLE based on the ratio of current health to the max health", uiwidget: UIWidgets.ComboBox, enumType: SCR_EDestructionResponseIndex)]
13 SCR_EDestructionResponseIndex m_ePhysicalResponseIndex;
14
17
18 //------------------------------------------------------------------------------------------------
19 // Resolve phase model path and remap string from m_sPhaseModel without loading resources.
20 // Returns true only if a non-empty modelPath was resolved.
21 // Note: Exposed for DestructibleEntity call sites.
22 bool GetPhaseModelAndRemap(out ResourceName modelPath, out string remap, ResourceName parentPrefabPath = ResourceName.Empty)
23 {
24 modelPath = ResourceName.Empty;
25 remap = string.Empty;
26
27 if (!m_sPhaseModel || m_sPhaseModel == ResourceName.Empty)
28 return false;
29
30 SCR_Global.GetModelAndRemapFromResource(m_sPhaseModel, modelPath, remap);
31
32 // Parent material remap inheritance (optional, controlled by phase attribute)
33 if (m_bUseMaterialFromParent && parentPrefabPath && parentPrefabPath != ResourceName.Empty)
34 {
35 ResourceName modelPathSource;
36 string remapParent;
37 SCR_Global.GetModelAndRemapFromResource(parentPrefabPath, modelPathSource, remapParent);
38
39 // If phase already has a remap, sanitize against parent; otherwise take parent remap directly
40 if (!remap.IsEmpty())
41 {
42 remap = SCR_DestructionUtility.SanitizeRemapString(remap, remapParent);
43 }
44 else
45 {
46 remap = remapParent;
47 }
48 }
49
50 return modelPath && modelPath != ResourceName.Empty;
51 }
52
53 //------------------------------------------------------------------------------------------------
55 {
57 return m_PhaseModelCache;
58
59 m_ResourceCache = Resource.Load(m_sPhaseModel);
60 if (!m_ResourceCache)
61 return null;
62
63 BaseResourceObject resourceObject = m_ResourceCache.GetResource();
64 if (!resourceObject)
65 return null;
66
67 m_PhaseModelCache = resourceObject.ToVObject();
68 return m_PhaseModelCache;
69 }
70}
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Object holding reference to resource. In destructor release the resource.
Definition Resource.c:25
bool GetPhaseModelAndRemap(out ResourceName modelPath, out string remap, ResourceName parentPrefabPath=ResourceName.Empty)
static string SanitizeRemapString(string originalRemap, string newRemap)
static bool GetModelAndRemapFromResource(ResourceName resourcePath, out ResourceName modelPath, out string remap)
Read the input resource and returns whether a model was successfully found, filling the output model ...
Definition Functions.c:1455
Visual object.
Definition VObject.c:14
SCR_FieldOfViewSettings Attribute