void Start()
 {
     pmp = this;
     tb = GetComponentInChildren<dfTabContainer>();
     control = GetComponent<dfControl>();
     tween1 = GetComponent<dfTweenVector3>();
     tween2 = GetComponent<dfTweenFloat>();
     apb = GetComponentInChildren<aPowerBar>();
     MenuCamera.mc.showShipManagement += Show;
     MenuCamera.mc.hideShipManagement += Hide;
 }
	// Update is called once per frame
    public void setReadouts()
    {
        switch (systemType)
        {
            case ShipSystem.SystemType.Shields:
                shield = PlayerController.PC.shieldRef;
                system = (ShipSystem)shield;
                type.Display("Shields");
                classification.Display(shield.getComponentClass());
                field1.Display(shield.RegenRate + "/second");
                field2.Display(shield.RegenDelay + " seconds");
                power.Display(shield.PowerAllocation);
                icon.SpriteName = shield.Icon;
                break;
            case ShipSystem.SystemType.PointDefenseSystem:
                pds = PlayerController.PC.pdsref;
                system = (ShipSystem)pds;
                type.Display("Point Defense System");              
                classification.Display(pds.getComponentClass());
                field1.Display(pds.MissileDestroyTime + " seconds");
                field2.Display(pds.Range);
                power.Display(pds.PowerAllocation);
                icon.SpriteName = pds.Icon;
                break;
            case ShipSystem.SystemType.Engine:
                engine = PlayerController.PC.engineRef;
                system = (ShipSystem)engine;
                type.Display("Engines");  
                classification.Display(engine.getComponentClass());
                field1.Display(engine.Speed);
                field2.Display(engine.CanBoost);
                field3.Display(engine.BoostDuration + " seconds");
                power.Display(engine.PowerAllocation);
                icon.SpriteName = engine.Icon;
                break;
            case ShipSystem.SystemType.PowerGenerator:
                pg = PlayerController.PC.powerGenerator;
                if (apb == null)
                {
                    apb = GetComponentInChildren<aPowerBar>();
                    apb.initalize();
                }
                type.Display("Power Generator");
                classification.Display(pg.getComponentClass());
                field1.Display(pg.MaxAvailablePower);
                field2.Display(pg.AvailablePower);
                field3.Display(pg.powerProfiles);
                apb.updateValue();
                description.Display(pg.getDescription());
                upgradeDesc.Display(pg.getUpgradeDescription());
                icon.SpriteName = pg.Icon;
                costValue = pg.upgradeCost;
                break;    
        }
        if (system != null)
        {
            costValue = system.upgradeCost;
            description.Display(system.Description);
            upgradeDesc.Display(system.UpgradeDescription);
        }
        cost.Display(costValue);

    }