Beispiel #1
0
    public void Damage(float power)
    {
        damage                      = power;
        currentHp                  -= damage;
        hp_Bar.fillAmount           = currentHp / maxHP;
        Canvas_UI_Hp_Bar.fillAmount = currentHp / maxHP;
        //hp_Text.text = currentHp.ToString("N1") + " HP";
        hp_Text.text = CountModule(currentHp) + " HP";
        damageText.DamageUI();

        this.GetComponent <Animator>().Rebind();
        this.GetComponent <Animator>().Play("Damage");
    }
Beispiel #2
0
    public void Damage(float power)
    {
        damage                      = power;
        currentHp                  -= damage;
        hp_Bar.fillAmount           = currentHp / maxHP;
        Canvas_UI_Hp_Bar.fillAmount = currentHp / maxHP;
        //hp_Text.text = currentHp.ToString("N1") +" HP";
        hp_Text.text = CountModule(currentHp) + " HP";
        damageText.DamageUI();

        this.GetComponent <Animator>().Rebind();
        this.GetComponent <Animator>().Play("Damage");

        /*if (currentHp <= 0)
         * {
         *
         *  stageManager.smallstageCount = stageManager.smallstageCount + 1;
         *  stageManager.smallStageChange();
         *  for (int i = 0; i < 10; i++) {
         *
         *      int randomGold = Random.Range(stageManager.mainStageCount, (stageManager.mainStageCount + stageManager.mainStageCount) + 1);
         *      player.gold = player.gold + (randomGold * 2);
         *      player.goldText.text = player.gold.ToString();
         *  }
         *
         *  if (stageManager.currentBonusTime<= stageManager.maxBonusTime)
         *  {
         *      stageManager.currentBonusTime += 0.5f;
         *      stageManager.bonusTimerBar.fillAmount = stageManager.currentBonusTime/ stageManager.maxBonusTime;
         *  }
         *
         *  smallStageMenu_Setting.foodChangeIndex++;
         *  smallStageMenu_Setting.Food_Change();
         *
         * }*/
    }