public void Credits() { gameObject.SetActive(false); MainMenuPanel.SetActive(false); CreditsPanel.SetActive(true); Console.WriteLine("Credits menu controller"); }
public void PlayCreditosMenu() { MainPanel.SetActive(false); PlayPanel.SetActive(false); CreditsPanel.SetActive(true); OpcionesPanel.SetActive(false); GameObject.Find("EventSystem").GetComponent <EventSystem>().SetSelectedGameObject(firstCred, null); }
public void GoBack() { LevelConfigPanel.SetActive(false); CreditsPanel.SetActive(false); ExitConfirmationPanel.SetActive(false); TutorialPanel.SetActive(false); MainMenuPanel.SetActive(true); }
public void RegresarMenuPrincipal() { MainPanel.SetActive(true); PlayPanel.SetActive(false); CreditsPanel.SetActive(false); OpcionesPanel.SetActive(false); GameObject.Find("EventSystem").GetComponent <EventSystem>().SetSelectedGameObject(firstMain, null); }
void Start() { MainPanel.SetActive(true); PlayPanel.SetActive(false); CreditsPanel.SetActive(false); OpcionesPanel.SetActive(false); print(PlayPanel.activeSelf); }
void Awake() { MainPanel = GameObject.Find("MainPanel"); RankingPanel = GameObject.Find("RankingPanel"); CreditsPanel = GameObject.Find("CreditsPanel"); Panel = GameObject.Find("Panel"); CreditsPanel.SetActive(false); RankingPanel.SetActive(false); }
private void Reset() { mainMenuPanel = FindObjectOfType <MainMenuPanel>(); gameOverPanel = FindObjectOfType <GameOverPanel>(); levelCompletePanel = FindObjectOfType <LevelCompletePanel>(); fadePanel = FindObjectOfType <FadePanel>(); optionsPanel = FindObjectOfType <OptionsPanel>(); creditsPanel = FindObjectOfType <CreditsPanel>(); }
//Back to main menu public void BackToMenu() { //gameObject.SetActive(false); MainMenuPanel.SetActive(true); PausePanel.SetActive(false); OptionsPanel.SetActive(false); CreditsPanel.SetActive(false); InstructionsPanel.SetActive(false); GameOverPanel.SetActive(false); GameController.Instance.state = eState.TITLE; Console.WriteLine("BacktoMenu menu controller"); }
// Start is called before the first frame update void Start() { // Determines which scene is open switch (SceneManager.GetActiveScene().name) { case "Main Menu": IsLoadingLevel = false; MainMenuPanel.SetActive(true); ControlsPanel.SetActive(false); CreditsPanel.SetActive(false); LoadingPanel.SetActive(false); MusicCreditsTitle.SetActive(false); MusicCredits.SetActive(false); ArtCreditsTitle.SetActive(false); ArtCredits.SetActive(false); ProgrammingCreditsTitle.SetActive(false); ProgrammingCredits.SetActive(false); GameDesignCreditsTitle.SetActive(false); GameDesignCredits.SetActive(false); TutorialIndex = 0; break; case "Gamefield": IsLoadingLevel = false; // Holds the amount of time which has elapsed Seconds = 60.0f; WaveInProgress = true; // Holds the wave of enemies Wave = 1; // Determines whether the lose conditions of the game has been met PlayerHasLost = false; Direction = 0; InitiateCameras(); SelectedBarracks = Barracks[0]; UIBarracksBlocked.SetActive(false); UIPrompt.gameObject.SetActive(false); Currency = 1000; SpawnGates = GameObject.FindGameObjectsWithTag("Spawn Gate"); AutoAttack = true; break; } }
// Return Buttons // Closes all panels other than the Main Menu void Return() { if (ControlsPanel.activeSelf) { ControlsPanel.SetActive(false); } if (CreditsPanel.activeSelf) { CreditsPanel.SetActive(false); } MainMenuPanel.SetActive(true); }
public void Pause() { if (GameController.Instance.state == eState.GAME) { PausePanel.SetActive(true); MainMenuPanel.SetActive(false); OptionsPanel.SetActive(false); CreditsPanel.SetActive(false); InstructionsPanel.SetActive(false); GameOverPanel.SetActive(false); GameController.Instance.state = eState.PAUSE; } }
void Start() { //PlayerPrefs.DeleteAll(); MainMenuPanel.SetActive(true); LevelConfigPanel.SetActive(false); CreditsPanel.SetActive(false); TutorialPanel.SetActive(false); //GlowColor = PlayerPrefs.GetString("GlowColor"); Sound = PlayerPrefs.GetInt("Sound"); Level = PlayerPrefs.GetInt("Level"); CheckSound(); //CheckColor(); CheckLevel(); }
public void TogglePanel(bool active, MainMenuPanels panels) { panelOpen = active; switch (panels) { case MainMenuPanels.Options: OptionsPanel.SetActive(active); MenuOptions.GetComponent <MenuOptions>().enabled = !active; break; case MainMenuPanels.Highscore: HighscorePanel.SetActive(active); MenuOptions.GetComponent <MenuOptions>().enabled = !active; break; case MainMenuPanels.Credits: CreditsPanel.SetActive(active); MenuOptions.GetComponent <MenuOptions>().enabled = !active; break; } }
// Opens the Credits Panel void Credits() { MainMenuPanel.SetActive(false); CreditsPanel.SetActive(true); }
/// <summary> /// Загрузка контента (вызывается после Initialize()) /// </summary> protected override void LoadContent() { backgroundFont = Content.Load <SpriteFont>(Fnames.OldEnglishTextMT); bFont = Content.Load <SpriteFont>(Fnames.ButtonFont); #region Buttons int start = 300; int step = (cfg.ResolutionHeight == 600) ? 65 : 50; int count = 0; Button Continue = new Button(MultiSprite.CreateSprite(Content, spriteBatch, Fnames.ContinueB, new Vector2(Window.ClientBounds.Width / 2f - 122, Window.ClientBounds.Height / 1000f * (start + step * count++)), new Vector2(244, 36), Vector2.One), CreateSound3D(Content, Fnames.UIButtonClick), CreateSound3D(Content, Fnames.UIButtonSelect), bFont); Button New = new Button(MultiSprite.CreateSprite(Content, spriteBatch, Fnames.NewB, new Vector2(Window.ClientBounds.Width / 2f - 122, Window.ClientBounds.Height / 1000f * (start + step * count++)), new Vector2(244, 36), Vector2.One), CreateSound3D(Content, Fnames.UIButtonClick), CreateSound3D(Content, Fnames.UIButtonSelect), bFont); Button Save = new Button(MultiSprite.CreateSprite(Content, spriteBatch, Fnames.SaveB, new Vector2(Window.ClientBounds.Width / 2f - 122, Window.ClientBounds.Height / 1000f * (start + step * count++)), new Vector2(244, 36), Vector2.One), CreateSound3D(Content, Fnames.UIButtonClick), CreateSound3D(Content, Fnames.UIButtonSelect), bFont); Button Load = new Button(MultiSprite.CreateSprite(Content, spriteBatch, Fnames.LoadB, new Vector2(Window.ClientBounds.Width / 2f - 122, Window.ClientBounds.Height / 1000f * (start + step * count++)), new Vector2(244, 36), Vector2.One), CreateSound3D(Content, Fnames.UIButtonClick), CreateSound3D(Content, Fnames.UIButtonSelect), bFont); Button Options = new Button(MultiSprite.CreateSprite(Content, spriteBatch, Fnames.OptionsB, new Vector2(Window.ClientBounds.Width / 2f - 122, Window.ClientBounds.Height / 1000f * (start + step * count++)), new Vector2(244, 36), Vector2.One), CreateSound3D(Content, Fnames.UIButtonClick), CreateSound3D(Content, Fnames.UIButtonSelect), bFont); Button Credits = new Button(MultiSprite.CreateSprite(Content, spriteBatch, Fnames.CreditsB, new Vector2(Window.ClientBounds.Width / 2f - 122, Window.ClientBounds.Height / 1000f * (start + step * count++)), new Vector2(244, 36), Vector2.One), CreateSound3D(Content, Fnames.UIButtonClick), CreateSound3D(Content, Fnames.UIButtonSelect), bFont); Button Exit = new Button(MultiSprite.CreateSprite(Content, spriteBatch, Fnames.ExitGlobalB, new Vector2(Window.ClientBounds.Width / 2f - 122, Window.ClientBounds.Height / 1000f * (start + step * count++)), new Vector2(244, 36), Vector2.One), CreateSound3D(Content, Fnames.UIButtonClick), CreateSound3D(Content, Fnames.UIButtonSelect), bFont); Continue.Text = ""; Continue.Click += new EventHandler <MouseElementEventArgs>(Continue_Click); Continue.MouseMove += new EventHandler <MouseElementEventArgs>(Button_MouseMove); Continue.MouseMoveOut += new EventHandler <MouseElementEventArgs>(Button_MouseMoveOut); Continue.Visible = isContinue = false; continueB = Continue; New.Text = ""; New.Click += new EventHandler <MouseElementEventArgs>(New_Click); New.MouseMove += new EventHandler <MouseElementEventArgs>(Button_MouseMove); New.MouseMoveOut += new EventHandler <MouseElementEventArgs>(Button_MouseMoveOut); Save.Text = ""; Save.Click += new EventHandler <MouseElementEventArgs>(Save_Click); Save.MouseMove += new EventHandler <MouseElementEventArgs>(Button_MouseMove); Save.MouseMoveOut += new EventHandler <MouseElementEventArgs>(Button_MouseMoveOut); Load.Text = ""; Load.Click += new EventHandler <MouseElementEventArgs>(Load_Click); Load.MouseMove += new EventHandler <MouseElementEventArgs>(Button_MouseMove); Load.MouseMoveOut += new EventHandler <MouseElementEventArgs>(Button_MouseMoveOut); Options.Text = ""; Options.Click += new EventHandler <MouseElementEventArgs>(Options_Click); Options.MouseMove += new EventHandler <MouseElementEventArgs>(Button_MouseMove); Options.MouseMoveOut += new EventHandler <MouseElementEventArgs>(Button_MouseMoveOut); Credits.Text = ""; Credits.Click += new EventHandler <MouseElementEventArgs>(Credits_Click); Credits.MouseMove += new EventHandler <MouseElementEventArgs>(Button_MouseMove); Credits.MouseMoveOut += new EventHandler <MouseElementEventArgs>(Button_MouseMoveOut); Exit.Text = ""; Exit.Click += new EventHandler <MouseElementEventArgs>(Exit_Click); Exit.MouseMove += new EventHandler <MouseElementEventArgs>(Button_MouseMove); Exit.MouseMoveOut += new EventHandler <MouseElementEventArgs>(Button_MouseMoveOut); buttons.Add(Continue); buttons.Add(New); buttons.Add(Save); buttons.Add(Load); buttons.Add(Options); buttons.Add(Credits); buttons.Add(Exit); #endregion #region Panels string text = "Do you really want to exit?"; exitApplyPanel = new ApplyPanel(this, Content, Sprite.CreateSprite(Content, Fnames.Panel, new Vector2(Window.ClientBounds.Width / 3f, Window.ClientBounds.Height / 3f), new Vector2(780 * (float)Window.ClientBounds.Width / 1280f / 2f, 640 * (float)Window.ClientBounds.Height / 1024f / 3f)), text); exitApplyPanel.ApplyAction += new Action(() => Game.Exit()); exitApplyPanel.ExitAction += new Action(() => exitApplyPanel.Visible = false); exitApplyPanel.Enabled += new EventHandler <EventArgs>(panel_Enabled); exitApplyPanel.Disabled += new EventHandler <EventArgs>(panel_Disabled); optionsPanel = new OptionsPanel(this, Content, Sprite.CreateSprite(Content, Fnames.Panel, new Vector2(Window.ClientBounds.Width / 5.2f, Window.ClientBounds.Height / 6.8f), new Vector2(780 * (float)Window.ClientBounds.Width / 1280f, 640 * (float)Window.ClientBounds.Height / 1024f)), settings); optionsPanel.Enabled += new EventHandler <EventArgs>(panel_Enabled); optionsPanel.Disabled += new EventHandler <EventArgs>(panel_Disabled); optionsPanel.Disabled += new EventHandler <EventArgs>((object sender, EventArgs e) => settings = (Settings)optionsPanel.ApplyedSettings.Clone()); optionsPanel.ApplyAction += new Action(() => { if (optionsPanel.ApplyedSettings.MusicIsMuted) { player.Stop(); } else { player.Start(); } }); text = String.Format("{0}\n{1}\n{2}", "Credits: ", "1) Bolshakov Kirill", "http://vk.com/overlordff"); creditsPanel = new CreditsPanel(this, Content, Sprite.CreateSprite(Content, Fnames.Panel, new Vector2(Window.ClientBounds.Width / 5.2f, Window.ClientBounds.Height / 6.8f), new Vector2(780 * (float)Window.ClientBounds.Width / 1280f, 640 * (float)Window.ClientBounds.Height / 1024f)), text); creditsPanel.Enabled += new EventHandler <EventArgs>(panel_Enabled); creditsPanel.Disabled += new EventHandler <EventArgs>(panel_Disabled); savePanel = new SavePanel(this, Content, Sprite.CreateSprite(Content, Fnames.Panel, new Vector2(Window.ClientBounds.Width / 5.2f, Window.ClientBounds.Height / 6.8f), new Vector2(780 * (float)Window.ClientBounds.Width / 1280f, 640 * (float)Window.ClientBounds.Height / 1024f))); savePanel.Enabled += new EventHandler <EventArgs>(panel_Enabled); savePanel.Disabled += new EventHandler <EventArgs>(panel_Disabled); loadPanel = new LoadPanel(this, Content, Sprite.CreateSprite(Content, Fnames.Panel, new Vector2(Window.ClientBounds.Width / 5.2f, Window.ClientBounds.Height / 6.8f), new Vector2(780 * (float)Window.ClientBounds.Width / 1280f, 640 * (float)Window.ClientBounds.Height / 1024f))); loadPanel.Enabled += new EventHandler <EventArgs>(panel_Enabled); loadPanel.Disabled += new EventHandler <EventArgs>(panel_Disabled); #endregion Song deathSong = Content.Load <Song>(Fnames.DeathSong); Song epicScore = Content.Load <Song>(Fnames.EpicScore); if (random.NextDouble() >= 0.5) { background = Content.Load <Texture2D>(Fnames.BackgroundSword); player.Add(deathSong); optionsPanel.Color = new Color(70, 70, 255); creditsPanel.Color = new Color(70, 70, 255); exitApplyPanel.Color = new Color(70, 70, 255); savePanel.Color = new Color(70, 70, 255); loadPanel.Color = new Color(70, 70, 255); } else { background = Content.Load <Texture2D>(Fnames.BackgroundKnight); player.Add(epicScore); optionsPanel.Color = new Color(174, 160, 75); creditsPanel.Color = new Color(174, 160, 75); exitApplyPanel.Color = new Color(174, 160, 75); savePanel.Color = new Color(174, 160, 75); loadPanel.Color = new Color(174, 160, 75); } Game.Components.Clear(); Game.Components.Add(new FPS(Game, Fnames.Arial14, new Vector2(Window.ClientBounds.Width / 2f - 25, 0))); Game.Components.Add(new GameCursor(Game, Fnames.Cursor)); Components.Add(exitApplyPanel); Components.Add(optionsPanel); Components.Add(creditsPanel); Components.Add(savePanel); Components.Add(loadPanel); Components.AddRange(buttons); if (!cfg.MusicIsMuted) { player.Start(); } }
public void CreditsEnable() { MainMenuPanel.SetActive(false); CreditsPanel.SetActive(true); }
public void CreditsBackBtnPress() { _audioManager.ClickBtnPlay(); menuAnim.SetBool("Credits", false); CreditsPanel.SetActive(false); }
public void ShowCredits() { Panel.SetActive(false); CreditsPanel.SetActive(true); }
public void CloseCredits() { CreditsPanel.SetActive(false); Panel.SetActive(true); }