Beispiel #1
0
 /// <summary>
 /// 受傷
 /// </summary>
 /// <param name="damage"></param>
 public void Hit(float damage)
 {
     Hp -= damage;
     CastleLife.text = "Castle : " + Hp + " / 5000";
     hpValueManager.SetHP(Hp, 5000f);      // 更新血量(目前,最大)
     StartCoroutine(hpValueManager.ShowValue(damage, "-", Color.white));
     if (Hp <= 0)
     {
         Player.instance.LoseTheGame = true;          //如果Hp < 0 執行戰敗方法
     }
 }
Beispiel #2
0
    /// <summary>
    /// 受傷
    /// </summary>
    /// <param name="damage">造成的傷害</param>
    public void Hit(float damage)
    {
        hp -= damage;
        hpDamManager.UpdateHpBar(hp, data.hpMax);

        // 啟動協程(血量傷害值管理器.顯示數值(傷害值,-,1,白色))
        StartCoroutine(hpDamManager.ShowValue(damage, "-", Vector3.one, Color.white));

        if (hp <= 0)
        {
            Dead();
        }
    }
Beispiel #3
0
 /// <summary>
 /// 受傷
 /// </summary>
 /// <param name="damage">接收的傷害值</param>
 public void Hit(float damage)
 {
     if (ani.GetBool("死亡開關"))
     {
         return;                                                     // 如果 死亡開關 是勾選 跳出
     }
     data.hp -= damage;
     hpValueManager.SetHp(data.hp, data.hpMax);                          // 更新血量(目前,最大)
     StartCoroutine(hpValueManager.ShowValue(damage, "-", Color.white)); // 啟動協程
     if (data.hp <= 0)
     {
         Dead();
     }
 }
Beispiel #4
0
 public void Hit(float damage)
 {
     if (ani.GetBool("死亡開關"))
     {
         return;
     }
     data.hp -= damage;
     hpvaluemanager.SetHp(data.hp, data.maxHp);
     StartCoroutine(hpvaluemanager.ShowValue(damage, "-", Color.white));
     if (data.hp <= 0)
     {
         Dead();
     }
 }
Beispiel #5
0
 /// <summary>
 /// 受傷
 /// </summary>
 /// <param name="damage"></param>
 public void Hit(float damage)
 {
     if (dead)
     {
         return;
     }
     data.hp -= damage;
     hpValueManager.SetHP(data.hp, data.hpMax);      // 更新血量(目前,最大)
     StartCoroutine(hpValueManager.ShowValue(damage, "-", Color.white));
     if (data.hp <= 0)
     {
         Dead();               //如果Hp < 0 執行死亡方法
     }
 }
Beispiel #6
0
 /// <summary>
 /// 受傷
 /// </summary>
 /// <param name="damage">接收玩家給予的傷害值</param>
 public void Hit(float damage)
 {
     if (ani.GetBool("死亡開關"))
     {
         return;
     }
     StartCoroutine(AttackDelay());        //執行攻擊等待
     hp -= damage;
     hpValueManager.SetHP(hp, data.hpMax); // 更新血量(目前,最大)
     StartCoroutine(hpValueManager.ShowValue(damage, "-", Color.white));
     if (hp <= 0)
     {
         Dead();          //如果Hp < 0 執行死亡方法
     }
 }
Beispiel #7
0
 /// <summary>
 /// 受傷
 /// </summary>
 /// <param name="damage">接收玩家給予的傷害值</param>
 public void Hit(float damage)
 {
     if (dead)
     {
         return;                           //若已經死亡 return
     }
     StartCoroutine(AttackDelay());        //執行攻擊延遲
     hp -= damage;
     hpValueManager.SetHP(hp, data.hpMax); // 更新血量(目前,最大)
     StartCoroutine(hpValueManager.ShowValue(damage, "-", Color.white));
     if (hp <= 0)
     {
         Dead();          //若Hp < 0 執行死亡方法
     }
 }
Beispiel #8
0
 /// <summary>
 /// 受傷
 /// </summary>
 /// <param name="damage">接收的傷害值</param>
 public void Hit(float damage)
 {
     data.hp -= damage;
     hpValueManager.SetHp(data.hp, data.hpMax);                          // 更新血量(目前,最大)
     StartCoroutine(hpValueManager.ShowValue(damage, "-", Color.white)); // 啟動協程
 }