Esempio n. 1
0
        void Update()
        {
            if (Game.Instance.isSomethingRunning())
            {
                return; // We have to respect if something is running, like a conversation or an effect
            }

            if (GeoExtension.Instance.IsLocationValid())
            {
                if (!zone.InsideInfluence(GeoExtension.Instance.Location, 5))
                {
                    Debug.Log("No está en la influencia, pero la ubicación es válida");
                    Game.Instance.RunTarget(loadOnExit, 0, 0);
                    Game.Instance.GameState.GetMemory("geo_extension").Set("zone_control", false);
                    DestroyImmediate(this.gameObject);
                }
            }
            else if (!GeoExtension.Instance.IsStarted() && !zone.InsideInfluence(GeoExtension.Instance.Location, 5))
            {
                Debug.Log("No está en la influencia");
                Game.Instance.RunTarget(loadOnExit, 0, 0);
                Game.Instance.GameState.GetMemory("geo_extension").Set("zone_control", false);
                DestroyImmediate(this.gameObject);
            }
        }
Esempio n. 2
0
 void Update()
 {
     if (Game.Instance.isSomethingRunning())
     {
         return; // We have to respect if something is running, like a conversation or an effect
     }
     if (GPSController.Instance.IsLocationValid())
     {
         if (!zone.InsideInfluence(new Vector2d(Input.location.lastData.latitude, Input.location.lastData.longitude), 5))
         {
             Debug.Log("No está en la influencia, pero la ubicación es válida");
             Game.Instance.RunTarget(loadOnExit, 0, 0);
             RemoveKeys();
             DestroyImmediate(this.gameObject);
         }
     }
     else if (!GPSController.Instance.IsStarted())
     {
         if (!zone.InsideInfluence(debugLatLong.ToVector2d(), 5))
         {
             Debug.Log("No está en la influencia");
             Game.Instance.RunTarget(loadOnExit, 0, 0);
             RemoveKeys();
             DestroyImmediate(this.gameObject);
         }
     }
 }