public void UpdateScores(long fractionId, FractionInfoComponent info, long scores) { if (this._fractions.ContainsKey(fractionId)) { this._fractions[fractionId].FractionScores = scores; } else { FractionScoresUiBehaviour behaviour2 = Instantiate <FractionScoresUiBehaviour>(this._fractionScoresPrefab, this._container.transform); behaviour2.FractionName = info.FractionName; behaviour2.FractionLogoUid = info.FractionLogoImageUid; Color defaultColor = new Color(); behaviour2.FractionColor = FractionsCompetitionUiSystem.GetColorFromHex(info.FractionColor, defaultColor); behaviour2.FractionScores = scores; this._fractions.Add(fractionId, behaviour2); } if (< > f__am$cache0 == null) {
public void FillFactionContainer(NodeAddedEvent e, SingleNode <FractionContainerComponent> container, [JoinAll] SelfUserNode user, [JoinByFraction] Optional <FractionNode> fraction, [JoinAll] FractionCompetitionNode fractionCompetition) { Color color; FractionContainerComponent component = container.component; FractionContainerComponent.FractionContainerTargets target = component.Target; if (target == FractionContainerComponent.FractionContainerTargets.PLAYER_FRACTION) { if (!fraction.IsPresent()) { component.IsAvailable = false; } else { component.IsAvailable = true; FractionInfoComponent fractionInfo = fraction.Get().fractionInfo; component.FractionTitle = fractionInfo.FractionName; component.FractionLogoUid = fractionInfo.FractionLogoImageUid; color = new Color(); component.FractionColor = GetColorFromHex(fractionInfo.FractionColor, color); } } else { if (target != FractionContainerComponent.FractionContainerTargets.WINNER_FRACTION) { throw new ArgumentOutOfRangeException(); } if (!fractionCompetition.Entity.HasComponent <FinishedFractionsCompetitionComponent>()) { component.IsAvailable = false; } else { component.IsAvailable = true; FractionInfoComponent component3 = fractionCompetition.Entity.GetComponent <FinishedFractionsCompetitionComponent>().Winner.GetComponent <FractionInfoComponent>(); component.FractionTitle = component3.FractionName; component.FractionLogoUid = component3.FractionLogoImageUid; color = new Color(); component.FractionColor = GetColorFromHex(component3.FractionColor, color); } } }