LogoLogo
⚠️ Outdated documentationGo to LatestHomeAPI
SDK 0.9
SDK 0.9
  • Welcome
  • Overview
    • What is coherence?
    • How does coherence work?
    • Features and Roadmap
    • Rooms and Worlds
    • Requirements
    • Release Notes
  • Get Started
    • Install coherence
    • Scene setup
    • Prefab setup
    • Baking and code generation
    • Build and run
    • Create a free account
    • Deploy Replication Server
    • Share builds
    • Troubleshooting
  • Authority and communication
    • How authority works
    • Authority transfer
    • Commands
    • Simulation frame
    • Client connections
    • Server-authoritative setup
    • GGPO
    • Animations
    • Value sync callbacks
  • Persistence
    • Overview
    • Configuring persistence
    • Storage
    • Example – a global counter
  • Optimization
    • Overview
    • Simulation frequency
    • Areas of interest
    • Level of detail
    • Interpolation
  • Connected entities
    • Overview
    • Entity references
    • Parent-child relationships
    • CoherenceNode
  • Simulators
    • Overview
    • Client vs Simulator logic
    • Build and deploy
    • Simulator load balancing
    • Room Simulators
    • Multi-Room Simulators (advanced)
    • World Simulators
    • Simulator slugs
    • Testing Simulators locally
  • Tutorial project
    • Get the Tutorial Project
    • Start Tutorial
      • 1. Transforms
      • 2. Physics
      • 3. Persistence
      • 4. Animation and variables
      • 5. AI navigation
      • 6. Network commands
      • 7. Team-based
      • 8. Connected Entities
  • Game Services
    • Game account
    • Key-value store
    • Matchmaking
  • Developer Portal
    • Overview
    • Dashboard
    • Enabling game services
    • Configure Rooms
    • Manage Worlds
  • API reference
    • coherence SDK
      • CoherenceSync
      • MonoBridge
      • LiveQuery
      • Level of detail
      • Sample UI
      • Settings window
      • Custom bindings (advanced)
      • PlayResolver
      • Rooms
      • Worlds
    • Cloud API
      • API tokens and keys
      • Game account
      • Key-value store
      • Matchmaking
    • Replication Server
    • Simulation Server
  • Schema reference
    • Overview
    • Specification
    • Field settings
    • Archetypes in schemas
  • Resources
    • Downloads
    • SDK update guide
    • Video tutorials
    • Order of execution
    • Glossary
    • CLI utilities
    • Simulator CLI arguments
    • Helper scripts
    • Troubleshooting
    • Continuous Integration setup
  • Community
    • Community
  • Additional information
    • Pricing
    • SLA
    • Unreal Engine support
    • WebGL
    • Peer-to-Peer (P2P)
Powered by GitBook
On this page
  • General updates
  • SDK Upgrade 0.7.x (0.8.x) -> 0.9.0

Was this helpful?

Export as PDF
  1. Resources

SDK update guide

Last updated 2 years ago

Was this helpful?

Any new version of coherence should install automatically in the Unity Editor's Package Manager. To check the version, open up coherence > coherence Hub and the version should be displayed at the top.

General updates

  • After an SDK upgrade, bake process will be initiated automatically by the SDK to make sure the baked scripts are up to date.

  • If you were using the old manual code generation system and you run into any compilations or runtime errors in coherence code after the update, you need to delete Assets/coherence/baked folder. These steps might help resolve the issue:

If you were using an old code generation system and you run into any compilation or runtime errors in coherence code after the update, you need to delete Assets/coherence/baked folder and these steps might help resolve the issue:

1) Go to coherence > Bake

2) Go to Project settings > coherence > Gather Schema to fully generate the baked code (this can also be done via any of the other baking options). After that click Project settings > coherence > Bake.

3) This process should handle old bindings which are different from the updated version. If the errors persist, check the bindings window for the relevant Prefab to make sure they are set up properly. Then perform steps 1 and 2 again. This also makes sure old baked components are removed (these are now added at runtime).

The 0.9 version introduces two new features:

SDK Upgrade 0.7.x (0.8.x) -> 0.9.0

  • Notable API changes include:

  1. Coherence.Network is removed now. OnConnected and OnDisconnected events are moved to IClient and have changed a signature:

        private void OnEnable()
        {
            if (!MonoBridgeStore.TryGetBridge(gameObject.scene, out CoherenceMonoBridge monoBridge))
                return; 
            
            client = monoBridge.Client;
            client.OnConnected += OnConnect;
            client.OnDisconnected += OnDisconnect;
        }
    
        private void OnDisable()
        {
            client.OnConnected -= OnConnect;
            client.OnDisconnected -= OnDisconnect;
        }
    
        private void OnConnect(ushort u)
        {
            onConnect.Invoke();
        }
    
        private void OnDisconnect(ConnectionCloseReason reason)
        {
            onDisconnect.Invoke();
        }

2. MonoBridgeStore.GetBridge is now obsolete, and will be replaced with MonoBridgeStore.TryGetBridge.

MonoBridgeStore.TryGetBridge(gameObject.scene, out monobridge);

3. CoherenceSync.isSimulated is now obsolete, and will be replaced with CoherenceSync.HasStateAuthority.

4. CoherenceSync.RequestAuthority is now obsolete, and will be replaced with CoherenceSync.RequestAuthority(AuthorityType).

CLI Tools

This will generate baked skeleton scripts which will compile but not work at runtime. If you still have compilation errors at this point, it's better to go into Safe mode and fix possible API upgrade issues, as detailed below, in .

You can update your CoherenceSync prefabs outside the Resources folder and use .

Source Generator system is introduced for Baking. You can read more on it .

For more information, see .

For detailed documentation of the updated CoherenceSync component, see .

The CLI tools have been updated, especially the ones that handle Simulators. To learn more about this, see .

Release Notes
CoherenceSync
CLI utilities
the second part of this article
PrefabMapper
here