void Update()
 {
     if (GPS != null)
     {
         // Active last scene if GPS is available
         if (GPS.IsEnabled())
         {
             AugmentedScene NearScene = GetNearestScene();
             if (NearScene != Scene)
             {
                 ChangeScene(NearScene);
             }
         }
     }
 }
예제 #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;
            }
        }
    }
예제 #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");
     }
 }