Beispiel #1
0
    public override void Update()
    {
        base.Update();

        if (unlockTimer < unlockTime && unlocking)
        {
            ui.SetProgress((unlockTimer / unlockTime) * 100);
            unlockTimer += Time.deltaTime;
        }

        if (unlockTimer > unlockTime)
        {
            ui.SetProgress(100);
            player.gameObject.GetComponent <GatePlayer>().UnlockGate(gameObject);
            locked      = false;
            unlockTimer = unlockTime;
        }
    }
    void Update()
    {
        if (id.IsHunter() || !id.IsThisPlayer())
        {
            return;
        }

        if (sprintCooldownTimer >= sprintCooldownTime && Input.GetButtonUp("Fire2"))
        {
            sprinting           = true;
            sprintCooldownTimer = 0;
            movement.StartSprint();
            sfxManager.PlaySprint();
        }

        if (sprinting)
        {
            if (sprintTimer < sprintDuration)
            {
                sprintTimer += Time.deltaTime;
            }
            else if (sprintTimer >= sprintDuration)
            {
                movement.StopSprint();
                sprintTimer = 0;
                sprinting   = false;
            }
        }
        else
        {
            if (sprintCooldownTimer < sprintCooldownTime)
            {
                sprintCooldownTimer += Time.deltaTime;
            }
        }

        UIManager.instance.UpdateProgress((sprintCooldownTimer / sprintCooldownTime) * 100);
        ui.SetProgress((sprintCooldownTimer / sprintCooldownTime) * 100);
    }
Beispiel #3
0
    // Update is called once per frame
    void Update()
    {
        if (!id.IsHunter() || !id.IsThisPlayer())
        {
            return;
        }

        // May not be available on start, so we'll do it here instead
        if (!hidingManager)
        {
            if (PlayerManager.instance.otherPlayer)
            {
                hidingManager = PlayerManager.instance.otherPlayer.GetComponent <HidingManager>();
            }
        }

        if (echoCooldownTimer >= echoCooldownTime && Input.GetButtonUp("Fire2"))
        {
            UseEcho();
            echoCooldownTimer         = 0;
            echoMovementCooldownTimer = 0;
        }

        if (echoCooldownTimer < echoCooldownTime)
        {
            echoCooldownTimer += Time.deltaTime;
        }

        // Don't let the player move for a short time after using this ability
        if (echoMovementCooldownTimer < echoMovementCooldownTime)
        {
            echoMovementCooldownTimer += Time.deltaTime;
        }

        UIManager.instance.UpdateProgress((echoCooldownTimer / echoCooldownTime) * 100);
        ui.SetProgress((echoCooldownTimer / echoCooldownTime) * 100);
    }