public override void Set(int currentStageLevel = 0) { if (currentStageLevel > 0) { level = currentStageLevel; maxHP = Mathf.RoundToInt(maxHP * level * maxHPStep); gold = Mathf.RoundToInt(gold * level * goldStep); enemyImage.overrideSprite = ResourceImages.GetEnemyImage(level); } hpSlider.maxValue = maxHP; currentHP = maxHP; SetHP(); }
public Enemy(int num) { // 적 초기화 maxHP = 5; currentHP = maxHP; maxHPStep = 3.5f; gold = 1; goldStep = 2.8f; level = 0; enemyImage = GameObject.Find("Enemy-Image").GetComponent <Image>(); animator = GameObject.Find("Enemy-Image").GetComponent <Animator>(); enemyImage.overrideSprite = ResourceImages.GetEnemyImage(0); hpSlider = GameObject.Find("HP-Slider").GetComponent <Slider>(); hpText = GameObject.Find("HP-Text").GetComponent <Text>(); Set(); }