Here is a quick guide on how I made my title screen, aka MainMenuScreen 2. MAKE A BACKUP JUST IN CASE!
Step 1: Making the Title Screen option appear in Global Editor.
Open GlobalEditorWindow.cs and search for SubGroupTitle("Main");. This is where the GUI for each scene is listed.
Use this and insert where ever you would like. I pasted this on top of my main menu section.
EditorGUILayout.BeginHorizontal();{
globalInfo.gameGUI.titleScreen = (TitleScreen)EditorGUILayout.ObjectField("Title:", globalInfo.gameGUI.titleScreen, typeof(TitleScreen), true);
EditorGUI.BeginDisabledGroup(DisableScreenButton(globalInfo.gameGUI.titleScreen));{
// if (GUILayout.Button("Open", GUILayout.Width(45))) OpenGUICanvas(globalInfo.gameGUI.mainMenuScreen);
ScreenButton(globalInfo.gameGUI.titleScreen);
} EditorGUI.EndDisabledGroup();
} EditorGUILayout.EndHorizontal();
Close the code and see if a new option is available for Title Screen. If not, check your indentions, spacing, etc. After previewing this post, it looks like the code is spaced incorrectly. In order to get a title screen option, all you have to do is copy main menu or another, and replace everything with title screen.
Now open GlobalInfo.cs and look for this code:
public IntroScreen introScreen;
public MainMenuScreen mainMenuScreen;
public OptionsScreen optionsScreen;
public CreditsScreen creditsScreen;
public PauseScreen pauseScreen;
Place public TitleScreen titleScreen; anywhere. I placed my beneath the pause screen.
Step 2: Creating the Title Screen Script.
Create a new script in SCRIPTS/UI/BASE folder in your project and call it TitleScreen. Then paste this code into the script.
using UnityEngine;
using System.Collections;
public class TitleScreen : UFEScreen {
public virtual void Quit(){
UFE.Quit();
}
public virtual void GoToStoryModeScreen(){
UFE.StartStoryMode();
}
public virtual void GoToVersusModeScreen(){
UFE.StartVersusModeScreen();
}
public virtual void GoToTrainingModeScreen(){
UFE.StartTrainingMode();
}
public virtual void GoToNetworkPlayScreen(){
UFE.StartNetworkGameScreen();
}
public virtual void GoToOptionsScreen(){
UFE.StartOptionsScreen();
}
public virtual void GoToMainMenuScreen(){
UFE.StartMainMenuScreen();
}
public virtual void GoToCreditsScreen(){
UFE.StartCreditsScreen();
}
}
This is the Main Menu script, but with a StartMainMenuScreen function added.
Step 3: Create the DefaultTitleScreen script.
Create a script in SCRIPTS/UI/BASE and call it DefaultTitleScreen. Paste this code inside.
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using System.Collections;
public class DefaultTitleScreen : TitleScreen{
#region public instance fields
public AudioClip onLoadSound;
public AudioClip music;
public AudioClip selectSound;
public AudioClip cancelSound;
public AudioClip moveCursorSound;
public bool stopPreviousSoundEffectsOnLoad = false;
public float delayBeforePlayingMusic = 0.1f;
public Button buttonNetwork;
#endregion
#region public override methods
public override void DoFixedUpdate(){
base.DoFixedUpdate();
this.DefaultNavigationSystem(this.selectSound, this.moveCursorSound, null, this.cancelSound);
}
public override void OnShow (){
base.OnShow ();
this.HighlightOption(this.FindFirstSelectable());
if (this.music != null){
UFE.DelayLocalAction(delegate(){UFE.PlayMusic(this.music);}, this.delayBeforePlayingMusic);
}
if (this.stopPreviousSoundEffectsOnLoad){
UFE.StopSounds();
}
if (this.onLoadSound != null){
UFE.DelayLocalAction(delegate(){UFE.PlaySound(this.onLoadSound);}, this.delayBeforePlayingMusic);
}
}
#endregion
}
Step 4: Change VideoIntro to go to TitleScreen instead of Main Menu.
Open your IntroSceen.cs script and change GoToMainMenu to GoToTitleScreen. You must also change this in the VideoIntro.cs and TextureIntro.cs scripts.
Step 5: Create Title Screen Prefab.
Copy and Paste Main Menu prefab, then switch out the DefaultMainMenu script with the DefaultTitleScript and setup buttons. Once done, drag the prefab to the Title Screen section.
Hopefully I covered everything that needed to be changed. If not, this is very simple and should be understanding when looking in the right places. If anyone needs help, I will be available. I get emails from this post. So feel free to ask!