Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: wongalan2002 on December 18, 2013, 09:33:59 PM
-
I am using the wonderful PlayMakerVuforia.unitypackage
https://hutonggames.fogbugz.com/default.asp?W1119 (https://hutonggames.fogbugz.com/default.asp?W1119)
But after upgrade to vuforia 2.8, some error come up on PlayMakerVuforiaProxy.cs, any idea how to fix this issue?
error CS0117: `Tracker' does not contain a definition for `Type'
error CS1501: No overload for method `GetTracker' takes `1' arguments
-----------------------------------[SOLVED]-------------------------------------------
Just follow the migration guide:
https://developer.vuforia.com/resources/dev-guide/migrating-your-unity-project (https://developer.vuforia.com/resources/dev-guide/migrating-your-unity-project)
replace
TrackerManager.Instance.GetTracker(Tracker.Type.IMAGE_TRACKER)
with
TrackerManager.Instance.GetTracker<ImageTracker>()
and replace
TrackerManager.Instance.InitTracker(Tracker.Type.IMAGE_TRACKER)
with
TrackerManager.Instance.InitTracker<ImageTracker>()
the complete PlayMakerVuforiaProxy.cs should be:
using UnityEngine;
using System.Collections;
public class PlayMakerVuforiaProxy : MonoBehaviour {
public bool debug = true;
public static bool ActivateDataSet(string dataSet,bool state)
{
if (!QCARRuntimeUtilities.IsQCAREnabled())
{
return false;
}
if (QCARRuntimeUtilities.IsPlayMode())
{
// initialize QCAR
QCARUnity.CheckInitializationError();
}
if (TrackerManager.Instance.GetTracker<ImageTracker>() == null)
{
return false;
}
ImageTracker imageTracker = (ImageTracker)TrackerManager.Instance.GetTracker<ImageTracker>();
foreach(DataSet _set in imageTracker.GetDataSets())
{
Debug.Log (_set.Path);
/*
if (state)
{
return imageTracker.ActivateDataSet(dataSet);
}else{
return imageTracker.DeactivateDataSet(dataSet);
}
*/
}
return false;
}
public static bool RefreshDatasets(DataSetLoadBehaviour dataSetBehaviour)
{
if (!QCARRuntimeUtilities.IsQCAREnabled())
{
return false;
}
if (QCARRuntimeUtilities.IsPlayMode())
{
// initialize QCAR
QCARUnity.CheckInitializationError();
}
if (TrackerManager.Instance.GetTracker<ImageTracker>() == null)
{
TrackerManager.Instance.InitTracker<ImageTracker>();
}else{
ImageTracker imageTracker = (ImageTracker)TrackerManager.Instance.GetTracker<ImageTracker>();
imageTracker.DestroyAllDataSets(true);
}
if (dataSetBehaviour.mDataSetsToLoad.Count <= 0)
{
Debug.LogWarning("No data sets defined. Not loading any data sets.");
return false;
}
foreach (string dataSetName in dataSetBehaviour.mDataSetsToLoad)
{
if (!DataSet.Exists(dataSetName))
{
Debug.LogWarning("Data set " + dataSetName + " does not exist.");
return false;
}
ImageTracker imageTracker = (ImageTracker)TrackerManager.Instance.GetTracker<ImageTracker>();
DataSet dataSet = imageTracker.CreateDataSet();
if (!dataSet.Load(dataSetName))
{
Debug.LogWarning("Failed to load data set " + dataSetName + ".");
return false;
}
// Activate the data set if it is the one specified in the editor.
if (dataSetBehaviour.mDataSetsToActivate.Contains(dataSetName))
{
imageTracker.ActivateDataSet(dataSet);
}
}
return true;
}
}
-
Hi,
Thanks for spotting this and looking it up!
I'll push these changes when I am done with Mecanim and pathfinding ok? I need to get these out of the door first, it's been too long already.
bye,
Jean
-
Thanks for the fix, this has resolved the issue main issue. However, I'm getting a problem with UDTUIEventHandler.cs after applying the code edits.
Assets/Scripts/UDTUIEventHandler.cs(63,32): error CS1061: Type `UIButton' does not contain a definition for `TappedOn' and no extension method `TappedOn' of type `UIButton' could be found (are you missing a using directive or an assembly reference?)
I'm searching for a fix but any help would be appreciated.
-
hi,
Can you bump this next week? I'll have a look.
bye,
Jean
-
*Bump :)
-
Hi,
ok, I am dealing with this now, but I get the same error in one of their own file...
"ImageTargetsMenu.cs".
Did you had to modify this as well? that's sounds very odd to me.
bye,
Jean
-
Hey Jean,
Did you manage to get anywhere with this? Still having the same issue as described above and can't fix it. There's a bug with a previous version of Vuforia on Android builds which means that the most recent version of Vuforia must be used, however the above issue makes it impossible to progress.
-
Hi,
Can you give me few more days? bump me beginning on next week. Thanks for your patience. I tested the latest package and the error is gone so I am going to be able to readjust the custom actions I did a while ago.
bye,
Jean
-
*Bump
-
Hi,
yeah sorry, this week is going to be difficult too unfortunatly, had to rush back to france for family. Please bump me early next week ok? thanks for your patience.
bye,
Jean
-
*bump*
-
Hi,
It's done, finally :)
Please redownload from the wiki.
bye,
Jean
-
Thank you!