You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Documentation~/README.md
+18-16Lines changed: 18 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@
15
15
16
16
# Documentation
17
17
18
-
This package provides as set of utilities, editor windows and scripts to manages scenes in your Unity projects. It works by setting up a set of assets which can then be used as references to load groups of scenes via editor windows (also during runtime) and runtime scripts.
18
+
This package provides a set of utilities, editor windows and scripts to manage scenes in your Unity projects. It works by setting up a set of assets which can then be used as references to load groups of scenes via editor windows and runtime scripts.
19
19
20
20
## Getting Started
21
21
@@ -37,21 +37,21 @@ Open [Scriptable Scene Window] by selecting _Window/CHARK/Scriptable Scenes_ men
37
37
<imgsrc="open-window.png"/>
38
38
</p>
39
39
40
-
This will open an Editor window which will allow you to view all [Scriptable Scene Collection] assets present in the project.
40
+
This will open an Editor window which allows you to view all [Scriptable Scene Collection] assets present in the project.
41
41
42
-
The [Defaults Sample] contains a set of [Scriptable Scene] assets and [Scriptable Scene Collection] assets which can be used as a baseline. Additionally, it includes a _SetupScene_ which can be used as a setup/preload scene. It also includes components needed for scene loading logic to work, namely the [Scriptable Scene Controller].
42
+
The [Defaults Sample] contains a set of [Scriptable Scene] assets and [Scriptable Scene Collection] assets which can be used as a starting point for any project. Additionally, it includes a _SetupScene_ which can be used as a setup/preload scene (e.g., scene for manager classes, XR rig). It also includes components needed for scene loading logic to work, namely the [Scriptable Scene Controller].
43
43
44
44
If you create new [Scriptable Scene Collection] assets, they will automatically appear in this window. Additionally, you can move, edit or delete the files created by this sample as per your project requirements:
45
45
46
46
<palign="center">
47
47
<imgsrc="window.png"/>
48
48
</p>
49
49
50
-
You can perform the following actions on each entry:
50
+
The following actions can be performed on each entry:
51
51
52
-
-**Open** - open selected collection in scene view & hierarchy.
53
-
-**Play** - start the game and load selected collection.
54
-
-**Load** - load selected collection, only available during play mode. This is handy to quickly switch between the scenes when the game is running.
52
+
-**Open** - open selected [Scriptable Scene Collection] in scene view & hierarchy.
53
+
-**Play** - start the game and load selected [Scriptable Scene Collection].
54
+
-**Load** - load selected [Scriptable Scene Collection] during play mode. This is handy to quickly switch between the scenes when the game is running.
55
55
56
56
**Note**, rearranging entries in this list will only affect your local editor and will not show up in version control.
57
57
@@ -81,13 +81,13 @@ To create a [Scriptable Scene] asset, right-click anywhere in the _Project Windo
After creating, select the asset, set the **Pretty Name** and select the correct**Scene Asset**.
84
+
After creating, select the asset, set the **Pretty Name**field and specify scene in**Scene Asset** field.
85
85
86
86
Available properties for customization:
87
87
88
88
-**Scene Asset** - the `.unity` scene this asset is referring to. Drag in the scene file you want this asset to load.
89
89
-**Pretty Name** - user-defined name for the scene. If left blank, a default name will be used.
90
-
-**Is Active** - should this scene be [activated](https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager.SetActiveScene.html) when it gets loaded by a collection? Set this to `true` for gameplay scenes.
90
+
-**Is Active** - should this scene be [activated](https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager.SetActiveScene.html) when it gets loaded by a collection? Set this to `true` for main gameplay scenes.
91
91
-**Is Persist** - should this scene never be unloaded, even when switching collections? Set this to `true` for setup/preload scenes.
92
92
-**Scene Events** - events invoked on this [Scriptable Scene] asset.
93
93
@@ -101,7 +101,7 @@ To create a [Scriptable Scene Collection] asset, right-click in the _Project Win
101
101
<imgsrc="scriptable-scene-collection.png"/>
102
102
</p>
103
103
104
-
Open the asset, set **Pretty Name** and add your [Scriptable Scene] assets.
104
+
Open the asset, set **Pretty Name** and select your [Scriptable Scene] assets which will be loaded by this [Scriptable Scene Collection].
105
105
106
106
Available properties for customization:
107
107
@@ -124,11 +124,11 @@ Once you have a set of collections ready, do the following in your primary setup
124
124
<imgsrc="scriptable-scene-controller.png"/>
125
125
</p>
126
126
127
-
The [Scriptable Scene Controller] component manages scene loading. You should always an instance of this component in one of your scenes in order to use this package. Keep in mind that only one instance of this component may exist in them game, therefore it is recommended to place this component in your setup/preload scene.
127
+
The [Scriptable Scene Controller] component manages scene loading. **You should always have an instance of this component in one of your scenes in order to use this package**. Keep in mind that only one instance of this component may exist in them game, therefore it is recommended to place this component in your setup/preload scene.
128
128
129
129
You can adjust the following properties on this component:
130
130
131
-
-**Initial Collection** - [Scriptable Scene Collection] which will be loaded first in build. Usually a set of scenes representing the menu or a splash screen.
131
+
-**Initial Collection** - [Scriptable Scene Collection] which will be loaded first in build. Usually a set of scenes, such as menu scene or a splash screen scene with the setup scene being the first one.
132
132
-**Initial Collection Load Mode** - which Unity Lifecycle method to use when loading the **Initial collection**.
133
133
-**Collection Events** - events invoked on any [Scriptable Scene Collection].
134
134
-**Scene Events** - events invoked on any [Scriptable Scene].
@@ -137,7 +137,7 @@ You can adjust the following properties on this component:
137
137
138
138
By default, the package includes a simple fade transition which can be used to fade-in/fade-out a loading screen when switching between scenes (custom transitions can also be created by inheriting [Scriptable Scene Transition] class).
139
139
140
-
To create a new [Fade Scriptable Scene Transition], right-click in the _Project Window_ and select _Create/CHARK/Scriptable Scenes/Fade Scriptable Scene Transition_:
140
+
To create a new [Fade Scriptable Scene Transition] asset, right-click in the _Project Window_ and select _Create/CHARK/Scriptable Scenes/Fade Scriptable Scene Transition_:
141
141
142
142
<palign="center">
143
143
<imgsrc="fade-transition-asset.png"/>
@@ -157,13 +157,15 @@ Finally, after you have created the [Fade Scriptable Scene Transition] asset, ad
157
157
<imgsrc="fade-transition-canvas.png"/>
158
158
</p>
159
159
160
+
Afterward you can reference the [Fade Scriptable Scene Transition] in any of the [Scriptable Scene Collection] assets to enable fading.
161
+
160
162
## Scripting
161
163
162
164
### Loading Collections via Code
163
165
164
166
First you must obtain a reference to a [Scriptable Scene Controller]. This can be done via [SerializeField](https://docs.unity3d.com/ScriptReference/SerializeField.html) or any other means, such as using `Object.FindObjectOfType<ScriptableSceneController>()` and so on, depending on your project setup.
165
167
166
-
Additionally, you'll need to obtain a set of [Scriptable Scene Collection] references. Since these as Scriptable Objects, all you need to do is define a set of [SerializeField](https://docs.unity3d.com/ScriptReference/SerializeField.html) and load them directly. However, you can structure this however you like, e.g., by maintaining lists of scenes, loading them randomly, etc...
168
+
Additionally, you'll need to obtain a set of [Scriptable Scene Collection] references. Since these as Scriptable Objects, all you need to do is define a set of [SerializeField](https://docs.unity3d.com/ScriptReference/SerializeField.html) and load them directly. However, you can load and structure this however you like, e.g., by maintaining lists of scenes, loading them randomly, etc...
167
169
168
170
```csharp
169
171
usingCHARK.ScriptableScenes;
@@ -197,11 +199,11 @@ internal sealed class GameManager : MonoBehaviour
197
199
198
200
### APIs
199
201
200
-
Explore public APIs defined in the following scripts. Each`public` method and property is documented and should be self-explanatory:
202
+
Explore public APIs defined in the following scripts, each`public` method and property is documented and should be self-explanatory:
201
203
202
204
-[Scriptable Scene]
203
205
-[Scriptable Scene Collection]
204
206
-[Scriptable Scene Controller]
205
207
-[Scriptable Scene Transition]
206
208
207
-
For breaking changes, keep an eye out [Changelog].
209
+
For breaking changes, keep an eye out for [Changelog].
0 commit comments