Exemple #1
0
        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);
        }
Exemple #2
0
 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)
 {
Exemple #4
0
 public void SetScore(NodeAddedEvent e, SingleNode <DMScoreHUDComponent> hud, HUDNodes.SelfBattleUserNode battleUser, [JoinByBattle, Context] BattleNode battle)
 {
     base.ScheduleEvent <UpdateDMHUDScoreEvent>(battle);
 }
Exemple #5
0
 public void UpdateScore(RoundScoreUpdatedEvent e, RoundNode round, [JoinByBattle] HUDNodes.SelfBattleUserNode selfBattleUser, [JoinByBattle] BattleNode battle)
 {
     base.ScheduleEvent <UpdateDMHUDScoreEvent>(battle);
 }
Exemple #6
0
 public void OnUserExitBattle(NodeRemoveEvent e, RoundUserNode roundUser, [JoinByBattle] HUDNodes.SelfBattleUserNode self, [JoinByBattle] BattleNode battle)
 {
     base.NewEvent <UpdateDMHUDScoreEvent>().Attach(battle).ScheduleDelayed(0f);
 }
Exemple #7
0
 public void OnUserEnterBattle(NodeAddedEvent e, RoundUserNode roundUser, [JoinByBattle] HUDNodes.SelfBattleUserNode self, [JoinByBattle] BattleNode battle)
 {
     base.ScheduleEvent <UpdateDMHUDScoreEvent>(battle);
 }
Exemple #8
0
 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);
 }
Exemple #9
0
 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);
 }
Exemple #10
0
 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);
 }