Version: 2020.2
言語: 日本語

ObjectSelectorHandlerWithTagsAttributeConstructor

マニュアルに切り替える
public ObjectSelectorHandlerWithTagsAttribute (params string[] tags);

パラメーター

tags An array of strings that represents the different tags to use as constraints.

説明

Constructor used to declare the ObjectSelectorHandlerWithTagsAttribute on a field.

The "tags" parameter represents the tags to use as constraints. If there is more than one tag, the object selector shows GameObjects or Components tagged with any of them.

using System;
using UnityEngine;
using UnityEngine.SearchService;

public class GameObjectComponent : MonoBehaviour { // Declare a field that only supports GameObjects tagged with "Trigger". [ObjectSelectorHandlerWithTags("Trigger")] public GameObject triggerTags;

// Declare a field that only supports GameObjects tagged with "Shape". [ObjectSelectorHandlerWithTags("Shape")] public GameObject shapeTags;

// Declare a field that supports GameObjects tagged with either "Trigger" or "Shape". [ObjectSelectorHandlerWithTags("Trigger", "Shape")] public GameObject triggerOrShapeTags;

// Start is called before the first frame update. void Start() { }

// Update is called once per frame. void Update() { } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961