コード例 #1
0
 void Start()
 {
     if (staminaBar != null)
     {
         staminaBar.SetMaxStamina(PlayerStats.instance.maxStamina);
     }
 }
コード例 #2
0
 void Awake()
 {
     //Obtains the player
     player = GameObject.FindGameObjectWithTag("Player");
     //Obtains the health atributes
     playerHealth    = player.GetComponent <Health>();
     playerHealthBar = GetComponentInChildren <HealthBar>();
     playerHealthBar.SetMaxHealth(playerHealth.GetMaxHealth());
     playerHealthBar.SetCurrentHealth(GameManager.instance.data.HasPlayerData() ? GameManager.instance.GetCurrentPlayerHealth() : playerHealth.GetMaxHealth());
     //Obtains the stamina atributes
     playerStamina    = player.GetComponent <Stamina>();
     playerStaminaBar = GetComponentInChildren <StaminaBar>();
     playerStaminaBar.SetMaxStamina(playerStamina.GetMaxStamina());
     playerStaminaBar.SetCurrentStamina(playerStamina.GetMaxStamina());
     //Disable the panels
     npcNamePanel.SetActive(false);
     textPanel.SetActive(false);
     introTextPanel.SetActive(false);
     savePanel.SetActive(false);
     unlockWeaponPanel.SetActive(false);
     deathPanel.SetActive(false);
     outOfAmmoPanel.SetActive(false);
     sentenceOptionsPanel.SetActive(false);
     fuelBarUI.SetActive(false);
 }
コード例 #3
0
    void Start()
    {
        spriteRenderer = GetComponent <SpriteRenderer>();

        player = GetComponentInParent <playerMovement>();

        waitTime = currentWeapon.delay;
        staminaBar.SetMaxStamina(currentWeapon.delay);

        damageText.text = "DAMAGE: " + (damageBonus + currentWeapon.damage).ToString();

        hasRevived = false;

        gameManager = GameObject.FindObjectOfType <GameManager>();
        damageBonus = gameManager.startingDamage;
    }
コード例 #4
0
 void Start()
 {
     Stamina = MaxStamina;
     StaminaBar.SetMaxStamina(Stamina);
     anim                = GetComponent <Animator>();
     SpeedNumber.text    = RunSpeed.ToString();
     StrengthNumber.text = Strength.ToString();
 }
コード例 #5
0
        private void Start()
        {
            currentStamina = Mathf.Clamp(currentStamina, 0f, maxStamina);

            currentStamina = maxStamina;

            staminaBar.SetMaxStamina(maxStamina);
        }
コード例 #6
0
    private void Start()
    {
        animator      = GetComponent <Animator>();
        currentHealth = maxHealth;
        healthBar.SetMaxHealth(maxHealth);

        currentStamina = maxStamina;
        staminaBar.SetMaxStamina(maxStamina);
    }
コード例 #7
0
ファイル: Punch.cs プロジェクト: Epiczd/Prototypes
    //On start, the player's fist is not drawn, and is disabled
    void Start()
    {
        for (int i = 0; i < playersFist.Length; i++)
        {
            playersFist[i].SetActive(false);
            playerSecondFist[i].SetActive(false);
        }

        maxStamina = Stamina;
        staminaBar.SetMaxStamina(maxStamina);
    }
コード例 #8
0
ファイル: PlayerStats.cs プロジェクト: kenttim/MAGD488
    void Start()
    {
        maxHealth     = SetMaxHealthFromHealthLevel();
        currentHealth = maxHealth;
        healthbar.SetMaxHealth(maxHealth);
        healthbar.SetCurrentHealth(currentHealth);

        maxStamina     = SetMaxStaminaFromStaminaLevel();
        currentStamina = maxStamina;
        staminabar.SetMaxStamina(maxStamina);
        staminabar.SetCurrentStamina(currentStamina);
    }
コード例 #9
0
        // Start is called before the first frame update
        void Start()
        {
            enduranceMultiplier = playerStats.enduranceBuff;

            maxHealth  = playerStats.health;
            maxStamina = playerStats.stamina;

            hb.SetMaxHealth(maxHealth);
            sb.SetMaxStamina(maxStamina);
            currentHealth  = maxHealth;
            currentStamina = maxStamina;
        }
コード例 #10
0
 void Start()
 {
     currentXP = 0;
     XPBar.SetMaxXP(MaxXP);
     currentStamina = MaxStamina;
     staminaBar.SetMaxStamina(MaxStamina);
     currentHealth = maxHealth;
     healthBar.SetMaxhealth(maxHealth);
     currentShield = MaxShield;
     shieldbar.SetMaxShield(MaxShield);
     gold = 0;
 }
コード例 #11
0
    private void Awake()
    {
        RefreshUpgrades();

        health.SetHealth(maxHealth);

        stam.SetStaminaRegenAmount(_stamRegenAmount);
        stam.SetMaxStamina(maxStam);

        rb     = this.gameObject.GetComponent <Rigidbody2D>();
        _money = 0;
    }
コード例 #12
0
    // Start is called before the first frame update
    void Start()
    {
        FLAGGuende        = false;
        FLAGFuego         = false;
        maxHealth         = SetMaxHealthFromHelathLevel(); // set la vida maxima que tendra el personaje dependido del healthLevel
        currentHealth     = maxHealth;                     //indico al iniciar que la vida esta al maximo
        extraHealth       = 0;
        extraHealthActive = false;
        healthBar.SetMaxHealth(maxHealth);                      //le indico a la barra de saluda su valor
        //stamina
        maxStamina = SetMaxStaminaFromStaminaLevel();           //recoger stamina amxima
        staminaBar.SetMaxStamina(Mathf.RoundToInt(maxStamina)); //inicializar valor maximo stamina
        currentStamina = maxStamina;                            //inicializar al principio el stamina maximo
        //monedas
        moneyBar = FindObjectOfType <MoneyBar>();
        BarraMonedas.SetActive(false);
        contadorMonedas = 0;
        playerManager   = GetComponent <PlayerManager>();

        playerLocomotion = GetComponent <PlayerLocomotion>();
        normalSpeed      = playerLocomotion.movementSpeed;
        rollSpeed        = playerLocomotion.sprintSpeed;
    }