SceneSetupGuide.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. using UnityEngine;
  2. /// <summary>
  3. /// This component provides instructions and utilities for setting up scenes properly
  4. /// in the RPG RougeLiteBattler project.
  5. /// </summary>
  6. public class SceneSetupGuide : MonoBehaviour
  7. {
  8. [Header("Scene Setup Instructions")]
  9. [TextArea(10, 20)]
  10. public string setupInstructions = @"SCENE SETUP GUIDE for RPG RougeLiteBattler
  11. TITLE SCREEN SCENE:
  12. 1. Create an empty GameObject named 'TitleScreenManager'
  13. 2. Add UIDocument component and assign TitleScreen.uxml
  14. 3. Add TitleScreenManager script
  15. 4. Ensure TitleScreen.uxml has buttons with names:
  16. - NewGameButton
  17. - LoadGameButton
  18. - QuitButton
  19. MAIN TEAM SELECT SCENE:
  20. 1. Should already have MainTeamSelectScript on an object with UIDocument
  21. 2. Add navigation buttons to the UI Document:
  22. - BackToTitleButton (to return to title)
  23. - ProceedToBattleButton (to go to battle setup)
  24. BATTLE SETUP SCENE:
  25. 1. Should already have BattleSetupMenu script
  26. 2. Add a 'Back to Team Select' button
  27. 3. Assign the button to backToTeamSelectButton field in BattleSetupMenu
  28. BUILD SETTINGS:
  29. The scenes should be added to Build Settings in this order:
  30. 0. TitleScreen
  31. 1. MainTeamSelectScene
  32. 2. BattleSetupMenu
  33. 3. BattleScene
  34. 4. MapMaker (optional)
  35. TESTING:
  36. - Start the game from TitleScreen scene
  37. - Test navigation: Title -> Team Select -> Battle Setup -> Battle
  38. - Test back buttons work correctly
  39. - Test save/load functionality";
  40. [Header("Current Scene Info")]
  41. public string currentSceneName;
  42. public bool hasRequiredComponents;
  43. private void Start()
  44. {
  45. currentSceneName = UnityEngine.SceneManagement.SceneManager.GetActiveScene().name;
  46. CheckSceneSetup();
  47. }
  48. private void CheckSceneSetup()
  49. {
  50. switch (currentSceneName)
  51. {
  52. case "TitleScreen":
  53. CheckTitleScreenSetup();
  54. break;
  55. case "MainTeamSelectScene":
  56. CheckTeamSelectSetup();
  57. break;
  58. case "BattleSetupMenu":
  59. CheckBattleSetupSetup();
  60. break;
  61. default:
  62. Debug.Log($"Scene setup guide not configured for scene: {currentSceneName}");
  63. break;
  64. }
  65. }
  66. private void CheckTitleScreenSetup()
  67. {
  68. TitleScreenManager manager = FindFirstObjectByType<TitleScreenManager>();
  69. if (manager == null)
  70. {
  71. Debug.LogWarning("TitleScreenManager not found in scene! Please add it.");
  72. hasRequiredComponents = false;
  73. }
  74. else
  75. {
  76. Debug.Log("✓ TitleScreenManager found");
  77. hasRequiredComponents = true;
  78. }
  79. }
  80. private void CheckTeamSelectSetup()
  81. {
  82. MainTeamSelectScript manager = FindFirstObjectByType<MainTeamSelectScript>();
  83. if (manager == null)
  84. {
  85. Debug.LogWarning("MainTeamSelectScript not found in scene!");
  86. hasRequiredComponents = false;
  87. }
  88. else
  89. {
  90. Debug.Log("✓ MainTeamSelectScript found");
  91. hasRequiredComponents = true;
  92. }
  93. }
  94. private void CheckBattleSetupSetup()
  95. {
  96. BattleSetupMenu manager = FindFirstObjectByType<BattleSetupMenu>();
  97. if (manager == null)
  98. {
  99. Debug.LogWarning("BattleSetupMenu not found in scene!");
  100. hasRequiredComponents = false;
  101. }
  102. else
  103. {
  104. Debug.Log("✓ BattleSetupMenu found");
  105. hasRequiredComponents = true;
  106. }
  107. }
  108. [ContextMenu("Log Scene Setup Status")]
  109. public void LogSceneSetupStatus()
  110. {
  111. Debug.Log($"Current Scene: {currentSceneName}");
  112. Debug.Log($"Required Components Present: {hasRequiredComponents}");
  113. Debug.Log("Setup Instructions:\n" + setupInstructions);
  114. }
  115. }