protected override void OnDeinitialize() { base.StopAllCoroutines(); base.CancelInvoke(); this.hudCrosshair = null; this.hudRadar = null; this.hudNavigation = null; this.hudWeaponSelector = null; this.hudMoveControl = null; this.hudActions = null; this.hudControls = null; this.hudMessages = null; this.hudObjectives = null; this.hudGadgets = null; this.hudStaticWeapon = null; this.hudHealth = null; this.hudEnemyHealth = null; this.hudSpecialHealth = null; this.hudRewardMessages = null; this.hudMultiplayer = null; this.hudBlueprint = null; this.hudIntel = null; this.m_HudComponents = null; this.m_StatusStringId = 0; this.m_ObjectiveStringId = 0; Instance = null; TextDatabase.LanguageChanged -= new System.Action(this.OnLanguageChanged); InputManager.GamepadChanged = (GamepadConnectedHandler)Delegate.Remove(InputManager.GamepadChanged, new GamepadConnectedHandler(this.OnGamepadConnection)); if (Mission.Instance != null) { Mission.Instance.Events.OnMultiplayerRevive -= new System.Action(this.OnMultiplayerRevive); } base.OnDeinitialize(); }
protected override void OnInitialize() { base.OnInitialize(); TextDatabase.LanguageChanged += new System.Action(this.OnLanguageChanged); base.IsFocusable = false; Instance = this; this.hudCrosshair = base.GetChild <HudCrosshair>(false); this.hudRadar = base.GetChild <HudRadar>(false); this.hudNavigation = base.GetChild <HudNavigation>(false); this.hudWeaponSelector = base.GetChild <HudWeaponSelector>(false); this.hudMoveControl = base.GetChild <HudMoveControl>(false); this.hudActions = base.GetChild <HudActions>(false); this.hudControls = base.GetChild <HudControls>(false); this.hudMessages = base.GetChild <HudMessages>(false); this.hudObjectives = base.GetChild <HudObjectives>(false); this.hudGadgets = base.GetChild <HudGadgets>(false); this.hudStaticWeapon = base.GetChild <HudStaticWeapon>(false); this.hudHealth = base.GetChild <HudHealth>(false); this.hudEnemyHealth = base.GetChild <HudEnemyHealth>(false); this.hudSpecialHealth = base.GetChild <HudSpecialHealth>(false); this.hudRewardMessages = base.GetChild <HudRewardMessages>(false); this.hudMultiplayer = base.GetChild <HudMultiplayer>(false); this.hudStars = base.GetChild <HudStars>(false); this.hudTutorial = base.GetChild <HudTutorial>(false); this.hudBlueprint = base.GetChild <HudBlueprint>(false); this.hudIntel = base.GetChild <HudIntel>(false); this.m_HudComponents = new IHudComponent[] { this.hudCrosshair, this.hudRadar, this.hudNavigation, this.hudWeaponSelector, this.hudMoveControl, this.hudActions, this.hudControls, this.hudMessages, this.hudObjectives, this.hudGadgets, this.hudStaticWeapon, this.hudStaticWeapon, this.hudHealth, this.hudEnemyHealth, this.hudSpecialHealth, this.hudRewardMessages, this.hudMultiplayer, this.hudStars, this.hudTutorial, this.hudBlueprint, this.hudIntel }; int num = 0; this.m_Last100msUpdate = new float[this.m_HudComponents.Length]; foreach (HudComponent component in this.m_HudComponents) { if (component.HasExpensive100msTick) { num++; } } float num3 = 0f; float num4 = 0.1f / ((float)(num + 1)); int length = this.m_HudComponents.Length; for (int i = 0; i < length; i++) { if ((this.m_HudComponents[i] as HudComponent).HasExpensive100msTick) { this.m_Last100msUpdate[i] = num3 + num4; } else { this.m_Last100msUpdate[i] = 0f; } } this.SetDefaultVisibility(); this.AimAtTarget = new AttackTarget(false); this.AimAtTime = -1f; InputManager.GamepadChanged = (GamepadConnectedHandler)Delegate.Combine(InputManager.GamepadChanged, new GamepadConnectedHandler(this.OnGamepadConnection)); Mission.Instance.Events.OnMultiplayerRevive += new System.Action(this.OnMultiplayerRevive); }