Additive Scene Processor
This class provides a basic structure that handles loading and unloading of additional scenes. AdditiveSceneProcessor
extends the SceneProcessor
class.
Members
private readonly Queue<SceneLoadingTask> _scenes = new()
:A queue used to sort scenes to load.
private readonly List<Scene> LoadedScenes = new()
:A list that keeps track of the scenes that have been uploaded.
Constructure
public AdditiveSceneProcessor()
The constructor method sets the loading mode to
LoadSceneMode.Additive
and defines event listeners.
Methods
public override void LoadScene(string sceneName, Action<Scene> onCompleted = null)
Parameteres:
sceneName
: The name of the scene to load.onCompleted
: The action that will be called when the installation process is completed (defaults to null).
It adds it to the
_scenes
queue containing the settings for the loading process and then starts the loading process in the base class (SceneProcessor
).
public override void UnLoadScene(Scene scene, Action<Scene> onCompleted = null)
Paramteres:
scene
: Boşaltılacak olan sahne.onCompleted
: Boşaltma işlemi tamamlandığında çağrılacak olan aksiyon (varsayılan değeri null'dir).
Boşaltma işleminin ayarlarını içeren
_scenes
kuyruğuna ekler ve ardından temel sınıfa (SceneProcessor
) boşaltma işlemini başlatır.
public override IEnumerator Process()
The method that initializes the processor. Processes each scene waiting in the
_scenes
queue.It updates the loading status and ensures that operations are carried out sequentially.
It makes the necessary adjustments for loading and unloading operations and initiates asynchronous operations.
When the transaction is completed, the specified action is called and the transaction status is updated.
private void KeepLoadedScene(Scene scene)
Parameteres:
scene
: The loaded scene.
Adds loaded scenes to the
LoadedScenes
list.
private void DiscardLoadedScene(Scene scene)
Parameteres:
scene
: The unloaded scene.
Removes unloaded scenes from the
LoadedScenes
list.
This class provides a basic structure that handles loading and unloading of additional scenes.
Last updated