Skip to content

Commit c457f9a

Browse files
committed
initial commit [website]
0 parents  commit c457f9a

File tree

93 files changed

+23822
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+23822
-0
lines changed

.github/workflows/web-deploy.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- docs
7+
8+
jobs:
9+
build:
10+
name: Build Docusaurus 🦖
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '18'
21+
22+
- name: Install dependencies
23+
run: npm install
24+
25+
- name: Build Docusaurus site
26+
run: npm run build
27+
28+
- name: Deploy to GitHub Pages
29+
uses: actions/upload-pages-artifact@v3
30+
with:
31+
path: build
32+
33+
deploy:
34+
name: Deploy To GitHub Pages 🚀
35+
needs: build
36+
runs-on: ubuntu-latest
37+
38+
permissions:
39+
pages: write
40+
id-token: write
41+
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
46+
steps:
47+
- name: Deploy to GitHub Pages
48+
id: deployment
49+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# IDE
2+
.vs
3+
.vscode
4+
.vsconfig
5+
6+
# Unity Folders
7+
Assets/
8+
CodeCoverage/
9+
Library/
10+
Logs/
11+
obj/
12+
Temp/
13+
UserSettings/
14+
15+
# Unity Files
16+
*.csproj
17+
*.sln
18+
19+
# Dependencies
20+
/node_modules
21+
22+
# Production
23+
/build
24+
25+
# Generated files
26+
.docusaurus
27+
.cache-loader
28+
29+
# Misc
30+
.DS_Store
31+
.env.local
32+
.env.development.local
33+
.env.test.local
34+
.env.production.local
35+
36+
npm-debug.log*
37+
yarn-debug.log*
38+
yarn-error.log*

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Advanced Scene Manager Documentation
2+
3+
This repository contains the documentation for **Advanced Scene Manager**, a Unity package designed to streamline scene transitions, async operations, and addressable scene management.
4+
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
5+
6+
## Prerequisites
7+
8+
To run and build this documentation site locally, you need to have **Node.js 18+** installed.
9+
10+
You can download the latest version of Node.js from [here](https://nodejs.org/en/download/).
11+
12+
## Running the Website Locally
13+
14+
1. Clone the repository (if you haven’t already).
15+
2. Install the necessary dependencies:
16+
```bash
17+
npm install
18+
```
19+
3. To run the site locally:
20+
```bash
21+
npx docusaurus start
22+
```
23+
This will start a local development server at `http://localhost:3000`.
24+
4. To run the site locally in a different locale (e.g., Português Brasileiro):
25+
```bash
26+
npm run start -- --locale pt-BR
27+
```
28+
This will start the site with the specified locale.
29+
30+
## Building the Website Locally
31+
32+
If you want to validate the site build before pushing, run the following command:
33+
34+
```bash
35+
npm run build
36+
```
37+
38+
This will generate the static files in the `build` directory.
39+
40+
## Deployment
41+
42+
The deployment of the website is automated through a **GitHub Actions** workflow. Every time changes are pushed to the `docs` branch, GitHub Actions will automatically build and deploy the updated documentation to **GitHub Pages**.
43+
44+
You don't need to manually deploy the site, as the process is handled by the GitHub Actions pipeline.
45+
46+
## Contributing
47+
48+
Feel free to contribute by opening issues or submitting pull requests with updates to the documentation.

docs/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 MyGameDevTools
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

docs/advanced-usage/_category_.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"label": "Advanced Usage",
3+
"position": 3,
4+
"link": {
5+
"type": "generated-index"
6+
}
7+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
5+
# Advanced Scene Manager
6+
7+
The `AdvancedSceneManager` is a static wrapper to the `CoreSceneManager` class, that exists to simplify the usage experience of the **Scene Operations**.
8+
It manages an internal reference to a Core Scene Manager that is created during the `RuntimeInitializeOnLoadMethod` callback, which is executed after the first scene has loaded and after the first `Awake()` cycle.
9+
That means that the `AdvancedSceneManager` will not be initialized until the first `Start()` cycle.
10+
11+
```cs
12+
[RuntimeInitializeOnLoadMethod]
13+
internal static void Initialize()
14+
{
15+
_instance = new CoreSceneManager(true);
16+
}
17+
```
18+
19+
## Static API
20+
21+
You can optionally disable the `AdvancedSceneManager` static class entirely if you wish to manually handle the `CoreSceneManager` lifecycle and/or extend any functionality.
22+
To do it, simply define the scripting symbol `DISABLE_STATIC_SCENE_MANAGER` on your scripting compilation settings.
23+
24+
## Extension Methods
25+
26+
As it doesn't expose the internal `CoreSceneManager` instance, it reimplements the extension methods so you have exactly the same usage options for the **Scene Operations** available statically.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
sidebar_position: 6
3+
---
4+
5+
# Async Scene Operation
6+
7+
The `IAsyncSceneOperation` interface is a way to abstract non-addressable and addressable async operations.
8+
The standard workflow returns an `AsyncOperation` object, that does not link directly to the loaded scene, while the addressable workflow returns an `AsyncOperationHandle<SceneInstance>` with a direct reference to the scene.
9+
10+
## `IAsyncSceneOperation` interface
11+
12+
The `IAsyncSceneOperation` interface simply defines:
13+
14+
```cs
15+
public interface IAsyncSceneOperation
16+
{
17+
event Action Completed;
18+
19+
float Progress { get; }
20+
bool IsDone { get; }
21+
bool HasDirectReferenceToScene { get; }
22+
23+
Scene GetResult();
24+
}
25+
```
26+
27+
It exposes an event to notify its completion, whether it's done and its progress, much like the regular `AsyncOperation` and `AsyncOperationHandle`.
28+
Additionally, it also has a property to return whether this `IAsyncSceneOperation` has a direct reference to a scene, and finally a method to get the resulting scene.
29+
30+
## Implementations
31+
32+
There is one implementations of this interface for each workflow: `AsyncSceneOperationStandard` and `AsyncSceneOperationAddressable`.
33+
34+
| | `AsyncSceneOperationStandard` | `AsyncSceneOperationAddressable`
35+
| :-- | :--: | :--:
36+
| **Async Operation Type** | `AsyncOperation` | `AsyncOperationHandle<SceneInstance>`
37+
| **Has Reference to Scene** | ❌ | ✅
38+
39+
## Creation
40+
41+
You don't need to manually create an `IAsyncSceneOperation`, since it's done internally by the `ISceneData` implementations when calling `ISceneData.LoadSceneAsync` and `ISceneData.UnloadSceneAsync`.
42+
As the `ISceneData` also has two implementations, it will create the correct `IAsyncSceneOperation` type based on its workflow.
43+
44+
```mermaid
45+
flowchart LR
46+
47+
subgraph ISceneData
48+
sds(SceneDataStandard)
49+
sda(SceneDataAddressable)
50+
end
51+
52+
subgraph IAsyncSceneOperation
53+
asos(AsyncSceneOperationStandard)
54+
asoa(AsyncSceneOperationAddressable)
55+
end
56+
57+
sds === asos
58+
sda === asoa
59+
```

docs/advanced-usage/core-concepts.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
sidebar_position: 1
3+
description: An introduction to the advanced usage of the Advanced Scene Manager.
4+
---
5+
6+
# Core Concepts
7+
8+
There are some key structures that need to be understood in order to dive deep into the logic of the Advanced Scene Manager.
9+
10+
## Architecture
11+
12+
This is an overview of the Advanced Scene Manager architecture. We will dive into each individual component in the next pages.
13+
Consider this flowchart:
14+
15+
```mermaid
16+
flowchart TB
17+
asm(Advanced Scene Manager)
18+
sd(Core Scene Manager)
19+
isd([ISceneManager])
20+
so{{Load, Unload or Transition}}
21+
sp(Scene Parameter)
22+
lsi([ILoadSceneInfo])
23+
24+
asm ==> sd
25+
sd === so
26+
sd o--o isd
27+
lsi o--o sp
28+
sp o==o so
29+
30+
scd([ISceneData])
31+
lsi2([ILoadSceneInfo])
32+
33+
aso([IAsyncSceneOperation])
34+
35+
sr(SceneResult)
36+
37+
so === scd
38+
scd ==> aso
39+
scd o--o lsi2
40+
41+
aso === sr
42+
sr === so
43+
```
44+
45+
- The `AdvancedSceneManager` is a static implementation of a `CoreSceneManager`, which contains all the logic to perform **Scene Operations**.
46+
- The `CoreSceneManager` is an implementation of the `ISceneManager` interface, that by itself only defines "low-level" **Scene Operations** methods that receive `SceneParameter` arguments.
47+
- The `SceneParameter` struct is an abstraction to handle a single `ILoadSceneInfo` or multiple (`ILoadSceneInfo[]`).
48+
- The `ILoadSceneInfo` interface is an abstraction of a reference to a scene. It has the following implementations:
49+
- `LoadSceneInfoName`: name or path
50+
- `LoadSceneInfoIndex`: build index
51+
- `LoadSceneInfoScene`: a loaded scene
52+
- `LoadSceneInfoAddress`: an addressable address
53+
- `LoadSceneInfoAssetReference`: an `AssetReference`
54+
- The **Scene Operations** called by the `CoreSceneManager` will use `ISceneData` implementations internally, as it stores the `ILoadSceneInfo` used to load a scene and also stores an `IAsyncSceneOperation` that can reference both the load or unload operation.
55+
- A completed **Scene Operation** will return a `SceneResult` struct, that can hold a single or multiple scenes, depending on the `SceneParameter` method input.
56+
57+
:::info
58+
**Scene Operations** refer to the Load, Unload and Transition operations.
59+
:::
60+
61+
We will cover each of these structures in the next pages.

0 commit comments

Comments
 (0)