Объявление
public ObjectSelectorHandlerWithTagsAttribute(params string[] tags);Параметры
tags | Массив строк, представляющий различные теги для использования в качестве ограничений. |
Описание
Конструктор, используемый для объявления ObjectSelectorHandlerWithTagsAttribute в поле.
Параметр "tags" представляет теги, используемые в качестве ограничений. Если имеется более одного тега, в селекторе объектов отображаются GameObject или Component, помеченные любым из них.
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()
{
}
}