15 this.component = comp;
21 [
Attribute(defvalue:
"10", uiwidget: UIWidgets.Slider,
desc:
"Radius in which to open door.",
"0 1000 1")]
22 protected float m_fRadius;
24 [
Attribute(defvalue:
"1", uiwidget: UIWidgets.Slider,
desc:
"How much the doors should be opened",
"0. 1 0.01")]
25 protected float m_fControlValue;
28 private ref array<ref DoorStruct> m_aQueriedDoors;
31 private bool m_bVisualize;
35 private bool QueryEntities(IEntity e)
39 m_aQueriedDoors.Insert(
new DoorStruct(e, door));
45 private void GetDoors(
float radius)
47 BaseWorld world = GetWorld();
48 world.QueryEntitiesBySphere(
GetOrigin(), radius, QueryEntities);
52 override void EOnInit(IEntity owner)
55 RplComponent rplComponent = RplComponent.Cast(owner.FindComponent(RplComponent));
56 if (rplComponent && !rplComponent.IsMaster())
64 door.component.SetControlValue(m_fControlValue);
67 m_aQueriedDoors.Clear();
68 m_aQueriedDoors =
null;
80 SetEventMask(EntityEvent.INIT);
90 private void _CaptureDoors()
96 override bool _WB_OnKeyChanged(BaseContainer src,
string key, BaseContainerList ownerContainers, IEntity parent)
99 return super._WB_OnKeyChanged(src, key, ownerContainers, parent);
102 override void _WB_SetExtraVisualiser(EntityVisualizerType
type, IEntitySource src)
104 m_bVisualize =
false;
107 case EntityVisualizerType.EVT_NONE:
110 case EntityVisualizerType.EVT_NORMAL:
116 super._WB_SetExtraVisualiser(
type, src);
119 override void _WB_AfterWorldUpdate(
float timeSlice)
124 auto radiusShape = Shape.CreateSphere(COLOR_YELLOW, ShapeFlags.WIREFRAME | ShapeFlags.ONCE, origin,
m_fRadius);
128 auto arrowShape = Shape.CreateArrow(origin, door.owner.GetOrigin(), 0.1, COLOR_GREEN, ShapeFlags.ONCE);
132 super._WB_AfterWorldUpdate(timeSlice);