public void ShowInfo(string type) //타워 UI 타워소개 UI tooltip { string tooltip = string.Empty; //툴팁 초기화 switch (type) //타워 타입별로 타워소개 tooltip이 달라짐 { case "Fire": FireTower fire = towerPrefab.GetComponentInChildren <FireTower>(); tooltip = string.Format("<color=#ffa500ff><size=1>불타워</size></color>\n공격력: {0} \n공격속도 : {1} \n디버프확률 : {2}% \n디버프 지속시간 : {3}초 \n지속데미지 : {4} \n디버프효과 : 지속시간 동안 적에게 지속데미지를 입힘", fire.Damage, fire.ProjectileSpeed, fire.Proc, fire.DebuffDuration, fire.TickDamage); break; case "Ice": IceTower ice = towerPrefab.GetComponentInChildren <IceTower>(); tooltip = string.Format("<color=#00ffffff><size=1>얼음타워</size></color>\n공격력: {0} \n공격속도 : {1} \n디버프확률 : {2}% \n디버프 지속시간 : {3}초 \n둔화율 : {4}% \n디버프효과 : 지속시간 동안 적에게 둔화효과 적용", ice.Damage, ice.ProjectileSpeed, ice.Proc, ice.DebuffDuration, ice.SlowingFactor); break; case "Poison": PoisonTower poison = towerPrefab.GetComponentInChildren <PoisonTower>(); tooltip = string.Format("<color=#00ff00ff><size=1>독타워</size></color>\n공격력: {0} \n공격속도 : {1} \n디버프확률 : {2}% \n표식개수(몬스터당) : {3}개 \n표식데미지 : {4} \n디버프효과 : 피해를 입은 몬스터가 지속시간동안 \n밟으면 데미지를 입히는 표식을 뿌림", poison.Damage, poison.ProjectileSpeed, poison.Proc, poison.DebuffDuration, poison.SplashDamage); break; case "Storm": StormTower storm = towerPrefab.GetComponentInChildren <StormTower>(); tooltip = string.Format("<color=#add8e6ff><size=1>번개타워</size></color>\n공격력: {0} \n공격속도 : {1} \n디버프확률 : {2}% \n스턴 지속시간 : {3}초 \n디버프효과 : 지속시간 동안 적에게 스턴효과 적용 ", storm.Damage, storm.ProjectileSpeed, storm.Proc, storm.DebuffDuration); break; default: break; } GameManager.Instance.SetTooltipText(tooltip); // 문자열 타입을 받아 text 정정 GameManager.Instance.ShowStats(); // 화면에 보이도록 active set }
public void ShowInfo(string type) { string tooltip = string.Empty; switch (type) { case "Fire": FireTower fire = towerPrefab.GetComponentInChildren <FireTower>(); tooltip = string.Format("<color=#ffa500ff><size=20><b>Fire Tower</b></size></color>\nDamage: {0} \nProc: {1}%\nDebuff Duration: {2}sec \nTick time: {3} sec \nTick damage: {4}\nCan apply fire damage to the target", fire.Damage, fire.Proc, fire.DebuffDuration, fire.TickTime, fire.TickDamage); break; case "Ice": IceTower frost = towerPrefab.GetComponentInChildren <IceTower>(); tooltip = string.Format("<color=#00ffffff><size=20><b>Frost Tower</b></size></color>\nDamage: {0} \nProc: {1}%\nDebuff Duration: {2}sec\nSlowing factor: {3}%\nHas a chance to slow down the target", frost.Damage, frost.Proc, frost.DebuffDuration, frost.SlowingFactor); break; case "Poison": PoisonTower poison = towerPrefab.GetComponentInChildren <PoisonTower>(); tooltip = string.Format("<color=#00ff00ff><size=20><b>Poison Tower</b></size></color>\nDamage: {0} \nProc: {1}%\nDebuff Duration: {2}sec \nTick time: {3} sec \nSplash damage: {4}\nCan apply dripping poison to the target", poison.Damage, poison.Proc, poison.DebuffDuration, poison.TickTime, poison.SplashDamage); break; case "Storm": StormTower storm = towerPrefab.GetComponentInChildren <StormTower>(); tooltip = string.Format("<color=#add8e6ff><size=20><b>Storm Tower</b></size></color>\nDamage: {0} \nProc: {1}%\nDebuff Duration: {2}sec\nHas a chance to stun the target", storm.Damage, storm.Proc, storm.DebuffDuration); break; } Game_Manager.Instance.SetToolTipText(tooltip); Game_Manager.Instance.ShowStats(); }
private void Awake() { if (!this.iceTower) { this.iceTower = GetComponent <IceTower>(); } if (this.attackSpeedTimer == null) { this.attackSpeedTimer = new Timer(this.AttackSpeed); } else { this.attackSpeedTimer.DefiniteTime = this.AttackSpeed; } this.attackSpeedTimer.AfterTime = Random.Range(0, this.attackSpeedTimer.DefiniteTime); }
private void SetIceTower(IceTower head) { iceTower=head; }