WorldAnchorManager.AttachAnchor(GameObject, String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Attaches an anchor to the GameObject. If the anchor store has an anchor with the specified name it will load the anchor, otherwise a new anchor will be saved under the specified name. If no anchor name is provided, the name of the anchor will be the same as the GameObject.
public string AttachAnchor (UnityEngine.GameObject gameObjectToAnchor, string anchorName = default);
member this.AttachAnchor : UnityEngine.GameObject * string -> string
Public Function AttachAnchor (gameObjectToAnchor As GameObject, Optional anchorName As String = Nothing) As String
Parameters
- gameObjectToAnchor
- UnityEngine.GameObject
The GameObject to attach the anchor to.
- anchorName
- String
Name of the anchor. If none provided, the name of the GameObject will be used.
Returns
The name of the newly attached anchor.