Beispiel #1
0
 /// <summary>
 /// 顯示擊中文字,傳入[數字][擊中類型]
 /// </summary>
 public static void ShowHitText(Chara _cahra, int _value, HitTextType _type, float _showDelay)
 {
     if (!Isinit)
     {
         return;
     }
     if (HitTextList.Count == 0)
     {
         SpawnHitText().Show(_cahra, _value, _type, _showDelay);
     }
     else
     {
         bool isShowed = false;
         for (int i = 0; i < HitTextList.Count; i++)//用迴圈找可以播放的文字物件
         {
             if (!HitTextList[i].IsShowing)
             {
                 HitTextList[i].Show(_cahra, _value, _type, _showDelay);
                 isShowed = true;
                 break;
             }
         }
         if (!isShowed)//isShowed為false代表目前的文字物件都在播放,創造新的文字物件並播放
         {
             SpawnHitText().Show(_cahra, _value, _type, _showDelay);
         }
     }
 }
Beispiel #2
0
 /// <summary>
 /// 對角色造成物理傷害,傳入[造成的傷害][是否在ICON顯示效果動畫]
 /// </summary>
 public virtual void ReceivePhysicalDamge(int _damage, bool _showIconAni, HitTextType _hitTextType, float _showDelay)
 {
     //不可對死者進行攻擊
     if (!IsAlive)
     {
         return;
     }
     //傷害不小於等於0
     if (_damage <= 0)
     {
         return;
     }
     //傷害最大等於剩餘血量
     if (CurHP - _damage < 0)
     {
         _damage = CurHP;
     }
     CurHP -= _damage;
     HitTextController.ShowHitText(this, _damage, _hitTextType, _showDelay);
     UpdateHealthRatio();
     //更新腳色介面
     CharaDataUI.UpdateHealth(Index);
     //檢查是否存活
     AliveCheck();
 }
 /// <summary>
 /// 對角色造成物理傷害,傳入[造成的傷害][是否在ICON顯示效果動畫]
 /// </summary>
 public override void ReceivePhysicalDamge(int _damage, bool _showIconAni, HitTextType _hitTextType, float _showDelay)
 {
     base.ReceivePhysicalDamge(_damage, _showIconAni, _hitTextType, _showDelay);
     //是否在Icon顯示腳色被擊中效果
     if (_showIconAni)
         CharaDataUI.ShowDamageAni(Index);
 }
 /// <summary>
 /// 顯示擊中文字,傳入[數字][擊中類型]
 /// </summary>
 public static void ShowHitText(Chara _cahra, int _value, HitTextType _type, float _showDelay)
 {
     if (!Isinit)
         return;
     if (HitTextList.Count == 0)
     {
         SpawnHitText().Show(_cahra, _value, _type, _showDelay);
     }
     else
     {
         bool isShowed = false;
         for (int i = 0; i < HitTextList.Count; i++)//用迴圈找可以播放的文字物件
         {
             if (!HitTextList[i].IsShowing)
             {
                 HitTextList[i].Show(_cahra, _value, _type, _showDelay);
                 isShowed = true;
                 break;
             }
         }
         if (!isShowed)//isShowed為false代表目前的文字物件都在播放,創造新的文字物件並播放
         {
             SpawnHitText().Show(_cahra, _value, _type, _showDelay);
         }
     }
 }
Beispiel #5
0
 /// <summary>
 /// 對角色造成治癒,傳入[造成的治癒][是否在ICON顯示效果動畫]
 /// </summary>
 public override void ReceiveCure(int _cure, bool _showIconAni, HitTextType _hitTextType, float _showDelay)
 {
     base.ReceiveCure(_cure, _showIconAni, _hitTextType, _showDelay);
     if (_showIconAni)
     {
         CharaDataUI.ShowHealingHealthAni(Index);
     }
 }
Beispiel #6
0
 /// <summary>
 /// 對角色造成物理傷害,傳入[造成的傷害][是否在ICON顯示效果動畫]
 /// </summary>
 public override void ReceivePhysicalDamge(int _damage, bool _showIconAni, HitTextType _hitTextType, float _showDelay)
 {
     base.ReceivePhysicalDamge(_damage, _showIconAni, _hitTextType, _showDelay);
     //是否在Icon顯示腳色被擊中效果
     if (_showIconAni)
     {
         CharaDataUI.ShowDamageAni(Index);
     }
 }
