Unity 2019.3 release

New features and updates for programmers

Learn what’s new for developers in Unity 2019.3, including major updates to DOTS, improved version control, Configurable Enter Play Mode, serialization improvements, Physics updates and more.

What’s new

Here’s an overview of the key updates for programmer tools. For full details, see the release notes.

DOTS Game Code update

Write less boilerplate code with the new versions of our DOTS packages. Replace custom authoring components by a simple [GenerateAuthoringComponent] attribute, and replace those verbose IJobForEach and IJobForEachWithEntity constructs with the simpler-but-just-as-fast Entities.ForEach(), which now uses the Burst Compiler and the C# Job System.

To get started writing DOTS code the new way, install the Entities package (Preview) from the Package Manager.

DOTS_game_code_update.cs (C#)
using System;
using System.Collections;
using System.Collections.Generic;
using Unity.Entities;
using Unity.Jobs;
using Unity.Sample.Core;
using Unity.Transforms;
using UnityEngine;
[GenerateAuthoringComponent]
struct Velocity : IComponentData
{
	public float value;
}
class ApplyVelocitySystem : JobComponentSystem
{
	protected override JobHandle OnUpdate(JobHandle inputDeps)
	{
		float deltaTime = Time.deltaTime;
		return Entities.ForEach((ref Translation translation, in Velocity velocity) =>
		{
			translation.Value += velocity.Value * deltaTime;
		}).Schedule(inputDeps);
	}
}
Learn more

Serialization improvements

The new SerializeReference attribute lets you serialize C# classes as references instead of as value types. This means you can have POCOs (plain old C# objects) referencing each other, simplifying the code to express and manage complex data structures like graphs and trees.

It also offers support so fields can contain polymorphic data. For example, a list of type List<IAnimal> can contain dogs (class Dog : IAnimal{}) and cats (class Cat : IAnimal{}).

Fields marked for serialization as references can now express null values intrinsically. Previously, serializing a null field would always deserialize it using the default constructor of that type.

Serialization of non-Unity types has traditionally ignored polymorphism. In Unity 2019.3, polymorphic serialization allows you to maintain object references that didn’t previously survive the serialization process, and more correctly reference the inheritance chain.

Serialization_improvements.cs (C#)
using System;
using System.Collections.Generic;
using UnityEngine;

public interface IShape {}
[Serializable]
public class Cube : IShape
{
    public Vector3 size;
}
[ExecuteInEditMode]
public class BuildingBlocks : MonoBehaviour
{
    [SerializeReference]
    public List<IShape> inventory;
   void OnEnable()
    {
        if (inventory == null)
        {
            inventory = new List<IShape>()
            {
                new Cube() {size = new Vector3(1.0f, 1.0f, 1.0f)}
            };
            Debug.Log("Created list");
        }
        else
            Debug.Log("Read list");
    }
}
Learn more

Faster iteration with Configurable Enter Play Mode

Currently, when you enter Play Mode in the Editor, Unity does two things: it resets the scripting states (Domain Reload) and reloads the Scene. This takes time, and when your project gets more complex, Unity Editor can be slow to enter Play Mode. That’s why we’re introducing Configurable Enter Play Mode (Experimental) in Project Settings > Editor > Enter Play Mode options

These options allow you to disable domain and/or scene reloading from the Enter Play Mode process when there are no code changes. Based on our test results, changing these settings can save you 50-90% of iteration time, depending on your project.

Check out How to configure Play Mode in the documentation for more details on how to modify your scripts correctly when you’ve disabled Domain Reload.

You can also access this feature through an API and a Callback if you want to reset the game state before entering Play Mode.

This feature is currently experimental, and we’re looking forward to hearing what you think on the forum.

Learn more

PhysX library upgraded from v3.4 to v4.1

We have upgraded the PhysX library from v3.4 to v4.1. This includes the new Temporal Gauss-Seidel solver, which allows joints to be more resistant to overstretch and prevents some erratic behavior previously seen during simulation. To enable the new solver, go to Project Settings > Physics

We have also exposed the new broad-phase Automatic Box Pruning algorithm, which can compute the world boundaries and the number of subdivisions automatically. This is an upgrade from the existing Multi-Box Pruning algorithm.

Additionally, a faster mesh mid-phase algorithm is available on desktop platforms. It doesn’t require resource-intensive acceleration structures to be built (R-Trees), which is useful for runtime-generated content because the MeshCollider instantiation time will be reduced.

We’ve also added a new API to allow delayed baking of meshes for MeshCollider. You can hide the computationally intense mesh-baking process behind a loading screen or transition scenes, like a dialog scene in an adventure game. This API is thread-safe, so you can call the function from off the main thread, including via the C# Job System, to bake multiple meshes at the same time. 

For more information, see the section “Migrating from PhysX SDK 3.4 to 4.0” in NVIDIA’s PhysX 4.1 SDK Guide.

Learn more

Profiler improvement: Configurable frame count

Before 2019.3, when investigating performance through the Profiler Window, you were able to see profile data from 300 frames at a time. That didn’t always give you enough time to catch the frames you really care about.

Configurable frame count allows you to extend that capture window. In the Preferences window, you can now configure the number of frames (300–2000) you want the Profiler window to show.

Learn more

Profiler improvement: Deep Profile support in Players

With this update you can enable Deep Profiling Support for all Players in the Build Window or with BuildPlayer API.

When you build a Player with Deep Profiling Support, you’re able to record timestamps when entering and exiting C# methods. However, this C# instrumentation might come with a performance overhead, so we added the option to toggle it off per Player.

Learn more

Profiler improvement: Managed allocation call stacks support in Players

Managed allocations tracking and analysis is an important feature of Unity’s Profiler.
Continuous managed allocation causes garbage collection (GC) to kick in and disrupt smooth gameplay with multiframe delay. Knowing when allocations happen as well as their origin in the code is essential information when developing games with Unity.

In 2019.3 we introduce call stacks for managed allocations in Players. This allows you to see the C# function where a GC allocation is coming from when profiling Players.

The option can be enabled with the Call Stacks toggle.

Learn more

Version control improvements

Unity 2019.3 also includes an overhaul of our version control support.

This includes a number of UX and integration improvements and fixes for our Perforce integration, like automatic reconnect attempt if a Perforce connection is lost.

A Version Control bar is now available at the top of the Inspector window, letting you do additional operations like Add, Lock, Unlock, and Submit, among other improvements.

Also, in the Inspector for non-checked-out assets, you can now right-click to copy the values of disabled Inspector fields.

Check the release notes for more detail on all the UI improvements and fixes.

Check release notes

Addressables

This release includes the new Addressable Asset System (i.e., Addressables), which gives you an easy way to load assets by “address,” while also handling asset management overhead by simplifying content pack creation and deployment. In short, Addressables lets your team efficiently manage complex live content.

Learn more

Netcode

The FPS Netcode used in the DOTS Sample is built on top of DOTS and makes it easy to create a networked game with similar architecture. It includes client-side prediction, authoritative server, interpolation, and lag compensation. 

Get an introduction to FPS Netcode from Tim Johansson’s Unite talk.

Learn more

Download Unity 2019.3 now

Get access to all of the above and much more today.

유니티에서는 최적의 웹사이트 환경을 제공하기 위해 쿠키를 사용합니다. 자세한 내용은 쿠키 정책 페이지를 참조하세요.

확인