Scene setting options

ArcGIS Maps SDK for Unity enables access to real world maps and 3D content in ArcGIS to create interactive 3D GIS applications for Windows, macOs, Android and iOS, and deploy Augmented and Virtual Reality apps.

The plugin provides three options to use ArcGIS data and other geospatial content within a scene:

  • The Map Creator UI provides the option to create a scene without writing a single line of code.
  • The components provide useful functionalities that can be attached to game objects in your scene. The tutorials are coming soon.
  • The C# API grants access to the plugin source code.

Map Creator UI

The Map Creator UI is the central place to set up your scene without writing a single line of code. It initiates the necessary components and sample code that add functionalities to set up a scene.

You can use the Map Creator UI to change between a global or local scene, set the initial position and rotation of the camera and origin, adjust the extent for a local scene, manage layers, as well as change a layer's property during the setup. You have a list of default basemaps that you can choose from or can use a custom basemap or a raster tile layer. You can enable and disable elevation, and you have the option to use the default elevation layer or to set a custom elevation layer.

To use the Map Creator UI, start Unity Editor and click on the ArcGIS Maps SDK from the main menu bar, then select Map Creator.

Map Creator UI

The Map Creator UI has the OAuth challenge handler that works for the editor mode only. For using OAuth 2.0 in play mode, you can attach the OAuth Challenge Handlers Initializer which uses the sample scripts to the game object with the ArcGIS Map Component. If you want to write and use your own OAuth challenge handler initializer, you can replace the script.

Components

ArcGIS Maps SDK for Unity also provides the development option of using components. It provides useful behaviors that can be attached to game objects in your scene.

A component is a script that can be attached to a game object that will update the state of the object at the start of the game object's lifecycle and/or every frame while the game object is still active. Components can be used for a variety of things including: moving and rotating objects, updating lighting effects, showing/hiding objects, among others. For more information on components see Unity's documentation: Use components.

The essential components to set up a GIS scene are:

  • ArcGIS Map: This component is the container of the content. This component communicates with the High Precision Framework to convert from double precision to single precision to work in the Unity space.
  • ArcGIS Camera: This component controls the data that is loaded into your scene. See more information about the ArcGIS Camera component on use the camera.
  • ArcGIS Location: This component will place Actors at specific geographical coordinates. You can find more information on ArcGIS Location component.

Also, depending on the app you are developing, you may use the following components:

  • ArcGIS Rebase: Periodically updates the origin position as the camera moves around to workaround with the 32-bit floating point precision. You can find more information on use the camera.
  • ArcGIS Camera Controller: This is a sample component that is used in the sample scenes to move the camera around. You can find the sample code in Assets/Samples/ArcGIS Maps SDK for Unity/1.0.0/All Samples/Components. You can find more information on use the camera.

To set up a scene with components:

  1. Create an empty object in the scene by right-clicking on an empty space in the Hierarchy window and selecting Create Empty.

  2. Click on Add Component in the Inspector window and attach the ArcGIS Map component.

  3. Add a camera under the game object with the ArcGIS Map component or move the existing camera in the Hierarchy window and make it the child of the game object with the ArcGIS Map.

  4. Attach the ArcGIS Camera component and ArcGIS Location component to the camera in the Inspector window.

Additionally, you can attach the ArcGIS Camera Controller component and the ArcGIS Rebase component to the camera.

C# API

The C# API provides access the plugin source code and set up custom scenes. You can find classes and components that you can use to set up your scene in the API reference. By using the C# API, you can do things such as changing layer visibility at runtime.

To set up a scene with the C# API:

  1. Create a new script by selecting Assets > Create > C# Script from the main menu bar, or by using the + (plus sign) to open the Create menu located in the Project window. This script will be used to create our scene.

  2. Create an empty object in the scene by right-clicking on an empty space in the Hierarchy window and selecting Create Empty.

  3. Attach the newly created C# script by dragging it into the empty object. You can see the new component in the Inspector.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.