Fish-Net: Networking Evolved
  • Introduction
    • Getting Started
    • Showcase
      • Upcoming Releases
    • Legal Restrictions
    • Pro, Projects, and Support
    • Business Support
    • Branding
  • Manual
    • General
      • Unity Compatibility
      • Changelog
        • Development Road Map
        • Major Version Update Solutions
      • Development
      • Performance
        • Benchmark Setup
        • Fish-Networking Vs Mirror
      • Terminology
        • Miscellaneous
        • Communicating
        • Server, Client, Host
      • Transports
      • Add-ons
        • Edgegap and other Hosting
        • Fish-Network-Discovery
      • Feature Comparison
      • Upgrading To Fish-Networking
    • Guides
      • Frequently Asked Questions (FAQ)
      • Creating Bug Reports
        • Report Example
      • Technical Limitations
      • Third-Party
      • Getting Started
        • Commonly Used Guides
        • Ownership - Moving Soon
        • Step-by-Step
          • Getting Connected
          • Preparing Your Player
      • Components
        • Managers
          • NetworkManager
          • TimeManager
          • PredictionManager
          • ServerManager
          • ClientManager
          • SceneManager
          • TransportManager
            • IntermediateLayer
          • StatisticsManager
          • ObserverManager
            • HashGrid
          • RollbackManager (Pro Feature)
        • Transports
          • FishyWebRTC
          • Bayou
          • FishyEOS (Epic Online Services)
          • FishyFacepunch (Steam)
          • FishyRealtime
          • FishySteamworks (Steam)
          • FishyUnityTransport
          • Multipass
          • Tugboat
          • Yak (Pro Feature)
        • Prediction
          • Network Collider
            • NetworkCollision
            • NetworkCollision2D
            • NetworkTrigger
            • NetworkTrigger2D
          • OfflineRigidbody
          • PredictedOwner
          • PredictedSpawn
        • Utilities
          • Tick Smoothers
            • NetworkTickSmoother
            • OfflineTickSmoother
          • MonoTickSmoother [Obsolete]
          • DetachableNetworkTickSmoother [Obsolete]
          • BandwidthDisplay
          • DefaultScene
          • PingDisplay
        • Authenticator
        • ColliderRollback
        • NetworkAnimator
        • NetworkBehaviour
        • NetworkTransform
        • NetworkObject
        • NetworkObserver
      • InstanceFinder
      • Ownership
        • Using Ownership To Read Values
      • Spawning and Despawning
        • Predicted Spawning
        • Nested NetworkObjects
        • Object Pooling
      • Components
      • NetworkBehaviour
      • NetworkObjects
      • Attributes, Quality of Life
      • Remote Procedure Calls
        • Broadcast
      • SyncTypes
        • Customizing Behavior
        • SyncVar
        • SyncList
        • SyncHashSet
        • SyncDictionary
        • SyncTimer
        • SyncStopwatch
        • Custom SyncType
      • Observers
        • Modifying Conditions
        • Custom Conditions
      • Automatic Serializers
      • Custom Serializers
        • Interface Serializers
        • Inheritance Serializers
      • Addressables
      • Scene Management
        • Scene Events
        • Scene Data
          • SceneLookupData
          • SceneLoadData
          • SceneUnloadData
        • Loading Scenes
        • Unloading Scenes
        • Scene Stacking
        • Scene Caching
        • Scene Visibility
        • Persisting NetworkObjects
        • Custom Scene Processors
          • Addressables
      • Transports
        • Multipass
      • Prediction
        • What Is Client-Side Prediction
        • Configuring PredictionManager
        • Configuring TimeManager
        • Configuring NetworkObject
        • Offline Rigidbodies
        • Interpolations
        • Creating Code
          • Controlling An Object
          • Non-Controlled Object
          • Understanding ReplicateState
            • Using States In Code
            • Predicting States In Code
          • Advanced Controls
        • Custom Comparers
        • PredictionRigidbody
        • Using NetworkColliders
      • Lag Compensation
        • States
        • Raycast
        • Projectiles
    • Server Hosting
      • Edgegap - Official Partner
        • Getting Started with Edgegap
      • Hathora
        • Getting Started with Hathora
      • Amazon Web Services (AWS)
        • Getting Started with AWS
    • API
