OK, just in case anyone else get this at last I found the problem (but not sure why it is a problem) and a fix!
The output is this just prior to the AR not restarting on return from another scene, see the bold sections and what I have implemented to resolve it
It would be really useful if the MODS could advise why this is the case?
markerTrackerStop
objectTrackerStop
Trackable poster lost
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:Log(Object)
MyTrackableEventHandler:OnTrackingLost()
MyTrackableEventHandler:OnTrackableStateChanged(Status, Status)
Vuforia.TrackableBehaviour:OnTrackerUpdate(Status)
Vuforia.DataSetTrackableBehaviour:OnTrackerUpdate(Status)
Vuforia.StateManagerImpl:SetTrackableBehavioursForTrackableToNotFound(Trackable)
Vuforia.ObjectTrackerImpl:Stop()
Vuforia.QCARAbstractBehaviour:StopQCAR()
Vuforia.QCARAbstractBehaviour:OnDisable()
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
NullReferenceException
at UnityEngine.Behaviour.set_enabled (Boolean value) [0x00000] in <filename unknown>:0
at MyTrackableEventHandler.OnTrackingLost () [0x00000] in <filename unknown>:0
at MyTrackableEventHandler.OnTrackableStateChanged (Status previousStatus, Status newStatus) [0x00000] in <filename unknown>:0
at Vuforia.TrackableBehaviour.OnTrackerUpdate (Status newStatus) [0x00000] in <filename unknown>:0
at Vuforia.DataSetTrackableBehaviour.OnTrackerUpdate (Status newStatus) [0x00000] in <filename unknown>:0
at Vuforia.StateManagerImpl.SetTrackableBehavioursForTrackableToNotFound (Trackable trackable) [0x00000] in <filename unknown>:0
at Vuforia.ObjectTrackerImpl.Stop () [0x00000] in <filename unknown>:0
at Vuforia.QCARAbstractBehaviour.StopQCAR () [0x00000] in <filename unknown>:0
at Vuforia.QCARAbstractBehaviour.OnDisable () [0x00000] in <filename unknown>:0
(Filename: currently not available on il2cpp Line: -1)
objectTrackerDeactivateDataSet
objectTrackerDestroyDataSet
objectTrackerStop
markerTrackerStop
trackerManagerDeinitTracker
Error: Marker Tracker could not be deinitialized.
Could not deinitialize the tracker.
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:LogError(Object)
Vuforia.TrackerManagerImpl:DeinitTracker()
Vuforia.QCARAbstractBehaviour:OnDestroy()
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
trackerManagerDeinitTracker
Error: Object Tracker could not be deinitialized.
Could not deinitialize the tracker.
This in my trackableeventhandler on imagetracker object:
void Awake() {
// seems if I do this then OnTrackableStateChanged will only run OnTrackingLost during this scene and not as a result
// of this scene unloading to another one
// stops the unable to set hint, deinitialise tracker etc and allows AR to continue restarting between scenes
PlayerPrefs.SetInt("LoadingLevel", 0);
}
public void OnTrackableStateChanged(TrackableBehaviour.Status previousStatus, TrackableBehaviour.Status newStatus) {
if (newStatus == TrackableBehaviour.Status.DETECTED ||
newStatus == TrackableBehaviour.Status.TRACKED ||
newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED) {
OnTrackingFound();
}
else {
// seems if I do this then OnTrackableStateChanged will only run OnTrackingLost during this scene and not as a result
// of this scene unloading to another one
// stops the unable to set hint, deinitialise tracker etc and allows AR to continue restarting between scenes
if (PlayerPrefs.GetInt("LoadingLevel") == 0){
OnTrackingLost();
}
}
}
And then in my script that triggers loading another scene:
private void HandleSingleTap() {
// stops OnTrackingLost running as we move from AR to another scene
PlayerPrefs.SetInt("LoadingLevel", 1);
PlayerPrefs.SetString("SelectedImage", touchedName);
// force back to landscape
Screen.orientation = ScreenOrientation.LandscapeLeft;
Application.LoadLevel("Audio");
}
OK, just in case anyone else get this at last I found the problem (but not sure why it is a problem) and a fix!
The output is this just prior to the AR not restarting on return from another scene, see the bold sections and what I have implemented to resolve it
It would be really useful if the MODS could advise why this is the case?
This in my trackableeventhandler on imagetracker object:
void Awake() {
// seems if I do this then OnTrackableStateChanged will only run OnTrackingLost during this scene and not as a result
// of this scene unloading to another one
// stops the unable to set hint, deinitialise tracker etc and allows AR to continue restarting between scenes
PlayerPrefs.SetInt("LoadingLevel", 0);
}
public void OnTrackableStateChanged(TrackableBehaviour.Status previousStatus, TrackableBehaviour.Status newStatus) {
if (newStatus == TrackableBehaviour.Status.DETECTED ||
newStatus == TrackableBehaviour.Status.TRACKED ||
newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED) {
OnTrackingFound();
}
else {
// seems if I do this then OnTrackableStateChanged will only run OnTrackingLost during this scene and not as a result
// of this scene unloading to another one
// stops the unable to set hint, deinitialise tracker etc and allows AR to continue restarting between scenes
if (PlayerPrefs.GetInt("LoadingLevel") == 0){
OnTrackingLost();
}
}
}
And then in my script that triggers loading another scene:
private void HandleSingleTap() {
// stops OnTrackingLost running as we move from AR to another scene
PlayerPrefs.SetInt("LoadingLevel", 1);
PlayerPrefs.SetString("SelectedImage", touchedName);
// force back to landscape
Screen.orientation = ScreenOrientation.LandscapeLeft;
Application.LoadLevel("Audio");
}