private void OnFactionChanged() { Player referer = renderReference.Player; Unit target = UnitRenderer.Unit; if (referer == target) { HostilitySettings = nameplateSettings.Self; } else if (referer.IsHostileTo(target)) { HostilitySettings = nameplateSettings.Enemy; } else if (referer.IsFriendlyTo(target)) { HostilitySettings = nameplateSettings.Friendly; } else { HostilitySettings = nameplateSettings.Neutral; } unitName.gameObject.SetActive(HostilitySettings.ShowName); healthFrame.HealthBar.FillImage.color = HostilitySettings.HealthColor; unitName.color = HostilitySettings.NameWithoutPlateColor; InDetailRange = referer.DistanceTo(target) < nameplateSettings.DetailedDistance; UpdateSelection(true); ApplyScaling(); }