Getting Started

Introduction

Installation

Project Configuration

Testing in Your Sandbox

Samples & Examples

Core Concepts & Glossary

Package Types

Spaces & Space Templates

Custom Avatars

Custom Avatar Animations

Avatar Attachments

Custom Prefab Objects

Embedded Packages

Drivable Vehicles

Scene Setup

Testing In Unity vs Sandbox

Controlling the Camera

Custom Collision, Layers, and Tags

Audio Mixers and Groups

Key Differences from Standard Unity3D development

Economy

Quests and Rewards

Economy Overview

Monetization

Items

Consumable Items

Rewarding Items

World Currency

Selling Items

Scripting

Components

Entrance Point

Camera Passthrough

Interactable

Trigger Event

Point Of Interest

Environment Settings Overrides

Render Pipeline Settings Overrides

Movement Materials

Climbable

Avatar Teleporter

Empty Frame

Projector Surface

Seat Hotspot

Guidelines

Supported Features and Limitations

Performance Guidelines

Lighting

Publishing to Spatial

Finding Published Packages

Support

FAQs

Help and Support

Release Notes

Asset Import Settings

C# Getting Started: Assembly Setup


<aside> 🗒️ An Assembly Definition bundles all code inside a folder and is used to package your code with your space when testing and publishing. Learn more about Assembly Definitions here.

</aside>

Creating an Assembly Definition

In general, it’s a good practice to organize your project’s assets into folders. Having a dedicated folder for your scripts is required if you want to use C# with your toolkit creations. Create a new folder in your project with Create/folder, name it something identifiable, like Scripts.

Inside that folder, create an Assembly Definition with Create/Assembly Definition.

Untitled

In the Assembly definition’s inspector, make sure the name is CreatorToolkitCustomScripts, and consider creating a Root Namespace to keep your code organized.

Screenshot 2024-03-10 at 10.24.31 PM.png

Reference Assemblies

In order to reference code outside of your assembly like SpatialBridge you need to link assemblies in your asmdef file.

<aside> <img src="/icons/error_orange.svg" alt="/icons/error_orange.svg" width="40px" /> NOTE: Only Assemblies that spatial supports internally can be referenced. Referencing a custom assembly for an asset package will not include it. All custom C# must be included in a single asmdef.

</aside>

Click the + under the Assembly Definition References

Screenshot 2024-03-10 at 10.25.26 PM.png

And select the SpatialSys.UnitySDK assembly.

Untitled

Untitled

Ready to Test & Publish

Next, open the Spatial Creator Toolkit Settings, and drag the assembly to the C# Assembly field. Now all code inside the assembly will be included when you test or publish this package.

Screenshot 2023-11-09 at 1.06.50 AM.png


← Previous

Key Differences

Next →

Your First Script