void Update()
 {
     if (GPS != null)
     {
         // Active last scene if GPS is available
         if (GPS.IsEnabled())
         {
             AugmentedScene NearScene = GetNearestScene();
             if (NearScene != Scene)
             {
                 ChangeScene(NearScene);
             }
         }
     }
 }
Exemplo n.º 2
0
    void Start()
    {
        GPS        = FindObjectOfType <GPS>();
        ButtonText = GetComponentInChildren <Text>();
        Button     = GetComponent <Button>();

        if (GPS != null)
        {
            if (GPS.IsEnabled())
            {
                ButtonText.text    = "Disable GPS";
                Button.image.color = Enabled;
            }
            else
            {
                ButtonText.text    = "Enable GPS";
                Button.image.color = Disabled;
            }
        }
    }
Exemplo n.º 3
0
 public void ToggleGPS()
 {
     if (GPS != null)
     {
         GPS.ToggleGPS();
         if (GPS.IsEnabled())
         {
             ButtonText.text    = "Disable GPS";
             Button.image.color = Enabled;
         }
         else
         {
             ButtonText.text    = "Enable GPS";
             Button.image.color = Disabled;
         }
     }
     else
     {
         Debug.LogError("Missing GPS Object");
     }
 }