public override void HitDamage(float dmg, bool onedead = false) { if (GetStillAlive()) { HitEffect(); //SoundMng.Data.PlayEffectSound(EffectSound.Boss_Hit, 0, transform); if (Random.Range(0, 100) < _AvoidPer) { dmg = 0; } _NowHP -= dmg; DamageFont obj = ObjectPoolingMng.Data._DamageFontObjList[ObjectPoolingMng.Data.UseDamageFont()]; if (dmg < 1.0f && 0 < dmg) { obj.SetDamage(1, GetUnitHPPos() + new Vector2(0, 1), true); } else { obj.SetDamage((int)dmg, GetUnitHPPos() + new Vector2(0, 1), true); } if (_NowHP <= 0.0f) { DeadUnit(); if (_IsBoss) { StageMng.Data.LastBossDestroy(); } } } }
public void SetHeartPercent(int perc) { float dmg = (perc / 100.0f) * _MaxHP; float max = _MaxHP - _NowHP; _NowHP += dmg; if (_NowHP >= _MaxHP) { _NowHP = _MaxHP; } if (dmg > max) { dmg = max; } DamageFont obj = ObjectPoolingMng.Data._DamageFontObjList[ObjectPoolingMng.Data.UseDamageFont()]; if (dmg < 1.0f && 0 < dmg) { obj.SetDamage(1, GetUnitHPPos(), IsEnemy()); } else { obj.SetDamage((int)dmg, GetUnitHPPos(), IsEnemy()); } obj.IsHeal(); }
public virtual void HitDamage(float dmg, bool onedead = false) { if (GetStillAlive()) { HitEffect(); if (onedead) { dmg = _MaxHP; } _NowHP -= dmg; DamageFont obj = ObjectPoolingMng.Data._DamageFontObjList[ObjectPoolingMng.Data.UseDamageFont()]; if (dmg < 1.0f && 0 < dmg) { obj.SetDamage(1, GetUnitHPPos(), IsEnemy(), onedead); } else { obj.SetDamage((int)dmg, GetUnitHPPos(), IsEnemy(), onedead); } if (_NowHP <= 0.0f) { DeadUnit(); } } }
private void CreateDamageFont() { DamageFont dmgFont = Instantiate(DamageFontPrefab, this.transform); dmgFont.SpriteLoad("UI/DMG_Font_"); dmgFont.gameObject.SetActive(false); damageFontQueue.Enqueue(dmgFont); }
public void ShowDamage(int _damage, Vector3 _position, bool _bCritical) { GameObject damgeFontObj = ObjectPool.Inst.PopFromPool(damageFontName); damgeFontObj.SetActive(true); damgeFontObj.transform.position = _position; DamageFont damageFont = damgeFontObj.GetComponent <DamageFont>(); damageFont.DamageFontInit(damageFontOption); damageFont.SetDamage(_damage, _bCritical); }
public override void HitDamage(float dmg, bool onedead = false) { if (GetStillAlive()) { HitEffect(); SoundMng.Data.PlayEffectSound(EffectSound.Castle_Hit, 0, transform); _NowHP -= dmg; DamageFont obj = ObjectPoolingMng.Data._DamageFontObjList[ObjectPoolingMng.Data.UseDamageFont()]; obj.SetDamage((int)dmg, GetUnitHPPos() + new Vector2(0, 1), true); if (_NowHP <= 0.0f) { DeadUnit(); StageMng.Data.LastBossDestroy(); } } }
public static void Unload() { Subtitle.Dispose(); Title.Dispose(); Splash.Dispose(); MapSheet.Dispose(); MiniHP.Dispose(); HPMenu.Dispose(); Buttons.Dispose(); Shadows.Dispose(); Darkness.Dispose(); BattleFactors.Dispose(); Strip.Dispose(); Cursor.Dispose(); Arrows.Dispose(); PicBorder.Dispose(); MenuBorder.Dispose(); MenuBG.Dispose(); tileCache.Clear(); objectCache.Clear(); bgCache.Clear(); itemCache.Clear(); iconCache.Clear(); vfxCache.Clear(); portraitCache.Clear(); spriteCache.Clear(); DivTex.Dispose(); EXPFont.Dispose(); HealFont.Dispose(); DamageFont.Dispose(); DungeonFont.Dispose(); TextFont.Dispose(); SysFont.Dispose(); Pixel.Dispose(); defaultTex.Dispose(); Loaded = false; //Notify script engine LuaEngine.Instance.OnGraphicsUnload(); }
protected void TakeDamage(int _value) { Vector3 pos = Camera.main.WorldToScreenPoint(transform.position); DamageFont font = EffectManager.instance.MakeUIEffect("DamageFont").GetComponent <DamageFont>(); font.transform.position = pos; font.SetText(_value.ToString()); EffectManager.instance.MakeEffect("CFX4 Hit B (Orange)", transform.position, Quaternion.identity); state.recentHp -= _value; if (uiHpbar) { uiHpbar.RecentValue = state.recentHp; } if (state.recentHp <= 0) { state.recentHp = 0; DeadEvent(); } }
protected void TakeDamage(int _value) { Vector3 pos = Camera.main.WorldToScreenPoint(transform.position); DamageFont font = EffectManager.instance.MakeUIEffect("DamageFont").GetComponent <DamageFont>(); font.transform.position = pos; font.SetText(_value.ToString()); EffectManager.instance.MakeEffect("CFX_Hit_C White", transform.position); recentHP -= _value; if (uiHpbar) { uiHpbar.RecentValue = recentHP; } if (recentHP <= 0) { recentHP = 0; DeadEvent(); } }
protected void RestoreDamage(int _value) { if (died)//죽엇을경우 힐을 받을수없음 { return; } Vector3 pos = Camera.main.WorldToScreenPoint(transform.position); DamageFont font = EffectManager.instance.MakeUIEffect("HealFont").GetComponent <DamageFont>(); font.transform.position = pos; font.SetText(_value.ToString()); recentHP += _value; if (recentHP > MaxHP) { recentHP = MaxHP; } if (uiHpbar) { uiHpbar.RecentValue = recentHP; } }
public override void HitDamage(float dmg, bool onedead = false) { if (GetStillAlive()) { //SoundMng.Data.PlayEffectSound(EffectSound.MySoldier_Hit, 0, transform); HitEffect(); if (_ShapeType == 3 || SoldierShapeBuffMng.Data.GetShapeOn_Seven_Club()) { if (Random.Range(0, 100) < SoldierShapeBuffMng.Data._ClubData[UpgradeMng.Data._Level_Shape_Club - 1]) { dmg = 0; } } _NowHP -= dmg; DamageFont obj = ObjectPoolingMng.Data._DamageFontObjList[ObjectPoolingMng.Data.UseDamageFont()]; obj.SetDamage((int)dmg, GetUnitHPPos(), false); if (_NowHP <= 0.0f && !_Bursucker) { Bursucker(); } } }
public void ReturnDamageFont(DamageFont obj) { damageFontQueue.Enqueue(obj); }
private void GenerateDamageFont() { DamageFontPrefab = Resources.Load <DamageFont>("_Prefabs/UI/DamageFont"); SetDamageFont(); }