NOTICE: Google Maps Platform gaming services is deprecated as of October 18, 2021. Current users will have continued access until December 31, 2022. During this time, we will continue to provide support and fixes to major bugs and outages. See the Gaming Services Transition Guide for resources to help you plan the next steps for your projects.
Stay organized with collections Save and categorize content based on your preferences.

Google.Maps.Unity.GameObjectManager

The GameObject manager, which tracks destroyed GameObjects.

Summary

If you destroy a GameObject (for example, to reclaim memory for distant objects), then you should call DidDestroy(GameObject) so the SDK will create a new GameObject the next time you load that area of the map. Similarly, you should call DidDestroyAll when you unload the entire scene.

Inheritance

Inherits from: Google.Maps.Unity.IGameObjectManager

Public functions

DestroyAll()
void
Destroy all objects created by the parent MapsService.
DidDestroy(GameObject gameObject)
void
Notifies the SDK that a GameObject was destroyed, or that a GameObject is scheduled to be destroyed at the end of the current Update loop.
DidDestroyAll()
void
Notifies the SDK that all GameObjects in the scene were destroyed; for example, when unloading the scene.

Public functions

DestroyAll

void DestroyAll()

Destroy all objects created by the parent MapsService.

DidDestroy

void DidDestroy(
  GameObject gameObject
)

Notifies the SDK that a GameObject was destroyed, or that a GameObject is scheduled to be destroyed at the end of the current Update loop.

The SDK doesn't actually destroy the GameObject. You can do that via Unity's API (UnityEngine.Object.Destroy(UnityEngine.Object)). After you call the DidDestroy method, the next call to MapsService.LoadMap generates a new GameObject.

Details
Parameters
gameObject
A GameObject.

DidDestroyAll

void DidDestroyAll()

Notifies the SDK that all GameObjects in the scene were destroyed; for example, when unloading the scene.

After you call the DidDestroyAll method, calling MapsService.LoadMap causes new GameObjects to be generated.