Remove main menu from build and game flow

This commit is contained in:
Michal Pikulski
2025-10-17 14:03:27 +02:00
parent bb6059a885
commit 5851b5a12f
6 changed files with 83 additions and 97 deletions

View File

@@ -112,7 +112,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 382.31982, y: 394.7317}
m_SizeDelta: {x: 1000, y: 800}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3414474029174947724
CanvasRenderer:
@@ -185,7 +185,7 @@ RectTransform:
m_Father: {fileID: 2670260041258080307}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0.2}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
@@ -442,7 +442,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 15433022183644789}
m_Direction: 2
m_Value: 0
m_Size: 0.2
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
@@ -691,7 +691,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 160, y: 30}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7918780052581038463
CanvasRenderer:
@@ -826,7 +826,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 160, y: 30}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2290562928139384544
CanvasRenderer:
@@ -917,9 +917,6 @@ MonoBehaviour:
m_MultiSelect: 0
m_Options:
m_Options:
- m_Text: MainMenu
m_Image: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
- m_Text: AppleHills
m_Image: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
@@ -1013,11 +1010,11 @@ RectTransform:
m_Children: []
m_Father: {fileID: 1302888740346723223}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 0, y: -66}
m_SizeDelta: {x: 358.3525, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -37.400024}
m_SizeDelta: {x: 0, y: 50}
m_Pivot: {x: 0.5, y: 1}
--- !u!222 &7622719397492147892
CanvasRenderer:
m_ObjectHideFlags: 0
@@ -1073,8 +1070,8 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 36
m_fontSizeBase: 36
m_fontSize: 80
m_fontSizeBase: 80
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
@@ -1218,7 +1215,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: MainMenu
m_text: AppleHills
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
@@ -1245,14 +1242,14 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 14
m_fontSizeBase: 14
m_fontSize: 40
m_fontSizeBase: 40
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 1
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
@@ -1564,8 +1561,8 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 24
m_fontSizeBase: 24
m_fontSize: 60
m_fontSizeBase: 60
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
@@ -1645,7 +1642,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 160, y: 30}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3956398402257402681
CanvasRenderer:
@@ -1778,7 +1775,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 160, y: 30}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7625231543093897207
CanvasRenderer:
@@ -1911,7 +1908,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 160, y: 30}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4255447181943714037
CanvasRenderer:
@@ -1997,7 +1994,7 @@ MonoBehaviour:
m_Calls:
- m_Target: {fileID: 7928661763020144797}
m_TargetAssemblyTypeName: UI.PauseMenu, AppleHillsScripts
m_MethodName: ExitToMainMenu
m_MethodName: ExitToAppleHills
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
@@ -2168,7 +2165,7 @@ MonoBehaviour:
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
rgba: 4281479730
m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
@@ -2181,13 +2178,13 @@ MonoBehaviour:
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: 0
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 14
m_fontSizeBase: 14
m_fontSize: 25
m_fontSizeBase: 25
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
@@ -2267,7 +2264,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -18, y: 0}
m_SizeDelta: {x: -17, y: 0}
m_Pivot: {x: 0, y: 1}
--- !u!114 &2529349555694519521
MonoBehaviour:
@@ -2385,7 +2382,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: MainMenu
m_text: To AppleHills!
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
@@ -2412,8 +2409,8 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 24
m_fontSizeBase: 24
m_fontSize: 60
m_fontSizeBase: 60
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
@@ -2548,8 +2545,8 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 20
m_fontSizeBase: 20
m_fontSize: 60
m_fontSizeBase: 60
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
@@ -2684,8 +2681,8 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 24
m_fontSizeBase: 24
m_fontSize: 60
m_fontSizeBase: 60
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
@@ -2765,10 +2762,10 @@ RectTransform:
- {fileID: 7083543314533737593}
m_Father: {fileID: 1302888740346723223}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: -6.442688, y: 141.47559}
m_SizeDelta: {x: 0, y: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: -48}
m_SizeDelta: {x: 600, y: 600}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &8594443110142453154
MonoBehaviour:
@@ -2791,8 +2788,8 @@ MonoBehaviour:
m_Spacing: 17.13
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 0
m_ChildControlHeight: 0
m_ChildControlWidth: 1
m_ChildControlHeight: 1
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
@@ -2808,5 +2805,5 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.ContentSizeFitter
m_HorizontalFit: 2
m_VerticalFit: 2
m_HorizontalFit: 0
m_VerticalFit: 0

View File

