ARCore needs to know a few things, just as with iOS. In Android, this is done by defining a method that the ARCore component will call upon initialization. To create the method, go through the following steps:
- In the WhackABox.Droid project, open the Game.cs file.
- Add the OnConfigRequested() method anywhere in the class, as shown in the following code snippet:
private void OnConfigRequested(Config config)
{
config.SetPlaneFindingMode(Config.PlaneFindingMode.Horizontal);
config.SetLightEstimationMode(Config.LightEstimationMode.AmbientIntensity);
config.SetUpdateMode(Config.UpdateMode.LatestCameraImage);
}
The method takes a Config object, which will store any configuration you make in this method. First, we set which type of plane we want to find. We are interested in Horizontal planes for this game. We define the kind of light-estimation mode we want to use, and, finally, we select which update mode we want. In this case, we want to use the latest...