Powered by GitBook
On this page
  • General
  • Default Values
  1. Manual
  2. Guides
  3. Scene Management
  4. Scene Data

SceneLoadData

The Data Class needed for the SceneManager to know how to handle loading a scene.

PreviousSceneLookupDataNextSceneUnloadData

Last updated 6 months ago

General

Loading scenes of all types depend upon SceneLoadData. The SceneLoadData class contains information about what scenes to load, how to load them, which objects to move to new scenes, and more. You can view the SceneLoadData API .

Default Values

//Default Values
SceneLoadData sld = new SceneLoadData()
{
    PreferredActiveScene = null,
    SceneLookupDatas = new SceneLookupData[0],
    MovedNetworkObjects = new NetworkObject[0],
    ReplaceScenes = ReplaceOption.None,
    Params = new LoadParams()
    {
        ServerParams = new object[0],
        ClientParams = new byte[0]
    },
    Options = new LoadOptions()
    {
        AutomaticallyUnload = true,
        AllowStacking = false,
        LocalPhysics = LocalPhysicsMode.None,
        ReloadScenes = false, //Obsolete, Comming Soon.
        Addressables = false
    }
};
PreferredActiveScene

Preferred Active Scene will allow you to choose what scene will be active on the server and client. Currently this sets both client and server to the SceneLookupData provided.

If left with the default value of null, the first valid scene loaded will become the ActiveScene.

SceneLookupDatas

This Array is populated with scenes you would like to load, depending on the parameters you pass into the SceneLoadData when constructed.

MovedNetworkObjects
ReplaceScenes
Params

ServerParams

ServerParams are only included on the server side, and are not networked. It is an array of objects, meaning you can send anything you want. However when accessing the Params through event args, you will have to cast the object to the data you want.

ClientParams

ClientParams is a byte array which may contain anything, and will be sent to clients when they receive the load scene instructions. Clients can access the ClientParams within the scene change events.

Options

You may further enhance how you load/unload scenes with Options.

AutomaticallyUnload

  • When set to true scenes will be unloaded automatically on the server when there are no more connections present. This is the default behaviour.

  • When set to false the scene will remain if connections leave the scene unexpected, such as being disconnected.

  • However, discussed in UnloadSceneData, this behavior can be overriden using the UnloadOptions of UnloadSceneData.

  • Only scenes loaded for connections will be automatically unloaded when emptied.

  • Global scenes can only be unloaded using ReplaceScenes or by calling unload on them.

AllowStacking

  • When AllowStacking remains false the SceneManager will not stack scenes in your SceneLoadDatas.

  • If true then scenes can be stacked (loaded multiple times).

  • In the SceneLookupData section it was mentioned that if a Scene reference or handle is specified then the SceneManager will favor loading a scene using a scene handle. When you would like to load connections into the same stacked scene over multiple load calls, you will populate your SceneLookupDatas by Scene reference or handle.

LocalPhysics

  • Generally if you are stacking scenes you will want to set a LocalPhysics mode so that stacked scenes do not collide with each other.

Addressables

  • Addressables is only used as a reference and performs no additional functionality.

  • You may set this value to know if a scene is loading using addressables, without having to create Params.

See for examples.

NetworkObjects can be moved when loading new scenes, such as if you want to move a player to a different scene as you load the new scene. You may include an array of NetworkObjects to move to the new scenes. NetworkObjects within this array will be moved to the first scene specified in SceneLookupData. See for more details on what type of NetworkObjects you are allowed to move.

Like the Unity SceneManager when loading a single scene, ReplaceScenes allows you to replace currently loaded scenes with new ones. There are a variety of options to use. See Section of Loading Scenes guide for more details and examples.

Params are an optional way to assign data to your scene loads/unloads. This data will be available within, Information used in Params can be useful for storing information about the scene load/unload and referencing it later when the scene load/unload completes.

See for more detail and examples

is a Unity property that lets you determine how physics are simulated in your scenes.

here
Loading Scenes
Persisting NetworkObjects
Scene Events
Scene Stacking
LocalPhysics
Replacing Scenes