protected override bool OnInit() { if (base.OnInit() == false) { return(false); } GUIBase_Layout layout = MFGuiManager.Instance.GetLayout(LAYOUT); m_Gadget = new GadgetDeathMatchState(layout.GetWidget(ROOT)); return(true); }
// ================================================================================================================= protected override void OnViewInit() { base.OnViewInit(); m_Minimize_Button = PrepareButton("Minimize_Button", null, OnMinimize); m_Spawn_Button = PrepareButton("Spawn_Button", null, OnSpawn); m_FollowPlayer_Dummy = GetWidget("FollowPlayer_Dummy"); m_PlayerName_Label = PrepareLabel("PlayerName_Label"); m_FollowPlayer_Button = PrepareButton("FollowPlayer_Button", null, OnFollowPlayer); PrepareButton("PrevPlayer_Button", null, OnPrevPlayer); PrepareButton("NextPlayer_Button", null, OnNextPlayer); m_Cancel_Button = PrepareButton("Cancel_Button", null, OnCancel); m_Feedback_Button = PrepareButton("Feedback_Button", null, OnFeedback); m_NextSpawn_Dummy = GetWidget("NextSpawn_Dummy"); m_NextSpawn_Label = PrepareLabel("NextSpawn"); m_ScoreButton = PrepareButton("ScoreButton", OnScorePressed, OnScoreReleased); m_AnticheatButton = PrepareButton("AnticheatButton", null, OnAnticheatPressed); if (m_Feedback_Button != null) { bool showFeedback = BuildInfo.Version.Stage == BuildInfo.Stage.Beta; m_Feedback_Button.Widget.m_VisibleOnLayoutShow = showFeedback; } if (m_Score == null) { m_Score = gameObject.AddComponent <GuiScreenScore>(); m_Score.InitView(); m_Score.HideView(null); } Client client = Client.Instance; if (client != null) { switch (client.GameState.GameType) { case E_MPGameType.ZoneControl: m_ZoneControlState = new GadgetZoneControlState(GetWidget("Domination_State")); break; case E_MPGameType.DeathMatch: m_DeathMatchState = new GadgetDeathMatchState(GetWidget("DeathMatch_State")); break; default: break; } } { GUIBase_Widget anchor = Layout.GetWidget("AnchorTop"); Vector3 pos = anchor.transform.position; pos.y = 0.0f; anchor.transform.position = pos; } { GUIBase_Widget anchor = Layout.GetWidget("AnchorBottom"); Vector3 pos = anchor.transform.position; pos.y = Screen.height; anchor.transform.position = pos; } }