public void SetFocus(LocationTaskDriver driver, ARWorldObject worldObject, bool focus) { if (worldObject != null) { var task = driver.Task; if (focus) { m_guideData = new ARGuideData { Instructions = task.Title, Range = task.ActionRange, WorldObject = worldObject }; ARViewManager.Instance.SetGuide(m_guideData); var text = driver.IsTakeTask ? Localize.GetLocalizedString("ARAnnotation.TapToTake", "Tap to Collect") : (driver.IsGiveTask ? Localize.GetLocalizedString("ARAnnotation.TapToPut", "Tap to Put") : null); ARAnnotationViewController.Instance.AddTapAnnotation(worldObject, text); } else { if (m_guideData != null) { ARViewManager.Instance.ClearGuide(m_guideData); } ARAnnotationViewController.Instance.RemoveTapAnnotation(worldObject); } } }
private void SetWebDownloadErrorState(WebServicesDownloadErrorCode downloadErrorCode) { if (RetryText) { switch (downloadErrorCode) { case WebServicesDownloadErrorCode.NoNetworkConnection: RetryText.text = Localize.GetLocalizedString("Loading.NoNetworkError", "An internet connection is required to launch this app. Please connect to the internet and try again."); break; case WebServicesDownloadErrorCode.ParseError: RetryText.text = Localize.GetLocalizedString("Loading.ParseError", "There was a problem processing data from the Motive server."); break; case WebServicesDownloadErrorCode.ServiceCallFailure: RetryText.text = Localize.GetLocalizedString("Loading.ServiceCallError", "There was a problem connecting to the Motive server. Please try again."); break; case WebServicesDownloadErrorCode.AuthenticationFailure: RetryText.text = Localize.GetLocalizedString("Loading.AuthenticationFailure", "Failed to authenticate with the Motive server. Please try again."); break; case WebServicesDownloadErrorCode.APIQuotaExceeded: RetryText.text = Localize.GetLocalizedString("Loading.APIQuotaExceeded", "Your API quota has been exceeded. Please try again."); break; } } ObjectHelper.SetObjectActive(RetryPane, true); }
void AddCollectibleToObject(ARWorldObject worldObj) { var collectible = FirstCollectible; if (!Task.IsHidden) { var text = IsTakeTask ? Localize.GetLocalizedString("ARAnnotation.TapToTake", "Tap to Collect") : (IsGiveTask ? Localize.GetLocalizedString("ARAnnotation.TapToPut", "Tap to Put") : null); ARAnnotationViewController.Instance.AddTapAnnotation(worldObj, text, () => { if (IsTakeTask) { CollectItemFromObject(worldObj); } else { } }); if (collectible != null) { ARAnnotationViewController.Instance.AddCollectibleAnnotation(worldObj, collectible, () => { CollectItemFromObject(worldObj); }); } } worldObj.Clicked += worldObj_Selected; }
protected override void UpdateState() { if (IsTakeTask) { var worldObjects = ARWorld.Instance.GetWorldObjects(ActivationContext.InstanceId); var newObjs = new HashSet <ARWorldObject>(); if (worldObjects != null) { foreach (var obj in worldObjects) { if (m_worldObjects.Contains(obj)) { m_worldObjects.Remove(obj); } else { if (!Task.IsHidden) { var text = Localize.GetLocalizedString("ARAnnotation.TapToTake", "Tap to Collect"); ARAnnotationViewController.Instance.AddTapAnnotation(obj, text, () => { Complete(); }); } } newObjs.Add(obj); } } foreach (var obj in m_worldObjects) { ARAnnotationViewController.Instance.RemoveTapAnnotation(obj); } m_worldObjects = newObjs; } base.UpdateState(); }