-
Notifications
You must be signed in to change notification settings - Fork 0
Reverse Usage Lookup
First of all, follow the quickstart; The quickstart gets you ready to use UniSwitcher.
If you are having trouble, check if you have followed everything on that instructions.
This page assumes you have done that, and your IScene implementation is called Scene in your project.
Call PerformSceneTransition on ChangeScene:
PerformSceneTransition(ChangeScene(new Scene("path/to/your/scene.unity")));Call PerformSceneTransition on AddScene:
PerformSceneTransition(AddScene(new Scene("path/to/your/scene.unity")));Put your data in the second argument - it will be available as an [Inject] variable for the scripts in the next scene.
PerformSceneTransition(AddScene(new Scene("path/to/your/scene.unity"), new YourRandomData(12345)));
// In the scripts on the next scene, if you write this, your data will appear in the property `_data`.
[Inject] private YourRandomData _data;For this to work, you must have a transition effect installed.
If you use the default UniSwitcherInstaller, you will automatically use the sample implementation of
the UniSwitcher transition effect Assets/Plugins/UniSwitcher/Sample/Prefab/Transition Background.prefab.
You can even implement your own!!
After that, call WithTransitionEffect() on ChangeScene.
PerformSceneTransition(
AddScene(new Scene("path/to/your/scene.unity"))
.WithTransitionEffect()
);For this to work, you must implement a progress bar using ProgressDisplayController,
which must be referenced from the Switcher's sceneProgressBarController.
As long as it is referenced from the Switcher, the progress bar will automatically appear for all the transitions.
Call HideProgressBar().
PerformSceneTransition(
AddScene(new Scene("path/to/your/scene.unity"))
.HideProgressBar()
);Use After on ChangeScene.
PerformSceneTransition(
AddScene(new Scene("path/to/your/scene.unity"))
.After(5) // after 5 seconds
);[NOTE]
The interval you specify is the one between the time of triggeringPerformSceneTransitionand the start of your transition effect, not the actual scene switch.
More reverse usage lookup is TODO