美文网首页
Odin Inspector 系列教程 --- Scene Ob

Odin Inspector 系列教程 --- Scene Ob

作者: su9257_海澜 | 来源:发表于2019-09-26 09:51 被阅读0次

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;
}

更多教程内容详见:革命性Unity 编辑器扩展工具 --- Odin Inspector 系列教程

相关文章

网友评论

      本文标题:Odin Inspector 系列教程 --- Scene Ob

      本文链接:https://www.haomeiwen.com/subject/hiizyctx.html