Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        playerCamera = GameObject.Find("MainCamera");

        if (uiKnifeMarker == null)
        {
            throw new MissingReferenceException("No knife marker object given.");
        }

        knifeMarker = uiKnifeMarker.GetComponent <KnifeMarker>();
        knifeMarker.SetColours(baseUiColor, altUiColor);

        playerKnifeController = playerCamera.GetComponent <PlayerKnifeController>();

        player      = GameObject.FindGameObjectWithTag("Player");
        playerMotor = player.GetComponent <PlayerMotor>();

        // health variables
        healthUI.color           = healthBaseColor;
        healthTransitionUI.color = healthDecayColor;

        //currentHealth = playerMotor.GetHealthNormalised();
        currentHealth    = 1f;
        healthTransition = currentHealth;

        // energy variables
        energyUI.color           = energyBaseColor;
        energyTransitionUI.color = energyDecayColor;

        //currentEnergy = playerMotor.GetEnergyNormalised();
        currentEnergy    = 1f;
        energyTransition = currentEnergy;

        // Warp variables
        warpUI.color          = warpBaseColor;
        warpRechargeUI.color  = warpRechargeColor;
        warpCountdownUI.color = warpCountdownColor;

        currentWarps         = playerKnifeController.GetWarpsNormalised();
        currentWarpRecharge  = playerKnifeController.GetWarpRechargeNormalised();
        currentWarpCountdown = playerKnifeController.GetWarpCountdownNormalised();
    }
Exemplo n.º 2
0
 private void UpdateWarp()
 {
     currentWarps         = playerKnifeController.GetWarpsNormalised();
     currentWarpRecharge  = 1 - playerKnifeController.GetWarpRechargeNormalised();
     currentWarpCountdown = playerKnifeController.GetWarpCountdownNormalised();
 }