Example #1
0
        public void removeShieldArea(String name)
        {
            AirstreamShieldArea area = shieldedAreas.Find(m => m.name == name);

            if (area != null)
            {
                shieldedAreas.Remove(area);
            }
            needsUpdate = true;
        }
Example #2
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));
 }
Example #3
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;
        }