public void ShowTargetFrame(Enemy target) { targetFrame.SetActive(true); healthStat.Initialize(target.MyHealth.MyCurrentValue, target.MyHealth.MyMaxValue); portraitFrame.sprite = target.MyPortrait; levelTexet.text = target.MyLevel.ToString(); target.healthChanged += new HealthChanged(UpdateTargetFrame); target.characterRemoved += new CharacterRemoved(HideTargetFrame); if (target.MyLevel >= Hero.MyInstance.MyLevel + 5) { levelTexet.color = Color.red; } else if (target.MyLevel == Hero.MyInstance.MyLevel + 3 || target.MyLevel == Hero.MyInstance.MyLevel + 4) { levelTexet.color = new Color32(255, 124, 0, 255); } else if (target.MyLevel >= Hero.MyInstance.MyLevel - 2 && target.MyLevel <= Hero.MyInstance.MyLevel + 2) { levelTexet.color = Color.yellow; } else if (target.MyLevel <= Hero.MyInstance.MyLevel - 3 && target.MyLevel > XPManager.CalculateGrayLevel()) { levelTexet.color = Color.green; } else { levelTexet.color = Color.grey; } }
public void showTargetFrame(Enemy target) { targetFrame.SetActive(true); healthStat.Initialize(target.MyHealth.MyCurrentValue, target.MyHealth.MyMaxValue); targetName.text = target.MyName; targetLevel.text = target.MyLevel.ToString(); target.healthChanged += new HealthChanged(updateTargetFrame); target.characterRemoved += new CharacterRemoved(hideTargetFrame); if (target.MyLevel >= Player.MyInstance.MyLevel + 5) { targetName.color = Color.red; } else if ((target.MyLevel == Player.MyInstance.MyLevel + 3) || (target.MyLevel == Player.MyInstance.MyLevel + 4)) { targetName.color = new Color32(255, 124, 0, 255); } else if ((target.MyLevel >= Player.MyInstance.MyLevel - 2) && (target.MyLevel <= Player.MyInstance.MyLevel + 2)) { targetName.color = Color.yellow; } else if (target.MyLevel <= Player.MyInstance.MyLevel - 3 && target.MyLevel > XPManager.CalculateGrayLevel()) { targetName.color = Color.green; } else { targetName.color = Color.gray; } }
public void ShowTargetFrame(Enemy target) { targetFrame.SetActive(true); healthStat.Initialize(target.MyHealth.MyCurrentValue, target.MyHealth.MyMaxValue); portraitFrame.sprite = target.MyPortrait; levelText.text = target.MyLevel.ToString(); target.healthChanged += new HealthChanged(UpdateTargetFrame); target.characterRemoved += new CharacterRemoved(HideTargetFrame); if (target.MyLevel >= Player.MyInstance.MyLevel + 5) { levelText.color = Color.red; } else if (target.MyLevel == Player.MyInstance.MyLevel + 3 || target.MyLevel == Player.MyInstance.MyLevel + 4) { levelText.color = new Color32(255, 124, 0, 255); } else if (target.MyLevel >= Player.MyInstance.MyLevel - 2 && target.MyLevel <= Player.MyInstance.MyLevel + 2) { levelText.color = Color.yellow; } else if (target.MyLevel <= Player.MyInstance.MyLevel - 3 && target.MyLevel > XPManager.CalculateGrayLevel()) { levelText.color = Color.green; } else { levelText.color = Color.grey; } for (int i = 0; i < targetDebuffs.Count; i++) { Destroy(targetDebuffs[i].gameObject); } targetDebuffs.Clear(); foreach (Debuff debuff in target.MyDebuffs) { TargetDebuff td = Instantiate(targetDebuffPrefab, targetDebuffsTransform); td.Initialize(debuff); targetDebuffs.Add(td); } }
public void ShowTargetFrame(Enemy target) { targetFrame.SetActive(true); heathStat.Initialize(target.Health.MyCurrentValue, target.Health.MyMaxValue); portraitFrame.sprite = target.MyPortrait; levelText.text = target.MyLevel.ToString(); //적의 체력이 변경시에 실행하는 함수 target.healthChanged += new HealthChanged(UpdateTargetFrame); //적이 죽거나 다른 몹으로 타겟팅시 실행하는 함수 target.characterRemoved += new CharacterRemoved(HideTargetFrame); //적 레벨이 5이상 높을경우 if (target.MyLevel >= Player.instance.MyLevel + 5) { levelText.color = Color.red; } //적 레벨이 3, 4이상 높을경우 else if (target.MyLevel == Player.instance.MyLevel + 3 || target.MyLevel == Player.instance.MyLevel + 4) { levelText.color = new Color32(255, 124, 0, 255); } // 적 레벨과 플레이어레벨이 -2 ~ + 2 인경우 else if (target.MyLevel >= Player.instance.MyLevel - 2 && target.MyLevel <= Player.instance.MyLevel + 2) { levelText.color = Color.yellow; } // 적 레벨이 플레이어보다 3이상 낮은경우 또는 플레이어 레벨이 몬스터 레벨보다 너무 낮지 않은 경우 else if (target.MyLevel <= Player.instance.MyLevel - 3 && target.MyLevel > XPManager.CalculateGrayLevel()) { levelText.color = Color.green; } //더 낮은경우 else { levelText.color = Color.grey; } }
/// <summary> /// Adapte la couleur du niveau en fonction de celui du joueur /// </summary> /// <param name="target">Cible du joueur</param> private void SetColorLevelText(Enemy target) { // Adapte la couleur du niveau en fonction de celui du joueur if (target.MyLevel >= Player.MyInstance.MyLevel + 5) { levelText.color = Color.red; } else if (target.MyLevel == Player.MyInstance.MyLevel + 3 || target.MyLevel == Player.MyInstance.MyLevel + 4) { levelText.color = new Color32(255, 160, 0, 255); } else if (target.MyLevel >= Player.MyInstance.MyLevel - 2 && target.MyLevel <= Player.MyInstance.MyLevel + 2) { levelText.color = Color.yellow; } else if (target.MyLevel <= Player.MyInstance.MyLevel - 3 && target.MyLevel > XPManager.CalculateGrayLevel()) { levelText.color = Color.green; } else { levelText.color = Color.grey; } }