SceneObjectsOnlyAttribute

SceneObjectsOnly is used on object properties, and restricts the property to scene objects, and not project assets.

Use this when you want to ensure an object is a scene object, and not from a project asset.

namespace Sirenix.OdinInspector
{
[AttributeUsageAttribute((AttributeTargets)384, AllowMultiple = False, Inherited = True)]
public sealed class SceneObjectsOnlyAttribute : Attribute
}

Requirements

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector
Version: 1.0.5.0

See Also

Example

The following example shows a component with a game object property, that must be from a scene, and not a prefab asset.

public MyComponent : MonoBehaviour
{
	[SceneObjectsOnly]
	public GameObject MyPrefab;
}