public void OnQCARInitializationError(QCARUnity.InitError initError) { if (initError != QCARUnity.InitError.INIT_SUCCESS) { mErrorOccurred = true; mPopUpMsg.SetErrorCode(initError); } }
public void OnQCARInitializationError(QCARUnity.InitError initError) { if (initError != QCARUnity.InitError.INIT_SUCCESS) { SetErrorCode(initError); SetErrorOccurred(true); } }
public void SetErrorCode(QCARUnity.InitError errorCode) { mCurrentError = new ErrorData(); mCurrentError.Title = "QCAR Initialization Error"; mCurrentError.Text = ""; Debug.LogError("QCAR initialization failed: " + errorCode); mErrorcode = errorCode; switch (errorCode) { case QCARUnity.InitError.INIT_LICENSE_ERROR_MISSING_KEY: mCurrentError.Text = "Vuforia App key is missing. Please get a valid key, by logging into your account at developer.vuforia.com and creating a new project "; break; #if (UNITY_IPHONE || UNITY_IOS) case QCARUnity.InitError.INIT_NO_CAMERA_ACCESS: mCurrentError.Text = "Camera Access was denied to this App. \n" + "When running on iOS8 devices, \n" + "users must explictly allow the App to access the camera.\n" + "To restore camera access on your device, go to: \n" + "Settings > Privacy > Camera > [This App Name] and switch it ON."; break; #endif case QCARUnity.InitError.INIT_LICENSE_ERROR_INVALID_KEY: mCurrentError.Text = " Invalid Key used. Please make sure you are using a valid Vuforia App Key"; break; case QCARUnity.InitError.INIT_LICENSE_ERROR_NO_NETWORK_TRANSIENT: mCurrentError.Text = "Unable to contact server. Please try again later."; break; case QCARUnity.InitError.INIT_LICENSE_ERROR_NO_NETWORK_PERMANENT: mCurrentError.Text = "No network available. Please make sure you are connected to the Internet."; break; case QCARUnity.InitError.INIT_LICENSE_ERROR_CANCELED_KEY: mCurrentError.Text = "This app license key has been canceled and may no longer be used. Please get a new license key"; break; case QCARUnity.InitError.INIT_ERROR: mCurrentError.Text = "Failed to initialize QCAR."; break; case QCARUnity.InitError.INIT_LICENSE_ERROR_PRODUCT_TYPE_MISMATCH: mCurrentError.Text = "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"; break; } }
void Start() { // Check for an initialization error on start. QCARUnity.InitError errorCode = QCARUnity.CheckInitializationError(); if (errorCode != QCARUnity.InitError.INIT_SUCCESS) { SetErrorCode(errorCode); SetErrorOccurred(true); } }
// Implementation of the IQCARErrorHandler function which sets the // error message. private void SetErrorCode(QCARUnity.InitError errorCode) { switch (errorCode) { case QCARUnity.InitError.INIT_DEVICE_NOT_SUPPORTED: mErrorText = "Failed to initialize QCAR because this device is not " + "supported."; break; case QCARUnity.InitError.INIT_ERROR: mErrorText = "Failed to initialize QCAR."; break; } }
public void SetErrorCode(QCARUnity.InitError errorCode) { mCurrentError = new ErrorData(); mCurrentError.Title = "QCAR Initialization Error"; mCurrentError.Text = ""; Debug.LogError("QCAR initialization failed: " + errorCode); mErrorcode = errorCode; switch (errorCode) { case QCARUnity.InitError.INIT_LICENSE_ERROR_MISSING_KEY: mCurrentError.Text = "Vuforia App key is missing. Please get a valid key, by logging into your account at developer.vuforia.com and creating a new project "; break; #if UNITY_IPHONE case QCARUnity.InitError.INIT_NO_CAMERA_ACCESS: mCurrentError.Text = "Camera Access was denied to this App. \n" + "When running on iOS8 devices, \n" + "users must explictly allow the App to access the camera.\n" + "To restore camera access on your device, go to: \n" + "Settings > Privacy > Camera > [This App Name] and switch it ON."; break; #endif case QCARUnity.InitError.INIT_LICENSE_ERROR_INVALID_KEY: mCurrentError.Text = " Invalid Key used. Please make sure you are using a valid Vuforia App Key"; break; case QCARUnity.InitError.INIT_LICENSE_ERROR_NO_NETWORK_TRANSIENT: mCurrentError.Text = "Unable to contact server. Please try again later."; break; case QCARUnity.InitError.INIT_LICENSE_ERROR_NO_NETWORK_PERMANENT: mCurrentError.Text = "No network available. Please make sure you are connected to the Internet."; break; case QCARUnity.InitError.INIT_LICENSE_ERROR_CANCELED_KEY: mCurrentError.Text = "This app license key has been canceled and may no longer be used. Please get a new license key"; break; case QCARUnity.InitError.INIT_ERROR: mCurrentError.Text = "Failed to initialize QCAR."; break; } }
// Implementation of the IQCARErrorHandler function which sets the // error message. private void SetErrorCode(QCARUnity.InitError errorCode) { Debug.LogError("QCAR initialization failed: " + mErrorText); switch (errorCode) { case QCARUnity.InitError.INIT_EXTERNAL_DEVICE_NOT_DETECTED: mErrorText = "Failed to initialize Vuforia because this " + "device is not docked with required external hardware."; break; case QCARUnity.InitError.INIT_LICENSE_ERROR_MISSING_KEY: mErrorText = "Vuforia App key is missing. Please get a valid key, " + "by logging into your account at developer.vuforia.com " + "and creating a new project"; break; case QCARUnity.InitError.INIT_LICENSE_ERROR_INVALID_KEY: mErrorText = "Invalid Key used. " + "Please make sure you are using a valid Vuforia App Key"; break; case QCARUnity.InitError.INIT_LICENSE_ERROR_NO_NETWORK_TRANSIENT: mErrorText = "Unable to contact server. Please try again later."; break; case QCARUnity.InitError.INIT_LICENSE_ERROR_NO_NETWORK_PERMANENT: mErrorText = "No network available. Please make sure you are connected to the internet."; break; case QCARUnity.InitError.INIT_LICENSE_ERROR_CANCELED_KEY: mErrorText = "This App license key has been cancelled " + "and may no longer be used. Please get a new license key."; break; #if (UNITY_IPHONE || UNITY_IOS) case QCARUnity.InitError.INIT_NO_CAMERA_ACCESS: mErrorText = "Camera Access was denied to this App. \n" + "When running on iOS8 devices, \n" + "users must explicitly allow the App to access the camera.\n" + "To restore camera access on your device, go to: \n" + "Settings > Privacy > Camera > [This App Name] and switch it ON."; break; #endif case QCARUnity.InitError.INIT_DEVICE_NOT_SUPPORTED: mErrorText = "Failed to initialize QCAR because this device is not " + "supported."; break; case QCARUnity.InitError.INIT_ERROR: mErrorText = "Failed to initialize QCAR."; break; } }