- Odin Inspector 系列教程 --- Scene Ob
- Odin Inspector 系列教程 --- 自定义Odin序
- Odin Inspector 系列教程 --- Odin Sta
- Odin Inspector 系列教程 --- RoadMap(
- Odin Inspector 系列教程 --- Foldout
- Odin Inspector 系列教程 --- Vertical
- Odin Inspector 系列教程 --- Responsi
- Odin Inspector 系列教程 --- Preview
- Odin Inspector 系列教程 --- Horizont
- Odin Inspector 系列教程 --- Show If
Scene Objects Only Attribute特性:用于对象属性,并将属性限制为场景对象,而不是项目资源。如果要确保对象是场景对象而不是项目资产,请使用此选项。

using Sirenix.OdinInspector;
using System.Collections.Generic;
using UnityEngine;
public class SceneObjectsOnlyAttributeExample : MonoBehaviour
{
[Title("Assets only")]
[AssetsOnly]
public List<GameObject> OnlyPrefabs;
[AssetsOnly]
public GameObject SomePrefab;
[AssetsOnly]
public Material MaterialAsset;
[AssetsOnly]
public MeshRenderer SomeMeshRendererOnPrefab;
[Title("Scene Objects only")]
[SceneObjectsOnly]
public List<GameObject> OnlySceneObjects;
[SceneObjectsOnly]
public GameObject SomeSceneObject;
[SceneObjectsOnly]
public MeshRenderer SomeMeshRenderer;
}
网友评论