Getting started with 2D Rendering | 2D Entities | 0.22.0-preview.8
docs.unity3d.com
    Show / Hide Table of Contents

    Getting started with 2D Rendering

    Package requirements

    For the package installation and build requirements, please refer to Project Tiny’s System Requirements for more details.

    Quick start

    To get started quickly, download the 2D Entities Starter template Project. This Project has everything setup for you to get started with the 2D Entities package.

    Setting up your Project from scratch

    1. From the Unity Hub, create a new Project by selecting the 2D Project Template.
    2. Use the Unity Package Manager (menu: Window > Package Manager) to find and install the 2D Entities preview package. If the package is not visible, select Show preview packages from the Advanced drop-down menu.
    3. Ensure that Live Link Mode is enabled by going to DOTS > Live Link Mode > Live Conversion In Edit Mode
    4. Ensure that the Project is using Asset Pipeline version 2 by going to Edit > Project Settings > Editor > Asset Pipeline > Mode > Version 2

    Rendering your Sprite with the DOTS pipeline

    1. Open SampleScene.unity located in the Assets/Scenes folder.

    2. Add a Sprite to your Project, then drag and drop it into the Scene. Ensure it is a root GameObject and not the child of an existing GameObject.

    3. Right-click on the Main Camera, and select New SubScene From Selection.

      • This will create a SubScene named ‘Main Camera’ and move the Main Camera into it.
    4. Right-click the Sprite, and select New SubScene From Selection.

      • This will create a SubScene named after the Sprite GameObject, and move the Sprite GameObject into it.

    5. Close the SubScene containing your Sprite GameObject.

      • Nothing changes visually, but doing this destroys the GameObject and only the DOTS object is left behind.

      • If the SubScene does not continue to render, please retry the steps.

    Note: To allow the Game view Camera to render using the DOTS pipeline, keep the Main Camera SubScene open in Edit mode at all times by selecting the __Edit button __in its Inspector window.

    If the Close button is visible when selecting the SubScene, you are currently in Edit Mode.

    Author data into the DOTS world

    For information about how to author data into the DOTS world, see the Authoring and Editor-only Code section in the Project Tiny docs.

    Building a DOTS Runtime package

    To learn about what is an Assembly Definition and why it is required, see Project Tiny’s Root Assembly Definition documentation for more information.

    Creating the root assembly definition

    1. Create a new folder for runtime scripts, and call it for instance Runtime.

    2. In the new Runtime folder, create a new Assembly Definition by going Right-click > Create > Assembly Definition, and call it MyGame.

    3. Select the MyGame Assembly Definition created in step 2, and input the same name in the Name field as the .asmdef name, which is ‘MyGame’ in this case.

    4. Clear Use GUIDs checkbox.

    5. Add (+) the following Assembly Definition References from the list of available assemblies:

      • Unity.Entities
      • Unity.Transforms
      • Unity.Mathematics
      • Unity.Collections
      • Unity.Jobs
      • Unity.Tiny.Core
      • Unity.Tiny.Rendering
      • Unity.Tiny.EntryPoint
      • Unity.Tiny.Main
      • Unity.Tiny.Input
      • Unity.Burst
      • Unity.2D.Entities
      • Unity.2D.Entities.Runtime
      • Unity.2D.Entities.Physics
    6. Press the Apply button.

    Additional platform support

    Open the package manifest.json located in Root/Packages, and add the packages for the platforms you want your Project to support to the dependency list:

    "com.unity.platforms.android": "0.1.8-preview.3",
    "com.unity.platforms.desktop": "0.1.8-preview",
    "com.unity.platforms.ios": "0.1.8-preview.3",
    "com.unity.platforms.linux": "0.1.8-preview",
    "com.unity.platforms.macos": "0.1.8-preview",
    "com.unity.platforms.web": "0.1.8-preview.1",
    "com.unity.platforms.windows": "0.1.8-preview",
    

    Creating a Build Setting

    1. Create a new folder for the Build Settings of the DOTS Runtime, and call it for instance BuildSettings
    2. In the new BuildSettings folder, create the Build Settings by going Right-click > Create > Build > BuildSettings for DOTS Runtime.
    3. Select the Build Setting and do the following updates:

      1. In the Scene List, set the size of the Scenes’ array to 1; then drag in SampleScene.unity.
      2. In Dots Runtime Build Profile, drag the Assembly Definition created in step 2 onto the Root Assembly box.
      3. In Dots Runtime Build Profile, select the intended target in the Target box.
      4. Press the (+) in the lower right corner and select Tiny Rendering Settings
      5. Note, if you are targeting Web, there is one last step
        • Press the (+) in the lower right corner and select Emscripten Settings.
        • In the Emscripten Settings, set the size of the EmccArgs’ array to 1; then add TOTAL_MEMORY=256MB
    4. Press the Apply button
    5. Select Build and Run at the top of the build target window.

    For additional information about the Build Settings, see the Build Settings section in the Project Tiny’s docs.

    Debugging a build

    For information about debugging a build, see Project Tiny’s Dots C# Project documentation.


    If you have any issues or questions about the 2D Entities package and its features, please visit the Project Tiny forum and First batch of 2D Features for Project Tiny is now available thread for more information and discussions with the development team.

    In This Article
    • Package requirements
    • Quick start
    • Setting up your Project from scratch
    • Rendering your Sprite with the DOTS pipeline
    • Author data into the DOTS world
    • Building a DOTS Runtime package
      • Creating the root assembly definition
      • Additional platform support
      • Creating a Build Setting
      • Debugging a build
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023