Skip to content

SceneRefsEditorUtility

Namespace: SideXP.SceneRefs.EditorOnly

public static class SceneRefsEditorUtility

Utility functions for working with SceneRefSO in the editor.

Methods

GenerateAllSceneRefs()

public static void GenerateAllSceneRefs()

Generates SceneRefSO assets for all the existing scenes in the project.

Remarks

The new SceneRefSO assets are generated in the same folder as the scene they represent.

GenerateSceneRef(SceneAsset)

public static bool GenerateSceneRef(SceneAsset sceneAsset)

Generates a SceneRefSO asset for a given SceneAsset.

Parameters

  • sceneAsset: The scene asset for which to create a runtime ref.

Returns

Returns true if a SceneRefSO asset has been generated successfully.

GetSceneRef(SceneAsset)

public static SceneRefSO GetSceneRef(SceneAsset sceneAsset)

Gets an existing SceneRefSO asset that represents a given scene.

Parameters

  • sceneAsset: The scene of which to get the related SceneRefSO asset.

Returns

Returns the found SceneRefSO asset that represents the given scene.

GetSceneRef(SceneAsset, SceneRefSO)

public static bool GetSceneRef(SceneAsset sceneAsset, out SceneRefSO sceneRef)

Gets an existing SceneRefSO asset that represents a given scene.

Parameters

  • sceneRef: Outputs the SceneRefSO asset that represents the given scene.
  • sceneAsset: The scene of which to get the related SceneRefSO asset.

Returns

Returns true if a related SceneRefSO asset has been found.

IsIncluded(SceneRefSO)

public static bool IsIncluded(SceneRefSO sceneRef)

Parameters

  • sceneRef: The scene to check.

IsEnabled(SceneRefSO)

public static bool IsEnabled(SceneRefSO sceneRef)

Parameters

  • sceneRef: The scene to check.

AddToBuildSettings(SceneRefSO)

public static bool AddToBuildSettings(SceneRefSO sceneRef)

Parameters

  • sceneRef: The scene to add.

Enable(SceneRefSO)

public static bool Enable(SceneRefSO sceneRef)

Parameters

  • sceneRef: The scene to enable.

Disable(SceneRefSO)

public static bool Disable(SceneRefSO sceneRef)

Parameters

  • sceneRef: The scene to disable.

RemoveFromBuildSettings(SceneRefSO)

public static bool RemoveFromBuildSettings(SceneRefSO sceneRef)

Parameters

  • sceneRef: The scene to remove.