Beispiel #7
0
 /// <summary>
 /// 顯示傷害擊中文字,傳入[腳色][傷害數值][擊中類型][延遲顯示]
 /// </summary>
 public void Show(Chara _target, int _value, HitTextType _type, float _showDelay)
 {
     if (!IsInit)
         return;
     IsShowing = true;
     Type = _type;
     Target = _target;
     Value = _value;
     MyGameobject.SetActive(true);//先啟動gameobject不然不能執行Coroutine
     Go_Motion.SetActive(false);//先隱藏文字
     StartCoroutine(ShowCoroutine(_showDelay));
 }
Beispiel #8
0
 /// <summary>
 /// 顯示傷害擊中文字,傳入[腳色][傷害數值][擊中類型][延遲顯示]
 /// </summary>
 public void Show(Chara _target, int _value, HitTextType _type, float _showDelay)
 {
     if (!IsInit)
     {
         return;
     }
     IsShowing = true;
     Type      = _type;
     Target    = _target;
     Value     = _value;
     MyGameobject.SetActive(true); //先啟動gameobject不然不能執行Coroutine
     Go_Motion.SetActive(false);   //先隱藏文字
     StartCoroutine(ShowCoroutine(_showDelay));
 }
Beispiel #9
0
 /// <summary>
 /// 對角色造成治癒,傳入[造成的治癒][是否在ICON顯示效果動畫]
 /// </summary>
 public virtual void ReceiveCure(int _cure, bool _showIconAni, HitTextType _hitTextType, float _showDelay)
 {
     //不可對死者進行治癒
     if (!IsAlive)
         return;
     //治癒量不可小於等於0
     if (_cure <= 0)
         return;
     //治癒量大於損失的血量
     if (CurHP + _cure > MaxHP)
         _cure = MaxHP - CurHP;
     CurHP += _cure;
     UpdateHealthRatio();
     HitTextController.ShowHitText(this, _cure, _hitTextType, _showDelay);
     //更新腳色介面
     CharaDataUI.UpdateHealth(Index);
 }
Beispiel #10
0
 /// <summary>
 /// 對角色造成物理傷害,傳入[造成的傷害][是否在ICON顯示效果動畫]
 /// </summary>
 public virtual void ReceivePhysicalDamge(int _damage, bool _showIconAni, HitTextType _hitTextType, float _showDelay)
 {
     //不可對死者進行攻擊
     if (!IsAlive)
         return;
     //傷害不小於等於0
     if (_damage <= 0)
         return;
     //傷害最大等於剩餘血量
     if (CurHP - _damage < 0)
         _damage = CurHP;
     CurHP -= _damage;
     HitTextController.ShowHitText(this, _damage, _hitTextType, _showDelay);
     UpdateHealthRatio();
     //更新腳色介面
     CharaDataUI.UpdateHealth(Index);
     //檢查是否存活
     AliveCheck();
 }
Beispiel #11
0
 /// <summary>
 /// 對角色造成治癒,傳入[造成的治癒][是否在ICON顯示效果動畫]
 /// </summary>
 public virtual void ReceiveCure(int _cure, bool _showIconAni, HitTextType _hitTextType, float _showDelay)
 {
     //不可對死者進行治癒
     if (!IsAlive)
     {
         return;
     }
     //治癒量不可小於等於0
     if (_cure <= 0)
     {
         return;
     }
     //治癒量大於損失的血量
     if (CurHP + _cure > MaxHP)
     {
         _cure = MaxHP - CurHP;
     }
     CurHP += _cure;
     UpdateHealthRatio();
     HitTextController.ShowHitText(this, _cure, _hitTextType, _showDelay);
     //更新腳色介面
     CharaDataUI.UpdateHealth(Index);
 }
Beispiel #12
0
 /// <summary>
 /// 對角色造成治癒,傳入[造成的治癒][是否在ICON顯示效果動畫]
 /// </summary>
 public override void ReceiveCure(int _cure, bool _showIconAni, HitTextType _hitTextType, float _showDelay)
 {
     base.ReceiveCure(_cure, _showIconAni, _hitTextType, _showDelay);
     if (_showIconAni)
         CharaDataUI.ShowHealingHealthAni(Index);
 }