Beispiel #1
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 #2
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 #3
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)); // 啟動協程
 }