示例#1
0
        public void IrradiateOnce(int count)
        {
            RadiationTracker rt     = Core.Instance.getRT(vessel);
            double           energy = 180.0 + Core.Instance.mRandom.NextDouble() * 400.0; // slightly higher energy than solar

            rt.IrradiateFromPart(count, energy, part);
        }
示例#2
0
    public void Init(Inventory inv, RadiationTracker radTrack)
    {
        active_inventory = inv;
        // Remove first since UI is not being pooled
        active_inventory.onInventoryChanged -= OnInventoryChanged;
        radTrack.onRadChange -= OnRadChange;

        active_inventory.onInventoryChanged += OnInventoryChanged;
        radTrack.onRadChange += OnRadChange;

        // to hide main menu set this key press
        if (mainMenuFaded == false)
        {
            KeyInputController.instance.onInteractBttnPressed += FadeMainMenu;
        }
    }
示例#3
0
 public override void Window(int id)
 {
     GUILayout.BeginVertical();
     {
         Vessel active = FlightGlobals.ActiveVessel;
         if (active == null && PlanetariumCamera.fetch.target.type == MapObject.MapObjectType.VESSEL)
         {
             active = PlanetariumCamera.fetch.target.vessel;
         }
         RadiationTracker rt = Core.Instance.getRT(active);
         if (!object.ReferenceEquals(rt, null))
         {
             GUILayout.Label("Kappa-Ray Fluxes", mHeadingStyle);
             List <KeyValuePair <string, double> > rows = new List <KeyValuePair <string, double> >();
             rows.Add(new KeyValuePair <string, double>("Van Allen:", rt.lastV));
             rows.Add(new KeyValuePair <string, double>("Solar:", rt.lastS));
             rows.Add(new KeyValuePair <string, double>("Galactic:", rt.lastG));
             foreach (KeyValuePair <string, double> kvp in rows)
             {
                 GUILayout.BeginHorizontal();
                 GUILayout.Label(kvp.Key, mKeyStyle);
                 GUILayout.Label(String.Format("{0:F3}", kvp.Value), mValueStyle);
                 GUILayout.EndHorizontal();
             }
         }
         if (GUILayout.Button("Show Roster"))
         {
             Core.Instance.ShowRoster();
         }
         string ableMsg = Core.Instance.radiationEnabled ? "Disable k-ray" : "Enable k-ray";
         if (GUILayout.Button(ableMsg))
         {
             Core.Instance.radiationEnabled = !Core.Instance.radiationEnabled;
         }
     }
     GUILayout.EndVertical();
     base.Window(id);
 }
示例#4
0
    public void Init(Inventory inventory, float moveSpeed)
    {
        speed            = moveSpeed;
        areaController   = AreaController.instance;
        areaWidth        = areaController.active_area.Width - 1;
        areaHeight       = areaController.active_area.Height - 1;
        mouse_controller = MouseInputController.instance;
        mouse_controller.onRightClick += TryInteract;
        key_controller = KeyInputController.instance;
        key_controller.onKeyPressed          += OnMove;
        key_controller.onKeyHeld             += Move;
        key_controller.onKeyUp               += OnMoveStop;
        key_controller.onInteractBttnPressed += TryInteract;

        SetAnimParams(0, 0);
        Camera_Controller.instance.SetTargetAndLock(this.transform, 0, areaWidth, 0, areaHeight);
        OnChangeArea();
        heroInventory     = inventory;
        radiation_tracker = new RadiationTracker(heroInventory);
        InventoryUI.instance.Init(heroInventory, radiation_tracker);
        move_x = transform.position.x;
        move_y = transform.position.y;
        GetComponent <HeroAttackController>().Init();
    }