void OnVuforiaInitError(VuforiaInitError error) { if (error != VuforiaInitError.NONE) { ShowErrorMessage(error); } }
void OnVuforiaInitialized(VuforiaInitError error) { VuforiaApplication.Instance.OnVuforiaInitialized -= OnVuforiaInitialized; // initialize if null if (aboutScreenInfo == null) { aboutScreenInfo = new AboutScreenInfo(); } }
void AfterInitialization(VuforiaInitError error) { if (VuforiaBehaviour.Instance != null) { DeviceObserverToggle.isOn = VuforiaBehaviour.Instance.DevicePoseBehaviour.enabled; } else { DeviceObserverToggle.isOn = false; } }
void OnVuforiaInitialized(VuforiaInitError error) { VuforiaApplication.Instance.OnVuforiaInitialized -= OnVuforiaInitialized; var aboutScreenInfo = new AboutScreenInfo(); var title = aboutScreenInfo.GetTitle(AboutScreenSampleInfo.ToString()); var description = aboutScreenInfo.GetDescription(AboutScreenSampleInfo.ToString()); var textElements = GetComponentsInChildren <Text>(); textElements[0].text = title; var textMeshProUGUI = GetComponentInChildren <TextMeshProUGUI>(); textMeshProUGUI.text = description; }
void ShowErrorMessage(VuforiaInitError errorCode) { switch (errorCode) { /* case VuforiaInitError.EXTERNAL_DEVICE_NOT_DETECTED: * mErrorMessage = * "Failed to initialize Vuforia because this " + * "device is not docked with required external hardware."; * break;*/ case VuforiaInitError.LICENSE_CONFIG_MISSING_KEY: mErrorMessage = "Vuforia App Key is missing. \n" + "Please get a valid key, by logging into your account at " + "developer.vuforia.com and creating a new project."; break; case VuforiaInitError.LICENSE_CONFIG_INVALID_KEY: mErrorMessage = "Vuforia App key is invalid. \n" + "Please get a valid key, by logging into your account at " + "developer.vuforia.com and creating a new project. \n\n" + GetKeyInfo(); break; case VuforiaInitError.LICENSE_CONFIG_NO_NETWORK_TRANSIENT: mErrorMessage = "Unable to contact server. Please try again later."; break; case VuforiaInitError.LICENSE_CONFIG_NO_NETWORK_PERMANENT: mErrorMessage = "No network available. Please make sure you are connected to the Internet."; break; case VuforiaInitError.LICENSE_CONFIG_KEY_CANCELED: mErrorMessage = "This App license key has been cancelled and may no longer be used. " + "Please get a new license key. \n\n" + GetKeyInfo(); break; case VuforiaInitError.LICENSE_CONFIG_PRODUCT_TYPE_MISMATCH: mErrorMessage = "Vuforia App key is not valid for this product. Please get a valid key, " + "by logging into your account at developer.vuforia.com and choosing the " + "right product type during project creation. \n\n" + GetKeyInfo() + "\n\n" + "Note that Universal Windows Platform (UWP) apps require " + "a license key created on or after August 9th, 2016."; break; case VuforiaInitError.DEVICE_NOT_SUPPORTED: mErrorMessage = "Failed to initialize Vuforia Engine because this device is not supported."; break; case VuforiaInitError.PERMISSION_ERROR: mErrorMessage = "One or more permissions required by Vuforia Engine are missing or not granted by user.\n" + "For example, the user may have denied camera access to this app.\n" + "In this case, you can enable camera access in Settings:\n" + "Settings > Privacy > Camera > " + Application.productName + "\n" + "Also verify that the camera is enabled in:\n" + "Settings > General > Restrictions."; break; case VuforiaInitError.LICENSE_ERROR: mErrorMessage = "A valid license configuration is required.\n"; break; case VuforiaInitError.INITIALIZATION: default: mErrorMessage = "Failed to initialize Vuforia Engine."; break; } mErrorMessage = "<color=red>" + errorCode.ToString().Replace("_", " ") + "</color>\n\n" + mErrorMessage; var errorTextConsole = mErrorMessage.Replace("<color=red>", "").Replace("</color>", ""); Debug.LogError("Vuforia initialization failed: " + errorCode + "\n\n" + errorTextConsole); MessageBox.DisplayMessageBox(ERROR_TITLE, mErrorMessage, true, OnErrorDialogClose); }