@@ -342,17 +342,17 @@ LineRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_Positions:
- {x: -0.15602553, y: 4.0749445, z: 0}
- {x: -0.1566351, y: 3.9736378, z: 0}
- {x: -0.1572447, y: 3.8729858, z: 0}
- {x: -0.15602553, y: 4.074945, z: 0}
- {x: -0.1566351, y: 3.973638, z: 0}
- {x: -0.1572447, y: 3.8729856, z: 0}
- {x: -0.15785426, y: 3.7729874, z: 0}
- {x: -0.15846384, y: 3.6736438, z: 0}
- {x: -0.15907341, y: 3.5749543, z: 0}
- {x: -0.15968299, y: 3.4769194, z: 0}
- {x: -0.15846384, y: 3.6736436, z: 0}
- {x: -0.15907341, y: 3.574954, z: 0}
- {x: -0.15968299, y: 3.4769192, z: 0}
- {x: -0.16029257, y: 3.3795385, z: 0}
- {x: -0.16090216, y: 3.2828126, z: 0}
- {x: -0.16151173, y: 3.1867406, z: 0}
- {x: -0.16212131, y: 3.0913231, z: 0}
- {x: -0.16151173, y: 3.1867409, z: 0}
- {x: -0.16212131, y: 3.0913236, z: 0}
m_Parameters:
serializedVersion: 3
widthMultiplier: 1
@@ -915,7 +915,7 @@ Transform:
m_GameObject: {fileID: 747976396}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 3.1975174, z: 0}
m_LocalPosition: {x: 0, y: 3.197517, z: 0}
m_LocalScale: {x: 0.57574, y: 0.57574, z: 0.57574}
m_ConstrainProportionsScale: 0
m_Children:
@@ -1375,9 +1375,9 @@ LineRenderer:
- {x: 0.040996216, y: 3.3127766, z: 0}
- {x: 0.08040057, y: 3.2246757, z: 0}
- {x: 0.11980491, y: 3.1580195, z: 0}
- {x: 0.15920927, y: 3.1128078, z: 0}
- {x: 0.1986136, y: 3.0890403, z: 0}
- {x: 0.23801796, y: 3.0867171, z: 0}
- {x: 0.15920927, y: 3.112808, z: 0}
- {x: 0.1986136, y: 3.0890405, z: 0}
- {x: 0.23801796, y: 3.0867176, z: 0}
m_Parameters:
serializedVersion: 3
widthMultiplier: 1
@@ -1913,14 +1913,14 @@ LineRenderer:
- {x: -0.15602553, y: 4.074945, z: 0}
- {x: -0.18956745, y: 3.8764977, z: 0}
- {x: -0.22310936, y: 3.7000232, z: 0}
- {x: -0.25665125, y: 3.5455205, z: 0}
- {x: -0.25665125, y: 3.5455208, z: 0}
- {x: -0.29019317, y: 3.4129908, z: 0}
- {x: -0.32373506, y: 3.3024333, z: 0}
- {x: -0.32373506, y: 3.3024335, z: 0}
- {x: -0.35727698, y: 3.213848, z: 0}
- {x: -0.39081886, y: 3.1472356, z: 0}
- {x: -0.4243608, y: 3.1025953, z: 0}
- {x: -0.45790267, y: 3.0799277, z: 0}
- {x: -0.4914446, y: 3.0792325, z: 0}
- {x: -0.39081886, y: 3.1472359, z: 0}
- {x: -0.4243608, y: 3.1025958, z: 0}
- {x: -0.45790267, y: 3.0799282, z: 0}
- {x: -0.4914446, y: 3.079233, z: 0}
m_Parameters:
serializedVersion: 3
widthMultiplier: 1
@@ -2469,7 +2469,7 @@ Transform:
m_GameObject: {fileID: 2106431001}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.165, y: 2.697517, z: 0}
m_LocalPosition: {x: -0.165, y: 2.6975174, z: 0}
m_LocalScale: {x: 0.57574, y: 0.57574, z: 0.57574}
m_ConstrainProportionsScale: 0
m_Children:

View File

@@ -4,6 +4,7 @@ using UI;
using Core;
using UnityEngine.SceneManagement;
using Cinematics;
using UnityEngine.Serialization;
namespace Bootstrap
{
@@ -12,7 +13,7 @@ namespace Bootstrap
/// </summary>
public class BootSceneController : MonoBehaviour
{
[SerializeField] private string mainMenuSceneName = "MainMenu";
[SerializeField] private string mainSceneName = "AppleHillsOverworld";
[SerializeField] private float minDelayAfterBoot = 0.5f; // Small delay after boot to ensure smooth transition
[SerializeField] private bool debugMode = false;
[SerializeField] private InitialLoadingScreen initialLoadingScreen; // Reference to our specialized loading screen
@@ -160,12 +161,12 @@ namespace Bootstrap
_hasStartedLoading = true;
_currentPhase = LoadingPhase.SceneLoading;
LoadMainMenu();
LoadMainScene();
}
private async void LoadMainMenu()
private async void LoadMainScene()
{
Debug.Log($"[BootSceneController] Loading main menu scene: {mainMenuSceneName}");
Debug.Log($"[BootSceneController] Loading main menu scene: {mainSceneName}");
try
{
@@ -184,7 +185,7 @@ namespace Bootstrap
});
// Step 1: Additively load the main menu scene - don't unload StartingScene yet
var op = SceneManager.LoadSceneAsync(mainMenuSceneName, LoadSceneMode.Additive);
var op = SceneManager.LoadSceneAsync(mainSceneName, LoadSceneMode.Additive);
// Disable scene activation until we're ready to show it
op.allowSceneActivation = true;
@@ -197,7 +198,7 @@ namespace Bootstrap
}
// Update the current gameplay scene in SceneManagerService
SceneManagerService.Instance.CurrentGameplayScene = mainMenuSceneName;
SceneManagerService.Instance.CurrentGameplayScene = mainSceneName;
// Ensure progress is complete
_sceneLoadingProgress = 1f;
@@ -234,10 +235,10 @@ namespace Bootstrap
await SceneManager.UnloadSceneAsync(startingSceneName);
// Set the main menu scene as the active scene
Scene mainMenuScene = SceneManager.GetSceneByName(mainMenuSceneName);
Scene mainMenuScene = SceneManager.GetSceneByName(mainSceneName);
SceneManager.SetActiveScene(mainMenuScene);
Debug.Log($"[BootSceneController] Transition complete: {startingSceneName} unloaded, {mainMenuSceneName} is now active");
Debug.Log($"[BootSceneController] Transition complete: {startingSceneName} unloaded, {mainSceneName} is now active");
// Destroy the boot scene controller since its job is done
Destroy(gameObject);

