public void UpdateTime(UpdateEvent e, BattleTimeWithLimitNode battle, [JoinByBattle] RoundNode round) { float timeLimitSec = battle.timeLimit.TimeLimitSec; if (battle.Entity.HasComponent <BattleStartTimeComponent>() && !round.Entity.HasComponent <RoundWarmingUpStateComponent>()) { timeLimitSec -= Date.Now - battle.Entity.GetComponent <BattleStartTimeComponent>().RoundStartTime; } string timerText = TimerUtils.GetTimerText(timeLimitSec); battle.battleItemContent.SetTimeField(timerText); }
public void ScoreUpdate(RoundScoreUpdatedEvent e, RoundNode node, [JoinByBattle] BattleWithoutLimitNode battleWithoutLimit, [JoinByBattle] IndicatorNode indicator, [JoinByBattle] ICollection <TeamNode> teams) { int redScore = 0; int blueScore = 0; foreach (TeamNode node2 in teams) { TeamColor teamColor = node2.teamColor.TeamColor; if (teamColor == TeamColor.RED) { redScore = node2.teamScore.Score; continue; } if (teamColor == TeamColor.BLUE) { blueScore = node2.teamScore.Score; } } indicator.teamBattleScoreIndicator.UpdateScore(blueScore, redScore, Mathf.Max(blueScore, redScore)); }
public void UpdateTimer(UpdateEvent e, BattleNode battle, [JoinByBattle] HUDNodes.SelfBattleUserNode self, [JoinByBattle] RoundNode round, [JoinAll] MainHUDNode hud) { float timeLimitSec = battle.timeLimit.TimeLimitSec; float warmingUpTimeLimitSec = battle.timeLimit.WarmingUpTimeLimitSec; if (battle.Entity.HasComponent <BattleStartTimeComponent>()) { float unityTime = battle.Entity.GetComponent <BattleStartTimeComponent>().RoundStartTime.UnityTime; if (!round.Entity.HasComponent <RoundWarmingUpStateComponent>()) { timeLimitSec -= Date.Now.UnityTime - unityTime; } else { warmingUpTimeLimitSec = unityTime - Date.Now.UnityTime; } } hud.mainHUDTimers.Timer.Set(timeLimitSec); hud.mainHUDTimers.WarmingUpTimer.Set(warmingUpTimeLimitSec); }
public void UpdateTime(UpdateEvent e, BattleTimeIndicatorNode battleTimeIndicator, [JoinByBattle] BattleTimeNode battleTime, [JoinByBattle] RoundNode round) { float progress = 0f; long timeLimitSec = battleTime.timeLimit.TimeLimitSec; float timeSeconds = timeLimitSec; if (battleTime.Entity.HasComponent <BattleStartTimeComponent>() && !round.Entity.HasComponent <RoundWarmingUpStateComponent>()) { Date roundStartTime = battleTime.Entity.GetComponent <BattleStartTimeComponent>().RoundStartTime; timeSeconds -= Date.Now - roundStartTime; progress = Date.Now.GetProgress(roundStartTime, roundStartTime + timeLimitSec); } string timerText = TimerUtils.GetTimerText(timeSeconds); battleTimeIndicator.battleTimeIndicator.Progress = 1f - progress; battleTimeIndicator.battleTimeIndicator.Time = timerText; }
public void SwitchToSilentWhenRoundFinish(NodeRemoveEvent e, SingleNode <RoundActiveStateComponent> roundActive, [JoinSelf] RoundNode round, [JoinByBattle] SelfBattleUserNode battleUser, [JoinAll] SoundListenerNode listener) { this.SwitchToSilent(listener, listener.soundListenerBattleMixerSnapshotTransition.TransitionTimeToSilentAfterRoundFinish); }
public void InitIndicator(NodeAddedEvent e, BattleWithoutLimitNode battleWithoutLimit, [Context, JoinByBattle] RoundNode round, [Context, JoinByBattle] IndicatorNode indicator) { int scoreRed = battleWithoutLimit.battleScore.ScoreRed; int scoreBlue = battleWithoutLimit.battleScore.ScoreBlue; indicator.teamBattleScoreIndicator.UpdateScore(scoreBlue, scoreRed, Mathf.Max(scoreRed, scoreBlue)); }
public void InitIndicator(NodeAddedEvent e, BattleWithLimitNode battleWithLimit, [Context, JoinByBattle] RoundNode round, [Context, JoinByBattle] IndicatorNode indicator) { indicator.teamBattleScoreIndicator.UpdateScore(battleWithLimit.battleScore.ScoreBlue, battleWithLimit.battleScore.ScoreRed, battleWithLimit.scoreLimit.ScoreLimit); }
public void UpdateScore(RoundScoreUpdatedEvent e, RoundNode round, [JoinByBattle] HUDNodes.SelfBattleUserNode selfBattleUser, [JoinByBattle] BattleNode battle) { base.ScheduleEvent <UpdateDMHUDScoreEvent>(battle); }
public void ScoreUpdate(RoundScoreUpdatedEvent e, RoundNode node, [JoinByBattle] ScoreBattleNode battle, [JoinByBattle] HUDNodes.SelfBattleUserNode self, [JoinByBattle] ICollection <TeamNode> teams, [JoinAll] SingleNode <TeamScoreHUDComponent> hud) { this.SetScore(teams, hud.component); }
public void InitIndicator(NodeAddedEvent e, ScoreBattleNode battle, [Context, JoinByBattle] RoundNode round, [Context, JoinByBattle] HUDNodes.SelfBattleUserNode self, [JoinByBattle] ICollection <TeamNode> teams, [Context] SingleNode <TeamScoreHUDComponent> hud) { hud.component.gameObject.SetActive(true); this.SetScore(teams, hud.component); }
public void InitFlags(NodeAddedEvent e, CTFBattleNode battle, [Context, JoinByBattle] RoundNode round, [Context, JoinByBattle] HUDNodes.SelfBattleUserNode self, [Context] SingleNode <FlagsHUDComponent> hud) { hud.component.BlueFlagNormalizedPosition = 0f; hud.component.RedFlagNormalizedPosition = 0f; hud.component.gameObject.SetActive(true); }
public void RoundReturnedToBalance(NodeRemoveEvent e, RoundNode roundDisbalanced, [JoinAll] SingleNode <DisbalanceInfoComponent> disbalanceInfo) { disbalanceInfo.component.HideDisbalanceInfo(); }