No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
The '''main menu''' is the first interactive screen in '''PC Simulator''' after the '''Menu''' scene loads. It is driven by the <code>MainMenu</code> behaviour, which initializes localization, restores settings, coordinates child pages through <code>MenuManager</code>, and starts asynchronous scene loads behind a '''Loading''' screen.
The '''main menu''' is the primary user interface presented when '''[[PC Simulator]]''' starts. It is implemented in the Menu scene and provides access to saved games, the [[Tutorial]], configuration options, and application exit. Save data uses the <code>.pc</code> format documented at [[Save]]; external editing is described at [[Save Editor]]. Discoverable interactions that load preset saves are summarized at [[Secrets]]; the hidden-room achievement context appears at [[Achievements:The Hidden Room]].


{| style="float:right; width:300px; margin:0 0 1em 1em; border-collapse:collapse; border:1px solid #a7a7a7; background:#f8f9fa; font-size:92%;"
{| style="float:right; width:280px; margin:0 0 1em 1em; border-collapse:collapse; border:1px solid #c8ccd1; background:#f8f9fa; font-size:92%;"
|+ style="background:#eaecf0; border:1px solid #a7a7a7; padding:6px; font-weight:bold;" | Quick facts
|+ style="background:#eaecf0; border:1px solid #c8ccd1; padding:6px; font-weight:bold;" | Summary
|-
|-
| style="border:1px solid #a7a7a7; padding:6px; vertical-align:top; width:38%;" | '''Unity scene'''
| style="border:1px solid #c8ccd1; padding:6px;" | '''Function'''
| style="border:1px solid #a7a7a7; padding:6px;" | <code>Menu</code> (project: <code>Assets/Scenes/Menu.unity</code>)
| style="border:1px solid #c8ccd1; padding:6px;" | Front-end hub for starting play, managing saves, and adjusting session settings
|-
|-
| style="border:1px solid #a7a7a7; padding:6px; vertical-align:top;" | '''Core scripts'''
| style="border:1px solid #c8ccd1; padding:6px;" | '''Save format'''
| style="border:1px solid #a7a7a7; padding:6px;" | <code>MainMenu.cs</code>, <code>MenuManager.cs</code>, <code>FileMenu.cs</code>
| style="border:1px solid #c8ccd1; padding:6px;" | <code>.pc</code> files; see [[Save]]
|-
|-
| style="border:1px solid #a7a7a7; padding:6px; vertical-align:top;" | '''Singleton'''
| style="border:1px solid #c8ccd1; padding:6px;" | '''Related economy'''
| style="border:1px solid #a7a7a7; padding:6px;" | <code>MainMenu.Instance</code>
| style="border:1px solid #c8ccd1; padding:6px;" | [[Bitcoin]] and in-game mining ([[EZ Mining]]) apply after gameplay begins
|-
|-
| style="border:1px solid #a7a7a7; padding:6px; vertical-align:top;" | '''Save loads'''
| style="border:1px solid #c8ccd1; padding:6px;" | '''Presentation'''
| style="border:1px solid #a7a7a7; padding:6px;" | <code>SaveManager.Loader</code> + scene <code>startRoomSceneIndex + GameData.room</code>
| style="border:1px solid #c8ccd1; padding:6px;" | The title text alternates to simulate a blinking cursor
|-
| style="border:1px solid #a7a7a7; padding:6px; vertical-align:top;" | '''Examples'''
| style="border:1px solid #a7a7a7; padding:6px;" | <code>StreamingAssets/Examples/*.pc</code>
|}
|}


== Overview ==
<div style="clear:both;"></div>
 
The main menu is the hub for:
 
* Opening and starting games from user '''save files''' (<code>.pc</code>) in the save folder
* Launching the '''Tutorial''' scene and recording that the current tutorial revision was shown
* Loading '''example''' presets from streaming assets (e.g. <code>Classic.pc</code>, versioned examples, <code>Hidden Room.pc</code> when triggered from in-game)
* Navigating sub-pages (options, language, about, file tools, etc.) via a stacked UI managed by <code>MenuManager</code>
* Quitting the application where supported
 
The title line alternates every 0.5 seconds between <code>PC Simulator</code> and <code>PC Simulator_</code>, with <code>PC</code> in orange using Unity UI Rich Text.
 
== Localization ==
 
On <code>Awake</code>, <code>MainMenu</code>:
 
# Calls <code>Localization.CreateContent()</code>
# Sets language from <code>PlayerPrefs</code> key <code>"Language"</code>, or from <code>Application.systemLanguage</code> mapped to codes such as <code>EN</code>, <code>DE</code>, <code>ZH-CN</code>, <code>JA</code>, etc.
# Subscribes to <code>Localization.LanguageChanged</code> to write the active language back to <code>PlayerPrefs</code>
 
== Settings restored at menu start ==
 
<code>Start</code> restores:
 
* '''FPS''' — <code>FpsSetting.RestoreSetting()</code>
* '''Resolution''' — <code>ResolutionSetting.RestoreSetting()</code>
* '''Volume''' — <code>AudioListener.volume</code> from <code>PlayerPrefs "Volume"</code> (default <code>1f</code>)


== Tutorial prompt ==
== Purpose and functions ==


If <code>PlayerPrefs.GetInt("TutorialVersion", -1)</code> is less than the inspector field <code>tutorialVersion</code>, the object <code>guideToTutorial</code> is enabled; otherwise it is hidden. Calling <code>Tutorial()</code> sets <code>TutorialVersion</code> to the current value and loads the scene named <code>"Tutorial"</code>.
The main menu exposes the following capabilities:


== Navigation stack (<code>MenuManager</code>) ==
* '''Game load:''' Saved games are listed, typically ordered by most recent file modification time. Saves flagged as hardcore may display a dedicated indicator in the user interface.
* '''Tutorial access:''' If the stored tutorial revision is older than the value configured in the build, a prompt object is shown. Accepting the tutorial updates the stored revision and loads the Tutorial scene.
* '''Settings:''' Frame rate and resolution preferences are restored when the menu initializes so that the initial view matches prior configuration.
* '''Audio:''' Master volume is read from <code>PlayerPrefs</code> and applied to the audio listener before extended playback.
* '''Import:''' External <code>.pc</code> files may be selected, validated, and copied into the user save directory. Invalid or incompatible files produce an error message. This workflow supports distribution and [[Modding]].
* '''Exit:''' The application requests termination via <code>Application.Quit</code>. Behaviour depends on platform; the Unity Editor may show no visible shutdown.


<code>MenuManager</code> keeps a stack of active menu <code>GameObject</code> pages:
== Load sequence (overview) ==


* <code>ShowMenu(string pageName)</code> — finds a child whose '''hierarchy name''' equals <code>pageName</code> (e.g. <code>Loading</code>, <code>FileInformation</code>), hides the previous top if different, pushes and shows the new page
# The player selects a save entry, or the application loads a preset or example file.
* <code>Back()</code> — pops one level if the stack has more than one entry, reactivates the previous page
# The active <code>DataLoader</code> instance is registered for the subsequent scene.
* <code>HideMenu(bool hide)</code> — toggles visibility of the top page without changing the stack
# The target scene index is derived from saved <code>GameData.room</code> relative to a configured base build index.


Optional UI click sounds can play on <code>ShowMenu</code> and <code>Back</code> when enabled in the inspector.
Certain [[Secrets]] and achievement-related paths load example content from streaming assets rather than the user save folder. The programmatic path parallels normal save loading once the file contents are obtained. See [[Achievements:The Hidden Room]] for the documented hidden-room case.


Scene loads always call <code>ShowMenu("Loading")</code> first so the loading panel is visible during the async operation.
== In-depth ==


== Loading screen behaviour ==
The following subsection describes implementation-level behaviour consistent with the decompiled project structure. Asset extraction is discussed at [[Decompile]]; extension of behaviour at [[Modding]].


Loads use <code>SceneManager.LoadSceneAsync</code> with <code>allowSceneActivation == false</code> until progress reaches <code>0.9f</code>.
=== Core components ===


* Displayed percent: <code>Mathf.Clamp01(operation.progress / 0.9f) * 100f</code>
{| style="border-collapse:collapse; width:100%; border:1px solid #c8ccd1;"
* When <code>progress >= 0.9f</code>, the text shows 100%, waits '''0.5''' seconds, then sets <code>allowSceneActivation = true</code>
* Label text: localized <code>"Loading..."</code> plus a new line and <code>[percentage%]</code>
 
== Save files and examples ==
 
=== User saves (<code>FileMenu</code>) ===
 
* Scans the save directory for files matching the save extension
* Sorts by '''last write time''', newest first
* Each slot shows <code>GameData.roomName</code> and a '''Hardcore''' marker when <code>GameData.hardcore</code> is true
* Clicking the name runs <code>MainMenu.Instance.LoadFile(loader)</code>, which sets <code>SaveManager.Loader</code> and loads build index <code>startRoomSceneIndex + GameData.room</code>
 
=== Example presets ===
 
<code>LoadExample(string name)</code> reads <code>StreamingAssets/Examples/</code> + name + <code>.pc</code>. On Android and WebGL the file is read via <code>UnityWebRequest</code>; elsewhere via <code>File.ReadAllText</code>. The string is parsed with <code>DataLoader.LoadFromString</code>, then the same <code>LoadFile</code> path as a normal save.
 
=== Scene index convention ===
 
<code>LoadScene(int sceneBuildIndex)</code> loads <code>startRoomSceneIndex + sceneBuildIndex</code>. Saves store a small integer <code>room</code>; the inspector base index aligns that id with the correct Unity scene in build order.
 
=== Exit ===
 
<code>Exit()</code> calls <code>Application.Quit()</code> (no visible effect in the Unity Editor).
 
== Implementation reference ==
 
{| style="border-collapse:collapse; width:100%; border:1px solid #a7a7a7;"
|+ style="caption-side:top; text-align:left; font-weight:bold; padding:4px 0;" | Components
|- style="background:#eaecf0;"
|- style="background:#eaecf0;"
! style="border:1px solid #a7a7a7; padding:8px; text-align:left; width:22%;" | Script
! style="border:1px solid #c8ccd1; padding:8px; text-align:left; width:22%;" | Type
! style="border:1px solid #a7a7a7; padding:8px; text-align:left;" | Role
! style="border:1px solid #c8ccd1; padding:8px; text-align:left;" | Description
|-
|-
| style="border:1px solid #a7a7a7; padding:8px; vertical-align:top;" | <code>MainMenu</code>
| style="border:1px solid #c8ccd1; padding:8px; vertical-align:top;" | <code>MainMenu</code>
| style="border:1px solid #a7a7a7; padding:8px;" | Singleton; localization; tutorial gating; title blink (<code>InvokeRepeating</code> every 0.5 s); example and scene loading; quit
| style="border:1px solid #c8ccd1; padding:8px;" | MonoBehaviour singleton exposed as <code>MainMenu.Instance</code>. Initializes localization, restores display settings, controls tutorial gating, drives the title animation, performs asynchronous scene loads, loads example files, and invokes quit.
|-
|-
| style="border:1px solid #a7a7a7; padding:8px; vertical-align:top;" | <code>MenuManager</code>
| style="border:1px solid #c8ccd1; padding:8px; vertical-align:top;" | <code>MenuManager</code>
| style="border:1px solid #a7a7a7; padding:8px;" | Stack of menu pages; show, back, hide; optional click sound
| style="border:1px solid #c8ccd1; padding:8px;" | Maintains a stack of active menu <code>GameObject</code> roots. <code>ShowMenu(string)</code> activates the child whose object name matches the argument (for example <code>Loading</code>). <code>Back</code> removes the current page when the stack depth exceeds one. <code>HideMenu</code> toggles visibility of the top entry without altering stack order. Optional audio feedback may be enabled.
|-
|-
| style="border:1px solid #a7a7a7; padding:8px; vertical-align:top;" | <code>FileMenu</code>
| style="border:1px solid #c8ccd1; padding:8px; vertical-align:top;" | <code>FileMenu</code>
| style="border:1px solid #a7a7a7; padding:8px;" | Lists saves, rename/metadata UI, delete, import external <code>.pc</code>
| style="border:1px solid #c8ccd1; padding:8px;" | Enumerates save files, constructs list entries, supports metadata editing through <code>FileInformation</code>, deletion, and import via native file selection.
|}
|}


== In-depth: source code ==
=== Localization ===


=== <code>MainMenu.cs</code> — lifecycle ===
During <code>Awake</code>, <code>MainMenu</code> invokes <code>Localization.CreateContent()</code>, sets the active language from stored preferences or from <code>Application.systemLanguage</code>, and registers a handler so language changes persist. Further string tables and language codes may be documented at [[Localization]].


==== <code>Awake</code> ====
=== Tutorial revision flag ===


* Sets <code>MainMenu.Instance</code> so other scripts (e.g. <code>FileMenu</code>, <code>HiddenRoom</code>) can invoke <code>LoadFile</code> / <code>LoadExample</code> without serialized references.
The integer <code>TutorialVersion</code> in <code>PlayerPrefs</code> is compared to the serialized <code>tutorialVersion</code> field. When the stored value is lower, the guide object is enabled. The <code>Tutorial()</code> method writes the current revision and loads the scene named <code>Tutorial</code>.
* Runs localization setup and applies stored or system-default language.
* Persists language changes through <code>Localization.LanguageChanged</code>.


==== <code>Start</code> ====
=== Asynchronous loading ===


* Restores FPS and resolution from saved settings.
Scene transitions display a <code>Loading</code> menu page, then execute an asynchronous load. Reported progress is scaled so that the engine’s <code>0.9</code> completion point maps to a 100 percent display value. After reaching that threshold, the interface shows 100 percent, delays for a fixed interval, then permits scene activation. A dedicated article may appear at [[Loading screen]].
* Shows or hides the tutorial guide based on <code>TutorialVersion</code> vs <code>tutorialVersion</code>.
* Applies master volume to <code>AudioListener</code>.
* Starts the repeating title animation.


==== <code>Blinking</code> ====
=== Save and example loading ===


Toggles between two Rich Text strings on the title <code>Text</code> component for a blinking underscore effect.
<code>LoadFile(DataLoader loader)</code> assigns <code>SaveManager.Loader</code> and loads the build index <code>startRoomSceneIndex + GameData.room</code>. The inspector-configured <code>startRoomSceneIndex</code> aligns logical room identifiers with the editor build order.


==== <code>LoadExample(string name)</code> ====
<code>LoadExample(string name)</code> reads <code>StreamingAssets/Examples/{name}.pc</code>. On Android and WebGL the implementation uses <code>UnityWebRequest</code>; on other platforms it uses direct file read APIs. The payload is passed to <code>DataLoader.LoadFromString</code>, followed by <code>LoadFile</code>. Bundled asset names may be listed at [[StreamingAssets]].


Resolves <code>StreamingAssets/Examples/{name}.pc</code>, reads file bytes as text (platform-specific), then <code>DataLoader.LoadFromString</code> and <code>LoadFile</code>. On Android/WebGL the implementation uses <code>UnityWebRequest</code> and waits synchronously for completion.
=== Import implementation ===


==== <code>LoadFile(DataLoader loader)</code> ====
<code>FileMenu.Import</code> opens a native picker restricted to <code>.pc</code> extensions, verifies read access, attempts <code>DataLoader.LoadFromPath</code>, copies the file into the save directory using <code>SaveUtility.GetNewPath</code>, destroys existing list rows, and rebuilds the list from disk. Parse failures surface a localized error referencing minimum supported save versions.


Assigns <code>SaveManager.Loader = loader</code> and loads <code>startRoomSceneIndex + loader.GameData.room</code>.
=== Control flow reference ===


==== <code>Tutorial()</code> ====
{| style="border-collapse:collapse; width:100%; border:1px solid #c8ccd1;"
 
Writes <code>PlayerPrefs "TutorialVersion"</code> and loads the <code>"Tutorial"</code> scene by name via <code>LoadScene(string)</code>.
 
==== <code>LoadAsync</code> coroutine ====
 
# Shows the <code>Loading</code> menu page by name.
# Holds <code>allowSceneActivation</code> false while updating <code>loadingText</code> from async <code>progress</code>.
# After <code>0.9f</code> progress, shows 100%, waits 0.5 s, then allows activation.
 
=== <code>MenuManager.cs</code> ===
 
==== <code>Start</code> ====
 
Initializes the stack: whichever entry in the <code>menus</code> array is already active is pushed as the initial page.
 
==== <code>ShowMenu(string pageName)</code> ====
 
Linear search for <code>menu.name == pageName</code>. If the stack top is a different object, deactivate it, push the new page, activate it. Same reference as current top results in no duplicate push.
 
==== <code>Back</code> ====
 
If <code>menuStack.Count <= 1</code>, return. Otherwise pop, deactivate popped page, activate new top.
 
==== <code>HideMenu(bool hide)</code> ====
 
Sets <code>SetActive(!hide)</code> on the stack top without popping.
 
=== <code>FileMenu.cs</code> ===
 
==== <code>Start</code> ====
 
Enumerates save files, maps path → last write time, sorts descending, calls <code>AddSlot</code> for each. Shows <code>empty</code> when the list is empty.
 
==== <code>AddSlot(string path)</code> ====
 
Wrapped in try/catch; failures are skipped. Instantiates a row, binds <code>roomName</code> and hardcore flag, wires '''Edit''' to file information and '''Name''' to <code>MainMenu.Instance.LoadFile</code>.
 
==== <code>RefreshLoadButton</code> / <code>DeleteLoadButton</code> ====
 
Refresh updates labels after metadata changes. Delete removes the file, destroys the row, updates empty state.
 
==== <code>Import</code> ====
 
Uses native file picker filtered to <code>.pc</code>. Verifies read permission, validates via <code>DataLoader.LoadFromPath</code>, copies into the save folder with <code>SaveUtility.GetNewPath</code>, then clears and rebuilds the slot list from disk.
 
=== Data flow summary ===
 
{| style="border-collapse:collapse; width:100%; border:1px solid #a7a7a7;"
|- style="background:#eaecf0;"
|- style="background:#eaecf0;"
! style="border:1px solid #a7a7a7; padding:8px; text-align:left; width:28%;" | Action
! style="border:1px solid #c8ccd1; padding:8px; text-align:left; width:28%;" | Event
! style="border:1px solid #a7a7a7; padding:8px; text-align:left;" | Code path
! style="border:1px solid #c8ccd1; padding:8px; text-align:left;" | Processing
|-
|-
| style="border:1px solid #a7a7a7; padding:8px; vertical-align:top;" | Player starts a save from the list
| style="border:1px solid #c8ccd1; padding:8px; vertical-align:top;" | Save name activated
| style="border:1px solid #a7a7a7; padding:8px;" | <code>MainMenu.LoadFile</code> <code>SaveManager.Loader</code> → async load <code>startRoomSceneIndex + room</code>
| style="border:1px solid #c8ccd1; padding:8px;" | <code>MainMenu.LoadFile</code>; <code>SaveManager.Loader</code> assignment; asynchronous load of <code>startRoomSceneIndex + room</code>
|-
|-
| style="border:1px solid #a7a7a7; padding:8px; vertical-align:top;" | Example or secret loads a preset
| style="border:1px solid #c8ccd1; padding:8px; vertical-align:top;" | Example or secret preset
| style="border:1px solid #a7a7a7; padding:8px;" | <code>LoadExample</code> reads <code>StreamingAssets/Examples/&lt;name&gt;.pc</code> → <code>LoadFile</code>
| style="border:1px solid #c8ccd1; padding:8px;" | <code>LoadExample</code> from streaming assets; then <code>LoadFile</code>
|-
|-
| style="border:1px solid #a7a7a7; padding:8px; vertical-align:top;" | Any scene load from menu
| style="border:1px solid #c8ccd1; padding:8px; vertical-align:top;" | Scene transition from menu
| style="border:1px solid #a7a7a7; padding:8px;" | <code>MenuManager.ShowMenu("Loading")</code> then <code>LoadAsync</code>
| style="border:1px solid #c8ccd1; padding:8px;" | <code>ShowMenu("Loading")</code>; coroutine until activation allowed
|-
|-
| style="border:1px solid #a7a7a7; padding:8px; vertical-align:top;" | Player confirms tutorial
| style="border:1px solid #c8ccd1; padding:8px; vertical-align:top;" | Tutorial accepted
| style="border:1px solid #a7a7a7; padding:8px;" | <code>Tutorial()</code> updates <code>TutorialVersion</code> → load <code>"Tutorial"</code>
| style="border:1px solid #c8ccd1; padding:8px;" | <code>TutorialVersion</code> updated; <code>LoadScene("Tutorial")</code>
|}
|}


== See also ==
== See also ==


* Tutorial scene and <code>Tutorial.cs</code> in-game steps
* [[PC Simulator]]
* Pause menu and in-game <code>MenuManager</code> usage
* [[Save]] · [[Save Editor]]
* Save format: <code>DataLoader</code>, <code>GameData</code>, <code>SaveUtility</code>
* [[Secrets]] · [[Achievements:The Hidden Room]]
 
* [[Bitcoin]] · [[EZ Mining]]
<!-- Optional: add wiki links when your wiki has pages, e.g. [[Tutorial]] -->
* [[Modding]] · [[Decompile]]
* [[Main Page]]

Latest revision as of 18:20, 22 March 2026

The main menu is the primary user interface presented when PC Simulator starts. It is implemented in the Menu scene and provides access to saved games, the Tutorial, configuration options, and application exit. Save data uses the .pc format documented at Save; external editing is described at Save Editor. Discoverable interactions that load preset saves are summarized at Secrets; the hidden-room achievement context appears at Achievements:The Hidden Room.

Summary
Function Front-end hub for starting play, managing saves, and adjusting session settings
Save format .pc files; see Save
Related economy Bitcoin and in-game mining (EZ Mining) apply after gameplay begins
Presentation The title text alternates to simulate a blinking cursor

Purpose and functions

The main menu exposes the following capabilities:

  • Game load: Saved games are listed, typically ordered by most recent file modification time. Saves flagged as hardcore may display a dedicated indicator in the user interface.
  • Tutorial access: If the stored tutorial revision is older than the value configured in the build, a prompt object is shown. Accepting the tutorial updates the stored revision and loads the Tutorial scene.
  • Settings: Frame rate and resolution preferences are restored when the menu initializes so that the initial view matches prior configuration.
  • Audio: Master volume is read from PlayerPrefs and applied to the audio listener before extended playback.
  • Import: External .pc files may be selected, validated, and copied into the user save directory. Invalid or incompatible files produce an error message. This workflow supports distribution and Modding.
  • Exit: The application requests termination via Application.Quit. Behaviour depends on platform; the Unity Editor may show no visible shutdown.

Load sequence (overview)

  1. The player selects a save entry, or the application loads a preset or example file.
  2. The active DataLoader instance is registered for the subsequent scene.
  3. The target scene index is derived from saved GameData.room relative to a configured base build index.

Certain Secrets and achievement-related paths load example content from streaming assets rather than the user save folder. The programmatic path parallels normal save loading once the file contents are obtained. See Achievements:The Hidden Room for the documented hidden-room case.

In-depth

The following subsection describes implementation-level behaviour consistent with the decompiled project structure. Asset extraction is discussed at Decompile; extension of behaviour at Modding.

Core components

Type Description
MainMenu MonoBehaviour singleton exposed as MainMenu.Instance. Initializes localization, restores display settings, controls tutorial gating, drives the title animation, performs asynchronous scene loads, loads example files, and invokes quit.
MenuManager Maintains a stack of active menu GameObject roots. ShowMenu(string) activates the child whose object name matches the argument (for example Loading). Back removes the current page when the stack depth exceeds one. HideMenu toggles visibility of the top entry without altering stack order. Optional audio feedback may be enabled.
FileMenu Enumerates save files, constructs list entries, supports metadata editing through FileInformation, deletion, and import via native file selection.

Localization

During Awake, MainMenu invokes Localization.CreateContent(), sets the active language from stored preferences or from Application.systemLanguage, and registers a handler so language changes persist. Further string tables and language codes may be documented at Localization.

Tutorial revision flag

The integer TutorialVersion in PlayerPrefs is compared to the serialized tutorialVersion field. When the stored value is lower, the guide object is enabled. The Tutorial() method writes the current revision and loads the scene named Tutorial.

Asynchronous loading

Scene transitions display a Loading menu page, then execute an asynchronous load. Reported progress is scaled so that the engine’s 0.9 completion point maps to a 100 percent display value. After reaching that threshold, the interface shows 100 percent, delays for a fixed interval, then permits scene activation. A dedicated article may appear at Loading screen.

Save and example loading

LoadFile(DataLoader loader) assigns SaveManager.Loader and loads the build index startRoomSceneIndex + GameData.room. The inspector-configured startRoomSceneIndex aligns logical room identifiers with the editor build order.

LoadExample(string name) reads StreamingAssets/Examples/{name}.pc. On Android and WebGL the implementation uses UnityWebRequest; on other platforms it uses direct file read APIs. The payload is passed to DataLoader.LoadFromString, followed by LoadFile. Bundled asset names may be listed at StreamingAssets.

Import implementation

FileMenu.Import opens a native picker restricted to .pc extensions, verifies read access, attempts DataLoader.LoadFromPath, copies the file into the save directory using SaveUtility.GetNewPath, destroys existing list rows, and rebuilds the list from disk. Parse failures surface a localized error referencing minimum supported save versions.

Control flow reference

Event Processing
Save name activated MainMenu.LoadFile; SaveManager.Loader assignment; asynchronous load of startRoomSceneIndex + room
Example or secret preset LoadExample from streaming assets; then LoadFile
Scene transition from menu ShowMenu("Loading"); coroutine until activation allowed
Tutorial accepted TutorialVersion updated; LoadScene("Tutorial")

See also