docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Sample: Stream a Model From the StreamingAssets of a Unity Editor Project

    You can use this sample to stream a model from the Unity Editor project StreamingAssets directory. You can choose which model to view and move the camera around the model to see the data streaming function.

    Important

    This sample is designed to work on PC. It may not behave as expected on other platforms, such as iOS or Android.

    Before you start

    Before you use the Data Streaming Offline sample, you must have the following:

    • Installed Data Streaming package and its dependencies
    • At least one Unity Cloud model downloaded in the StreamingAssets directory of your project
    Important

    This sample is designed to work on PC and may not behave as expected on other platforms like iOS and Android.

    Install the sample

    To install the sample, follow these steps:

    1. In your Unity project, go to Window > Package Manager > Unity Cloud Data Streaming.

    2. Expand the Samples section.

    3. On the right of the Offline sample, select Import.

      After the import process completes, you can view the imported assets under the Assets/Samples/Unity Cloud Data Streaming folder.

    Run the sample

    To run the sample, follow these steps:

    1. Copy your downloaded dataset into the Assets/StreamingAssets folder.1

    2. In your Unity Editor project, go to File > Open Scene.

    3. Go to Assets/Samples/Unity Cloud Data Streaming/<package-version>/Offline Sample/Scenes/OfflineSample.unity.

    4. Select the OfflineSample game object in the Hierarchy window.

    5. In the Inspector window, in the Path field, enter the tileset.json file path without the Assets/StreamingAssets prefix. For example, if your dataset is in Assets/StreamingAssets/MyModel/tileset.json, enter MyModel/tileset.json.1

      Screenshot of the Offline Sample MonoBehaviour

    6. Run the scene.

      Instructions on how to navigate the scene are on the screen. Screenshot of a launched demo scene with instructions

    Main components

    This section describes the scripts that make up the offline sample.

    Offline sample script

    The OfflineSample class demonstrates how the DataStreamer is used to launch a model. The selected model is provided as an string parameter. The string parameter passes to the DataStreamer, which loads and displays the associated model.

    To open the offline sample script, go to the Assets/Samples/Unity Cloud Data Streaming/<package-version>/Offline Sample/Scripts/OfflineSample.cs file.

    Troubleshooting

    Refer to the troubleshooting section for help with the Offline sample.

    1 Until model publication is available, use the OfflineDataset/tileset.json and OfflineDataset/box.glb files part of this sample. They already are in the StreamingAssets directory.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)