{"__v":0,"_id":"58796782cd4a9c37007c973b","category":{"version":"58796781cd4a9c37007c96ef","project":"571fa55ca0acd42000af9545","_id":"58796781cd4a9c37007c96fb","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-01-01T17:01:47.129Z","from_sync":false,"order":13,"slug":"utilities","title":"Utilities"},"parentDoc":null,"project":"571fa55ca0acd42000af9545","user":"571fa519db52d01700f5cf3d","version":{"__v":4,"_id":"58796781cd4a9c37007c96ef","project":"571fa55ca0acd42000af9545","createdAt":"2017-01-13T23:49:21.393Z","releaseDate":"2017-01-13T23:49:21.393Z","categories":["58796781cd4a9c37007c96f0","58796781cd4a9c37007c96f1","58796781cd4a9c37007c96f2","58796781cd4a9c37007c96f3","58796781cd4a9c37007c96f4","58796781cd4a9c37007c96f5","58796781cd4a9c37007c96f6","58796781cd4a9c37007c96f7","58796781cd4a9c37007c96f8","58796781cd4a9c37007c96f9","58796781cd4a9c37007c96fa","58796781cd4a9c37007c96fb","58796781cd4a9c37007c96fc","58796781cd4a9c37007c96fd","58796781cd4a9c37007c96fe","58796781cd4a9c37007c96ff","58796781cd4a9c37007c9700","58b157ca1756cf370022f90d","58b1596f5dae732f00adeca2","58b1605a5dae732f00adecb1"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Mukota","version_clean":"3.1.0","version":"3.1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-01-01T17:02:43.537Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"## Overview\n\nThe Policy List allows to create a list of either tag names, script names or layer names that can be checked against to see if another operation is permitted.\n\nA number of other scripts can use a Policy List to determine if an operation is permitted based on whether a game object has a tag applied, a script component on it or whether it's on a given layer.\n\nFor 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.\n\nOr 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.\n\nAdd the Policy List script to a game object (preferably the same component utilising the list) and then configure the list accordingly.\n\nThen in the component that has a Policy List paramter (e.g. BasicTeleporter has `Target List Policy`) simply select the list that has been created and defined.\n\n## Inspector Parameters\n\n * **Operation:** The operation to apply on the list of identifiers.\n * **Check Type:** The element type on the game object to check against.\n\n## Class Variables\n\n * `public enum OperationTypes` - The operation to apply on the list of identifiers.\n  * `Ignore` - Will ignore any game objects that contain either a tag or script component that is included in the identifiers list.\n  * `Include` - Will only include game objects that contain either a tag or script component that is included in the identifiers list.\n * `public enum CheckTypes` - The types of element that can be checked against.\n  * `Tag` - The tag applied to the game object.\n  * `Script` - A script component added to the game object.\n  * `Layer` - A layer applied to the game object.\n\n## Class Methods\n\n### Find/1\n\n  > `public virtual bool Find(GameObject obj)`\n\n  * Parameters\n   * `GameObject obj` - The game object to check if it has a tag or script that is listed in the identifiers list.\n  * Returns\n   * `bool` - If the operation is `Ignore` and the game object is matched by an identifier from the list then it returns true. If the operation is `Include` and the game object is not matched by an identifier from the list then it returns true.\n\nThe 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.\n\n### Check/2\n\n  > `public static bool Check(GameObject obj, VRTK_PolicyList list)`\n\n  * Parameters\n   * `GameObject obj` - The game object to check.\n   * `VRTK_PolicyList list` - The policy list to use for checking.\n  * Returns\n   * `bool` - Returns true of the given game object matches the policy list or given string logic.\n\nThe Check method is used to check if a game object should be ignored based on a given string or policy list.","excerpt":"","slug":"vrtk_policylist","type":"basic","title":"VRTK_PolicyList"}
## Overview The Policy List allows to create a list of either tag names, script names or layer names that can be checked against to see if another operation is permitted. A number of other scripts can use a Policy List to determine if an operation is permitted based on whether a game object has a tag applied, a script component on it or whether it's on a given layer. 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 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 Policy List paramter (e.g. BasicTeleporter has `Target 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. * `Layer` - A layer applied to the game object. ## Class Methods ### Find/1 > `public virtual 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 is `Ignore` and the game object is matched by an identifier from the list then it returns true. If the operation is `Include` 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. ### Check/2 > `public static bool Check(GameObject obj, VRTK_PolicyList list)` * Parameters * `GameObject obj` - The game object to check. * `VRTK_PolicyList list` - The policy list to use for checking. * Returns * `bool` - Returns true of the given game object matches the policy list or given string logic. The Check method is used to check if a game object should be ignored based on a given string or policy list.