コード例 #1
0
        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);
                    }
                }
            }
        }
コード例 #2
0
 public bool onMarkerClick(AndroidJavaObject circleAJO)
 {
     GoogleMapsSceneHelper.Queue(() => _onMarkerClick(new Marker(circleAJO)));
     return(_defaultClickBehaviour);
 }
コード例 #3
0
 public void onMapLongClick(AndroidJavaObject pointAJO)
 {
     GoogleMapsSceneHelper.Queue(() => _onLongMapClick(LatLng.FromAJO(pointAJO)));
 }
コード例 #4
0
 public void onMapReady(AndroidJavaObject map)
 {
     GoogleMapsSceneHelper.Queue(_onMapReady);
 }
コード例 #5
0
 public void onPolylineClick(AndroidJavaObject polylineAJO)
 {
     GoogleMapsSceneHelper.Queue(() => _onPolylineClick(new Polyline(polylineAJO)));
 }
コード例 #6
0
 public void onInfoWindowClick(AndroidJavaObject circleAJO)
 {
     GoogleMapsSceneHelper.Queue(() => _onMarkerOnfoWindowClick(new Marker(circleAJO)));
 }
コード例 #7
0
 public void onCircleClick(AndroidJavaObject circleAJO)
 {
     GoogleMapsSceneHelper.Queue(() => _onCircleClick(new Circle(circleAJO)));
 }
コード例 #8
0
 public void onCameraIdle()
 {
     GoogleMapsSceneHelper.Queue(() => _onCameraIdle());
 }
コード例 #9
0
 public void onCameraMoveStarted(int reason)
 {
     GoogleMapsSceneHelper.Queue(() => _onCameraMoveStarted((CameraMoveReason)reason));
 }
コード例 #10
0
 public void onSnapshotReady(AndroidJavaObject bitmapAJO)
 {
     GoogleMapsSceneHelper.Queue(() => _onSnapshotReady(BitmapUtils.Texture2DFromBitmap(bitmapAJO)));
 }