internal static void Init()
		{
			lock (InitLock)
			{
				if (ReferenceEquals(_instance, null))
				{
					var instances = FindObjectsOfType<GoogleMapsSceneHelper>();

					if (instances.Length > 1)
					{
						Debug.LogError(typeof(GoogleMapsSceneHelper) + " Something went really wrong " +
						               " - there should never be more than 1 " + typeof(GoogleMapsSceneHelper) +
						               " Reopening the scene might fix it.");
					}
					else if (instances.Length == 0)
					{
						var singleton = new GameObject();
						_instance = singleton.AddComponent<GoogleMapsSceneHelper>();
						singleton.name = typeof(GoogleMapsSceneHelper).ToString();

						DontDestroyOnLoad(singleton);

						Debug.Log("[Singleton] An _instance of " + typeof(GoogleMapsSceneHelper) +
						          " is needed in the scene, so '" + singleton.name +
						          "' was created with DontDestroyOnLoad.");
					}
					else
					{
						Debug.Log("[Singleton] Using _instance already created: " + _instance.gameObject.name);
					}
				}
			}
		}
 public bool onMarkerClick(AndroidJavaObject circleAJO)
 {
     GoogleMapsSceneHelper.Queue(() => _onMarkerClick(new Marker(circleAJO)));
     return(_defaultClickBehaviour);
 }
Example #3
0
 public void onMapClick(AndroidJavaObject pointAJO)
 {
     GoogleMapsSceneHelper.Queue(() => _onMapClick(LatLng.FromAJO(pointAJO)));
 }
Example #4
0
 public void onCameraMoveStarted(int reason)
 {
     GoogleMapsSceneHelper.Queue(() => _onCameraMoveStarted((CameraMoveReason)reason));
 }
 public void onCircleClick(AndroidJavaObject circleAJO)
 {
     GoogleMapsSceneHelper.Queue(() => _onCircleClick(new Circle(circleAJO)));
 }
 public void onInfoWindowClick(AndroidJavaObject circleAJO)
 {
     GoogleMapsSceneHelper.Queue(() => _onMarkerOnfoWindowClick(new Marker(circleAJO)));
 }
 public void onMapReady(AndroidJavaObject map)
 {
     GoogleMapsSceneHelper.Queue(_onMapReady);
 }
 public void onSnapshotReady(AndroidJavaObject bitmapAJO)
 {
     GoogleMapsSceneHelper.Queue(() => _onSnapshotReady(BitmapUtils.Texture2DFromBitmap(bitmapAJO)));
 }