1[
ComponentEditorProps(
category:
"GameScripted/Spectating", description:
"Displays a colored sphere over an entity - if FactionAffiliationComponent is present")]
11 private ref
Shape m_Shape = null;
12 private ref
Shape m_ShapeHealth = null;
13 private ref
Shape m_ShapeHealthBackground = null;
14 private float m_DistanceToCamera = 0.0;
39 if (m_ShapeHealthBackground)
41 delete m_ShapeHealthBackground;
42 m_ShapeHealthBackground = null;
47 if (m_DamageManagerComponent)
49 EDamageState state = m_DamageManagerComponent.GetState();
62 if (m_ShapeHealthBackground)
64 delete m_ShapeHealthBackground;
65 m_ShapeHealthBackground = null;
77 m_Entity.GetWorld().GetCurrentCamera(camMat);
84 if (m_DistanceToCamera == 0)
86 else if (m_DistanceToCamera > 0)
100 if (affiliatedFaction)
101 color = affiliatedFaction.GetFactionColor().PackToInt();
124 int textcolor = color;
136 float health = m_DamageManagerComponent.GetHealthScaled();
152 minAbsolute[2] = 0.001;
155 m_ShapeHealthBackground =
Shape.Create(
ShapeType.BBOX,
ARGB(255,255,255,255), 0, minAbsolute, maxAbsolute);
156 m_ShapeHealthBackground.SetMatrix(mat);
157 m_ShapeHealth =
Shape.Create(
ShapeType.BBOX, hpcolor, 0, min, max);
158 m_ShapeHealth.SetMatrix(mat);
163 delete m_ShapeHealth;
164 if (m_ShapeHealthBackground)
165 delete m_ShapeHealthBackground;
173 super.OnPostInit(owner);
182 void SCR_UnitDisplayComponent(IEntityComponentSource src,
IEntity ent,
IEntity parent)
184 GenericEntity genEnt = GenericEntity.Cast(ent);
188 m_DamageManagerComponent = DamageManagerComponent.Cast(genEnt.
FindComponent(DamageManagerComponent));
SCR_EAIThreatSectorFlags flags
void CreateSimpleText(string text, vector mat[4], float size, int color, ShapeFlags flags, array< ref Shape > output=null, float scaleWidth=1, bool doBackground=false, int backgroundColor=0x80000000)
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
enum EAITargetInfoCategory m_Entity
SCR_UnitDisplayComponentClass m_FactionAffiliatonComponent
enum EVehicleType IEntity
proto external int SetEventMask(notnull IEntity owner, int mask)
proto external Managed FindComponent(typename typeName)
proto external vector GetOrigin()
proto external void GetTransform(out vector mat[])
proto external string GetName()
void EOnFrame(IEntity owner, float timeSlice)
Instance of created debug visualizer.
EntityEvent
Various entity events.
proto native vector Vector(float x, float y, float z)
proto int ARGB(int a, int r, int g, int b)