Skip to content

Commit 2921ae8

Browse files
committed
update to docusaurus 3.8.1 & add scene reload docs
1 parent 8ec267f commit 2921ae8

File tree

15 files changed

+4481
-2258
lines changed

15 files changed

+4481
-2258
lines changed

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ You can download the latest version of Node.js from [here](https://nodejs.org/en
1818
```
1919
3. To run the site locally:
2020
```bash
21-
npx docusaurus start
21+
npx run start
2222
```
2323
This will start a local development server at `http://localhost:3000`.
2424
4. To run the site locally in a different locale (e.g., Português Brasileiro):
@@ -27,6 +27,38 @@ You can download the latest version of Node.js from [here](https://nodejs.org/en
2727
```
2828
This will start the site with the specified locale.
2929

30+
## Versioning
31+
32+
To start documentation on a new version, run:
33+
34+
```bash
35+
npm run docusaurus docs:version <version>
36+
```
37+
38+
This will copy the latest documentation and place it into the `version-<version>` folder.
39+
You can update the files inside `docs/` to reflect the new documentation version.
40+
41+
Make sure to update the current version name as well in the `docusaurus.config.js` file at:
42+
43+
```js
44+
const config = {
45+
presets: [
46+
[
47+
({
48+
docs: {
49+
lastVersion: 'current',
50+
versions: {
51+
current: {
52+
label: '<version>'
53+
}
54+
}
55+
}
56+
})
57+
]
58+
]
59+
}
60+
```
61+
3062
## Building the Website Locally
3163

3264
If you want to validate the site build before pushing, run the following command:

docs/advanced-usage/core-concepts.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ flowchart TB
5656

5757
:::info
5858
**Scene Operations** refer to the Load, Unload and Transition operations.
59+
A Reload operation is considered a Transition operation.
5960
:::
6061

6162
We will cover each of these structures in the next pages.

docs/advanced-usage/core-scene-manager.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ public interface ISceneManager : IDisposable
2525

2626
Task<SceneResult> TransitionAsync(SceneParameters sceneParameters, ILoadSceneInfo intermediateSceneReference = default, CancellationToken token = default);
2727

28+
Task<SceneResult> ReloadActiveSceneAsync(ILoadSceneInfo intermediateSceneReference = null, CancellationToken token = default);
29+
2830
Task<SceneResult> LoadAsync(SceneParameters sceneParameters, IProgress<float> progress = null, CancellationToken token = default);
2931

3032
Task<SceneResult> UnloadAsync(SceneParameters sceneParameters, CancellationToken token = default);
@@ -49,7 +51,7 @@ The `CoreSceneManager` is expected to be used as a layer on top of the Unity `Sc
4951
flowchart LR
5052
usm(Unity Scene Manager)
5153
scd(Core Scene Manager)
52-
54+
5355
scd ==> usm
5456
5557
scd --> s_a(["Scene [0]"]) <--> usm
@@ -58,7 +60,7 @@ flowchart LR
5860
5961
```
6062

61-
The `ISceneManager` interface defines that the `LoadAsync`, `UnloadAsync` and `TransitionAsync` methods return a `Task<SceneResult>`.
63+
The `ISceneManager` interface defines that the `LoadAsync`, `UnloadAsync`, `TransitionAsync` and `ReloadActiveSceneAsync` methods return a `Task<SceneResult>`.
6264
This means you can _await_ those methods if they are implemented with the _async_ keyword, or you can subscribe to the `SceneLoaded` or `SceneUnloaded` events to receive the same scenes you would via the _async_ methods.
6365

6466
:::info

docs/getting-started/basic-usage.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Basic introduction to the usage of My Scene Manager.
55

66
# Basic Usage
77

8-
Loading scenes with this package implies that the scenes **will always be loaded as Additive**. That is simply because there is no advantage in loading scenes in the **Single** load scene mode when you expect to work with multiple scenes.
8+
Loading scenes with this package implies that the scenes **will always be loaded as Additive**. That is simply because there is no advantage in loading scenes in the **Single** load scene mode when you expect to work with multiple scenes.
99

1010
You will be using the `MySceneManager` static class to perform the scene operations.
1111

@@ -103,6 +103,21 @@ The reference type must be the same for the target scene and the intermediate sc
103103

104104
Check the [Loading Scene Examples](../samples/loading-scene-examples.md) Sample to try different loading scenes when performing **Scene Transitions**.
105105

106+
## Scene Reloading
107+
108+
You can reload the active scene using the `ReloadActiveSceneAsync` method.
109+
A scene reload is also a **scene transition** internally.
110+
It will load the active scene via the same reference it was loaded initially.
111+
112+
Just like with **Scene Transitions**, you can also pass an intermediate loading scene.
113+
114+
```cs
115+
MySceneManager.ReloadActiveSceneAsync("my-loading-scene");
116+
117+
// No loading screen:
118+
MySceneManager.ReloadActiveSceneAsync(intermediateSceneReference: null);
119+
```
120+
106121
## Async Programming
107122

108123
All scene operations are awaitable and can be used in coroutines as well. For example:

docs/upgrades/from-3-to-4.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ It completely removes the `ISceneLoader` implementations and adds a static `MySc
2020
* Merged single and multiple scene methods via the new `SceneParameter` struct.
2121
* Merged all return types to `Task<SceneResult>`, which can return a single or multiple scenes, be awaited and be used in coroutines with `WaitTask`. ([#49](https://github.com/mygamedevtools/scene-loader/issues/49))
2222
* Removed all [UniTask] references, but it's still compatible.
23+
* Added the `ReloadActiveSceneAsync` method to simplify reloading scenes. ([#51](https://github.com/mygamedevtools/scene-loader/issues/51))
2324
* Improved scene match when unloading scenes. ([#44](https://github.com/mygamedevtools/scene-loader/issues/44))([#48](https://github.com/mygamedevtools/scene-loader/issues/48))
2425
* Added the [Loading Scene Examples](../samples/loading-scene-examples.md) Sample. ([#36](https://github.com/mygamedevtools/scene-loader/issues/36))
2526
* Published to the [Unity Asset Store](https://assetstore.unity.com/packages/slug/313159). ([#38](https://github.com/mygamedevtools/scene-loader/issues/38))

docusaurus.config.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ const config = {
4242
mermaid: true
4343
},
4444

45+
future: {
46+
v4: true,
47+
experimental_faster: true,
48+
},
49+
4550
presets: [
4651
[
4752
'classic',
@@ -52,10 +57,9 @@ const config = {
5257
editUrl:
5358
'https://github.com/mygamedevtools/scene-loader/tree/docs/',
5459
lastVersion: 'current',
55-
versions:
56-
{
60+
versions: {
5761
current: {
58-
label: '4.0.0'
62+
label: '4.1.0'
5963
},
6064
}
6165
},

i18n/pt-BR/code.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,9 @@
382382
"homepage.featureComparison.sceneTransition": {
383383
"message": "Transição de Cena Async"
384384
},
385+
"homepage.featureComparison.sceneReloading": {
386+
"message": "Recarregamento de Cena Async"
387+
},
385388
"homepage.featureComparison.asyncAwait": {
386389
"message": "Suporte a Async/Await"
387390
},

i18n/pt-BR/docusaurus-plugin-content-docs/current/advanced-usage/core-concepts.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ flowchart TB
5757

5858
:::info
5959
**Operações de Cena** refere às operações de Carregar, Descarregar e Transicionar.
60+
Uma operação de Recarregar é considerada uma operação de Transicionar.
6061
:::
6162

6263
Vamos cobrir cada uma dessas estruturas nas próximas páginas.

i18n/pt-BR/docusaurus-plugin-content-docs/current/advanced-usage/core-scene-manager.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ public interface ISceneManager : IDisposable
2525

2626
Task<SceneResult> TransitionAsync(SceneParameters sceneParameters, ILoadSceneInfo intermediateSceneReference = default, CancellationToken token = default);
2727

28+
Task<SceneResult> ReloadActiveSceneAsync(ILoadSceneInfo intermediateSceneReference = null, CancellationToken token = default);
29+
2830
Task<SceneResult> LoadAsync(SceneParameters sceneParameters, IProgress<float> progress = null, CancellationToken token = default);
2931

3032
Task<SceneResult> UnloadAsync(SceneParameters sceneParameters, CancellationToken token = default);
@@ -49,7 +51,7 @@ O `CoreSceneManager` é projetado para ser usado como uma camada acima do `Scene
4951
flowchart LR
5052
usm(Unity Scene Manager)
5153
scd(Core Scene Manager)
52-
54+
5355
scd ==> usm
5456
5557
scd --> s_a(["Scene [0]"]) <--> usm
@@ -58,7 +60,7 @@ flowchart LR
5860
5961
```
6062

61-
A interface `ISceneManager` define que os métodos `LoadAsync`, `UnloadAsync` e `TransitionAsync` retornam um `Task<SceneResult>`.
63+
A interface `ISceneManager` define que os métodos `LoadAsync`, `UnloadAsync`, `TransitionAsync` e `ReloadActiveSceneAsync` retornam um `Task<SceneResult>`.
6264
Isso significa que você pode usar _await_ nesses métodos se eles forem implementados como _async_, ou pode se inscrever nos eventos `SceneLoaded` ou `SceneUnloaded` para receber as mesmas cenas que receberia via métodos async.
6365

6466
:::info

i18n/pt-BR/docusaurus-plugin-content-docs/current/getting-started/basic-usage.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,21 @@ O tipo de referência precisa ser o mesmo para a cena alvo e para a cena interme
104104

105105
Confira o Exemplo '[Loading Scene Examples](../samples/loading-scene-examples.md)' para testar diferentes tipos de cenas de carregamento durante **Transições de Cena**.
106106

107+
## Recerregando Cenas
108+
109+
Você pode recarregar a cena ativa usando o método `ReloadActiveSceneAsync`.
110+
Um recarregamento de cena também é uma **transição de cena** internamente.
111+
Isso irá recarregar a cena ativa pela mesma referência que a carregou inicialmente.
112+
113+
Assim como nas **Transições de Cena**, você também pode providenciar uma cena intermediária de carregamento.
114+
115+
```cs
116+
MySceneManager.ReloadActiveSceneAsync("my-loading-scene");
117+
118+
// Sem cena de carregamento:
119+
MySceneManager.ReloadActiveSceneAsync(intermediateSceneReference: null);
120+
```
121+
107122
## Programação Async
108123

109124
Todas as operações de cena são _awaitable_ e podem ser usadas em coroutines também. Por exemplo:

0 commit comments

Comments
 (0)