public void attackDragon() { if (target == null) { return; } DragonController dragonController = target.GetComponent <DragonController> (); int dmg = PlayManager.Instance.pushDamagePhysics(controller.attribute.ATK.Min, controller.attribute.ATK.Max, dragonController.attribute.DEF); dragonController.attribute.HP.Current -= dmg; //show collision PlayDragonManager.Instance.showEnemyAttackCollision(target); if (dragonController.attribute.HP.Current < 0) { dragonController.attribute.HP.Current = 0; } float valueTo = dragonController.attribute.HP.Current / (float)dragonController.attribute.HP.Max; dragonController.updateTextHP(); EffectSupportor.Instance.runSliderValue(dragonController.sliderHP, valueTo, EffectSupportor.TimeValueRunHP); EffectSupportor.Instance.runSliderValue(PlayDragonInfoController.Instance.sliderHP, valueTo, EffectSupportor.TimeValueRunHP); }