VRTK_TagOrScriptPolicyList
Overview
The Tag Or Script Policy List allows to create a list of either tag names or script names that can be checked against to see if another operation is permitted.
A number of other scripts can use a Tag Or Script Policy List to determine if an operation is permitted based on whether a game object has a tag applied or a script component on it.
For example, the Teleporter scripts can ignore game object targets as a teleport location if the game object contains a tag that is in the identifiers list and the policy is set to ignore.
Or the teleporter can only allow teleport to targets that contain a tag that is in the identifiers list and the policy is set to include.
Add the Tag Or Script Policy List script to a game object (preferably the same component utilising the list) and then configure the list accordingly.
Then in the component that has a Tag Or Script Policy List paramter (e.g. BasicTeleporter has Target Tag Or Script List Policy
) simply select the list that has been created and defined.
Inspector Parameters
- Operation: The operation to apply on the list of identifiers.
- Check Type: The element type on the game object to check against.
Class Variables
public enum OperationTypes
- The operation to apply on the list of identifiers.Ignore
- Will ignore any game objects that contain either a tag or script component that is included in the identifiers list.Include
- Will only include game objects that contain either a tag or script component that is included in the identifiers list.public enum CheckTypes
- The types of element that can be checked against.Tag
- The tag applied to the game object.Script
- A script component added to the game object.Tag_Or_Script
- Either a tag applied to the game object or a script component added to the game object.
Class Methods
Find/1
public bool Find(GameObject obj)
- Parameters
GameObject obj
- The game object to check if it has a tag or script that is listed in the identifiers list.- Returns
bool
- If the operation isIgnore
and the game object is matched by an identifier from the list then it returns true. If the operation isInclude
and the game object is not matched by an identifier from the list then it returns true.
The Find method performs the set operation to determine if the given game object contains one of the identifiers on the set check type. For instance, if the Operation is Ignore
and the Check Type is Tag
then the Find method will attempt to see if the given game object has a tag that matches one of the identifiers.
Updated less than a minute ago