[AssetOnly]

Attribute restricts object reference field to accept only project assets, not scene objects.

Support Types

Type
Example
Description

UnityEngine.Object

GameObject

Unity Object Reference

Examples

[AssetOnly]
public GameObject prefab;

[AssetOnly]
public Material material;

Last updated