View File

@@ -73,13 +73,13 @@ namespace Core
// Otherwise default to MainMenu
else
{
CurrentGameplayScene = "MainMenu";
CurrentGameplayScene = "AppleHillsOverworld";
Logging.Debug($"[SceneManagerService] Initialized with default scene: {CurrentGameplayScene}");
}
}
else
{
CurrentGameplayScene = "MainMenu";
CurrentGameplayScene = "AppleHillsOverworld";
Logging.Debug($"[SceneManagerService] No valid active scene, defaulting to: {CurrentGameplayScene}");
}
}
@@ -277,7 +277,7 @@ namespace Core
}
// Tracks the currently loaded gameplay scene (not persistent/bootstrapper)
public string CurrentGameplayScene { get; set; } = "MainMenu";
public string CurrentGameplayScene { get; set; } = "AppleHillsOverworld";
public async Task ReloadCurrentScene(IProgress<float> progress = null, bool autoHideLoadingScreen = true)
{

View File

@@ -48,12 +48,7 @@ namespace UI
// Set initial state based on current scene
SetPauseMenuByLevel(SceneManager.GetActiveScene().name);
#if UNITY_EDITOR
// Initialize pause menu state
HidePauseMenu(false);
#endif
Logging.Debug("[PauseMenu] Subscribed to SceneManagerService events");
}
@@ -77,18 +72,17 @@ namespace UI
/// <param name="levelName">The name of the level/scene</param>
public void SetPauseMenuByLevel(string levelName)
{
if (string.IsNullOrEmpty(levelName))
HidePauseMenu(false);
// TODO: Implement level-based pause menu visibility logic if needed
/*if (string.IsNullOrEmpty(levelName))
return;
bool isMainMenu = levelName.ToLower().Contains("mainmenu");
bool isStartingLevel = levelName.ToLower().Contains("startingscene");
gameObject.SetActive(!(isMainMenu || isStartingLevel));
if(!isMainMenu && !isStartingLevel)
if(isStartingLevel)
HidePauseMenu(false); // Ensure menu is hidden when switching to a game level
Logging.Debug($"[PauseMenu] Setting pause menu active: {!isMainMenu} for scene: {levelName}");
Logging.Debug($"[PauseMenu] Setting pause menu active: {!isStartingLevel} for scene: {levelName}");*/
}
/// <summary>
@@ -141,11 +135,11 @@ namespace UI
/// <summary>
/// Exits to the main menu scene.
/// </summary>
public async void ExitToMainMenu()
public async void ExitToAppleHills()
{
// Replace with the actual scene name as set in Build Settings
var progress = new Progress<float>(p => Logging.Debug($"Loading progress: {p * 100:F0}%"));
await SceneManagerService.Instance.SwitchSceneAsync("MainMenu", progress);
await SceneManagerService.Instance.SwitchSceneAsync("AppleHillsOverworld", progress);
}
/// <summary>
@@ -181,15 +175,12 @@ namespace UI
switch (levelSelection)
{
case 0:
await SceneManagerService.Instance.SwitchSceneAsync("MainMenu", progress);
break;
case 1:
await SceneManagerService.Instance.SwitchSceneAsync("AppleHillsOverworld", progress);
break;
case 2:
case 1:
await SceneManagerService.Instance.SwitchSceneAsync("Quarry", progress);
break;
case 3:
case 2:
await SceneManagerService.Instance.SwitchSceneAsync("DivingForPictures", progress);
break;
}

View File

@@ -8,9 +8,6 @@ EditorBuildSettings:
- enabled: 1
path: Assets/Scenes/StartingScene.unity
guid: cf01e2d0135b06c4486d00ef393d0274
- enabled: 1
path: Assets/Scenes/MainMenu.unity
guid: b93f2f3b39a62684c8474ba79c8f698d
- enabled: 1
path: Assets/Scenes/Levels/AppleHillsOverworld.unity
guid: 350ef8129fba8174bb68b98a0f75e2f7