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 { hideFlags = HideFlags.HideAndDontSave }; _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); }
public void onMapLongClick(AndroidJavaObject pointAJO) { GoogleMapsSceneHelper.Queue(() => _onLongMapClick(LatLng.FromAJO(pointAJO))); }
public void onMapReady(AndroidJavaObject map) { GoogleMapsSceneHelper.Queue(_onMapReady); }
public void onPolylineClick(AndroidJavaObject polylineAJO) { GoogleMapsSceneHelper.Queue(() => _onPolylineClick(new Polyline(polylineAJO))); }
public void onInfoWindowClick(AndroidJavaObject circleAJO) { GoogleMapsSceneHelper.Queue(() => _onMarkerOnfoWindowClick(new Marker(circleAJO))); }
public void onCircleClick(AndroidJavaObject circleAJO) { GoogleMapsSceneHelper.Queue(() => _onCircleClick(new Circle(circleAJO))); }
public void onCameraIdle() { GoogleMapsSceneHelper.Queue(() => _onCameraIdle()); }
public void onCameraMoveStarted(int reason) { GoogleMapsSceneHelper.Queue(() => _onCameraMoveStarted((CameraMoveReason)reason)); }
public void onSnapshotReady(AndroidJavaObject bitmapAJO) { GoogleMapsSceneHelper.Queue(() => _onSnapshotReady(BitmapUtils.Texture2DFromBitmap(bitmapAJO))); }