We need a method to quickly find nodes. Both ARKit and ARCore keep an internal track of their planes, and to map those internal representations of planes to our PlaneNode, we have to assign a custom ID to a plane when it's created. This will be done in the platform-specific code, but we can still write the function to query the scene for PlaneNode.
The planeId argument is a string, since ARKit defines the plane ID in a form that resembles a Globally Unique Identifier (GUID). A GUID is a structured sequence of hexadecimal numbers that can be represented in a string format. Let's add a method that will find the node that we are looking for by using this ID, as follows:
- In the WhackABox project, open the Game.cs class.
- Add the FindNodeByPlaneId() method in the code anywhere in the Game.cs class, as shown in the following code snippet:
protected PlaneNode FindNodeByPlaneId(string planeId)
{
return scene...