wave7-unity-object-ref-blittable-asset

Store blittable Unity asset references in ECS component data.

6|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/dyCuong03/unity-agent-team --skill wave7-unity-object-ref-blittable-asset
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wave7-unity-object-ref-blittable-asset
Source: https://github.com/dyCuong03/unity-agent-team/tree/main/.claude/skills/unity-dots/wave7-unity-object-ref-blittable-asset
Command: npx skills add https://github.com/dyCuong03/unity-agent-team --skill wave7-unity-object-ref-blittable-asset

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the problem of storing and transporting UnityEngine asset references (like Texture2D, AudioClip, Mesh, Sprite) inside ECS component data in a way that remains blittable and job-friendly, avoiding non-blittable managed objects in hot ECS paths.

Core Features & Use Cases

  • Blittable asset identity in IComponentData: Store instance-ID-based identity via UnityObjectRef<T> so it can live in ECS chunks and be safely copied into job structs.
  • Main-thread dereference at point of use: Access UnityObjectRef.Value only on the main thread when assigning to render/audio/presentation objects.
  • Baker dependency tracking: Use DependsOn(asset) in Bakers to ensure incremental baking correctly updates references when source assets change.

Use case example: You need a per-entity sprite override in DOTS where a Burst job must categorize entities by which sprite asset they reference, and then the actual renderer assignment happens on the main thread.

Quick Start

Ask an AI assistant to generate a UnityObjectRef<Sprite>-based IComponentData component, a corresponding Baker that calls DependsOn(authoring.Sprite), and a job-safe system that compares sprite references by identity while a separate main-thread system applies the dereferenced sprite.

Frequently Asked Questions about wave7-unity-object-ref-blittable-asset

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I store Unity asset references in ECS component data while keeping it blittable for Burst jobs?

To keep Unity asset references blittable for ECS jobs, store instance-ID-based identity via UnityObjectRef<T> inside IComponentData. This allows the reference to live safely in chunks and be copied into job structs without embedding managed objects.

Can I access a UnityObjectRef value directly inside a Burst-compiled job system?

You cannot dereference UnityObjectRef.Value inside a Burst job. You must defer the UnityObjectRef.Value dereference to the main thread at point of use, such as when assigning assets to render or audio presentation objects.

What is the best way to handle incremental baking when an asset referenced by ECS changes?

To ensure incremental baking correctly updates ECS asset references, call DependsOn(asset) inside your Baker. This guarantees the baking process updates the UnityObjectRef identity whenever the source asset changes.

Does UnityObjectRef work for per-entity sprite overrides in a DOTS pipeline?

UnityObjectRef works for per-entity sprite overrides by allowing a Burst job to categorize entities by sprite identity. A separate main-thread system then dereferences the UnityObjectRef<Sprite> to apply the actual renderer assignment.

Why does storing managed Unity objects directly in IComponentData break job safety?

Storing managed Unity objects directly in IComponentData breaks job safety because they are non-blittable. UnityObjectRef solves this by carrying a blittable instance-ID int through hot ECS paths instead of the managed object.