Exemplo n.º 1
0
 public void addShieldArea(String name, float topRad, float bottomRad, float topY, float bottomY, bool topNode, bool bottomNode)
 {
     AirstreamShieldArea area = shieldedAreas.Find(m => m.name == name);
     if (area != null) { shieldedAreas.Remove(area); }
     area = new AirstreamShieldArea(name, topRad, bottomRad, topY, bottomY, topNode, bottomNode);
     shieldedAreas.Add(area);
     needsUpdate = true;
 }
Exemplo n.º 2
0
        public void removeShieldArea(String name)
        {
            AirstreamShieldArea area = shieldedAreas.Find(m => m.name == name);

            if (area != null)
            {
                shieldedAreas.Remove(area);
            }
            needsUpdate = true;
        }
Exemplo n.º 3
0
 public override void OnStart(StartState state)
 {
     base.OnStart(state);
     if (topRadius != 0 && bottomRadius != 0)//add a shield based on base config params
     {
         baseArea = new AirstreamShieldArea("baseArea", topRadius, bottomRadius, topY, bottomY, useAttachNodeTop, useAttachNodeBottom);
         shieldedAreas.AddUnique(baseArea);
     }
     //TODO check config node for additional shield defs; persist these regardless of external modules
     GameEvents.onEditorShipModified.Add(new EventData <ShipConstruct> .OnEvent(onEditorVesselModified));
     GameEvents.onVesselWasModified.Add(new EventData <Vessel> .OnEvent(onVesselModified));
 }
Exemplo n.º 4
0
 public override void OnStart(StartState state)
 {
     base.OnStart(state);
     if (topRadius != 0 && bottomRadius != 0)//add a shield based on base config params
     {
         baseArea = new AirstreamShieldArea("baseArea", topRadius, bottomRadius, topY, bottomY, useAttachNodeTop, useAttachNodeBottom);
         shieldedAreas.AddUnique(baseArea);
     }
     //TODO check config node for additional shield defs; persist these regardless of external modules
     GameEvents.onEditorShipModified.Add(new EventData<ShipConstruct>.OnEvent(onEditorVesselModified));
     GameEvents.onVesselWasModified.Add(new EventData<Vessel>.OnEvent(onVesselModified));
 }
Exemplo n.º 5
0
 public void addShieldArea(String name, float topRad, float bottomRad, float topY, float bottomY, bool topNode, bool bottomNode)
 {
     AirstreamShieldArea area = shieldedAreas.Find(m => m.name == name);
     if (area != null) { shieldedAreas.Remove(area); }
     area = new AirstreamShieldArea(name, topRad, bottomRad, topY, bottomY, topNode, bottomNode);
     shieldedAreas.Add(area);
     needsUpdate = true;
 }