// Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        missionAccomplishedLabel = FindNode("MissionAccomplished") as Label;
        shipName         = FindNode("ShipName") as Label;
        timeTakenData    = FindNode("TimeTakenData") as Label;
        damageTakenData  = FindNode("DamageTakenData") as Label;
        collisionsNumber = FindNode("CollisionsNumber") as Label;
        torpedoesFired   = FindNode("TorpedoesFired") as Label;
        scanEnergyUsed   = FindNode("ScanEnergyUsed") as Label;
        jumpCost         = FindNode("JumpCost") as Label;

        shipInfoPanels = GetParent().FindNode("ShipInfoPanels") as ShipInfoPanels;
        shipInfoPanels.FocusShipChanged += HandleFocusShipChanged;
        HandleFocusShipChanged(null, shipInfoPanels.FocusShip);

        var gameCore = FindParent("GameCore") as GameCore;

        if (focusShip == null)
        {
            missionAccomplishedLabel.Text = "---";
            shipName.Text         = "---";
            timeTakenData.Text    = "---";
            damageTakenData.Text  = "---";
            collisionsNumber.Text = "---";
            torpedoesFired.Text   = "---";
            scanEnergyUsed.Text   = "---";
            jumpCost.Text         = "---";
            return;
        }
    }
예제 #2
0
 void SetupNodeReferences()
 {
     shipInfoPanels        = FindNode("ShipInfoPanels") as ShipInfoPanels;
     hudRoot               = GetNode <CanvasLayer>("HUD");
     helpUI                = FindNode("HelpUI") as Control;
     mainCamera            = GetNode <MainCamera>("MainCamera");
     missionAccomplishedUI = FindNode("MissionAccomplishedUI") as MissionAccomplishedUI;
 }