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 UpdateSelfScore(UpdateDMHUDScoreEvent e, BattleNode battle, [JoinByBattle] HUDNodes.SelfBattleUserNode self, [JoinByUser] RoundUserNode selfRoundUser, [JoinAll] SingleNode <DMScoreHUDComponent> hud) { hud.component.Place = selfRoundUser.roundUserStatistics.Place; hud.component.PlayerScore = selfRoundUser.roundUserStatistics.ScoreWithoutBonuses; }
public void OnDeliver(FlagDeliveryEvent e, FlagNode flag, [JoinByTeam] SingleNode <ColorInBattleComponent> color, [JoinByBattle] HUDNodes.SelfBattleUserNode self, [JoinAll] HUDNode hud, Optional <SingleNode <CTFHUDMessagesComponent> > messages) {
public void SetScore(NodeAddedEvent e, SingleNode <DMScoreHUDComponent> hud, HUDNodes.SelfBattleUserNode battleUser, [JoinByBattle, Context] BattleNode battle) { base.ScheduleEvent <UpdateDMHUDScoreEvent>(battle); }
public void UpdateScore(RoundScoreUpdatedEvent e, RoundNode round, [JoinByBattle] HUDNodes.SelfBattleUserNode selfBattleUser, [JoinByBattle] BattleNode battle) { base.ScheduleEvent <UpdateDMHUDScoreEvent>(battle); }
public void OnUserExitBattle(NodeRemoveEvent e, RoundUserNode roundUser, [JoinByBattle] HUDNodes.SelfBattleUserNode self, [JoinByBattle] BattleNode battle) { base.NewEvent <UpdateDMHUDScoreEvent>().Attach(battle).ScheduleDelayed(0f); }
public void OnUserEnterBattle(NodeAddedEvent e, RoundUserNode roundUser, [JoinByBattle] HUDNodes.SelfBattleUserNode self, [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); }