Log in or register to post comments

Creating Device Target Database as Asset Bundle

September 29, 2020 - 2:45am #1

Hello, I am using object targets and many of them. The APK is getting huge because of OD files.

How can i install them as asset bundles? 

My target database files are in Assets/StreamingAssets/Vuforia folder and when i try to build bundle it gives this error:

Assets in StreamingAssets cannot be included in AssetBundles:

When i move these two files to another folder, it adds .xml file into the asset bundle build but gives this error for .dat file:

Unrecognized assets cannot be included in AssetBundles: "Assets/Resources/BLWA_OT.dat".

 

So i moved files to resources folder and changed .dat extension to .bytes and it built the bundle.

 

Where i will change .bytes extension to .dat in apk build?

 

Do I keep those files out of StreamingAssets/Vuforia folder in order not to build them in APK?

 

Now for loading data sets from phone path; do i have to move files back into StreamingAssets/Vuforia folder?

 

Thank you very much

 

 

AttachmentSize
Image icon unnamed.png54.56 KB

Creating Device Target Database as Asset Bundle

October 12, 2020 - 3:21pm #6

xebuddha wrote:

Even i modify the DefaultTrackableEventHandler script; it resets it self when i reopen project. How can i keep it?

 

that solution didnt work because  DefaultTrackableEventHandler script resets itself when editor reopens.

 

So what i did is:

tb.gameObject.GetComponent<DefaultTrackableEventHandler>().OnTargetLost = new UnityEngine.Events.UnityEvent();

      tb.gameObject.GetComponent<DefaultTrackableEventHandler>().OnTargetFound = new UnityEngine.Events.UnityEvent();

in my script.

Creating Device Target Database as Asset Bundle

October 12, 2020 - 11:47am #5

Even i modify the DefaultTrackableEventHandler script; it resets it self when i reopen project. How can i keep it?

Creating Device Target Database as Asset Bundle

October 12, 2020 - 7:46am #4

I solved the issue with changing code in DefaultTrackableEventHandler script



from

public UnityEvent OnTargetFound;

public UnityEvent OnTargetLost;

 

to

 

public UnityEvent OnTargetFound = new UnityEvent();

public UnityEvent OnTargetLost = new UnityEvent();

Creating Device Target Database as Asset Bundle

October 12, 2020 - 5:12am #3

mcotora wrote:

Hi,

Please go over this post: https://developer.vuforia.com/forum/unity/vuforia-assetbundle

Thank you.

Vuforia Engine Support

 

Thank you I have managed to solve most of my problems but there is one issue please help me:

 

Dynamic data set loader script: Loops TrackableBehaviour and adds them DefaultTrackableEventHandler script.

tb.gameObject.AddComponent<DefaultTrackableEventHandler>();

 

When i try to access that script with GetComponent, for OnTargetFound event, it gives null exception:

tb.gameObject.GetComponent<DefaultTrackableEventHandler>().OnTargetFound.AddListener(CarFound); is giving null exception

tb.gameObject.GetComponent<DefaultTrackableEventHandler>().OnTargetFound.RemoveAllListeners(); is giving null exception

I can reach DefaultTrackableEventHandler component but cant do anything with it.

DefaultTrackableEventHandler dteh = tb.gameObject.GetComponent<DefaultTrackableEventHandler>(); is NOT giving null exception

tb.gameObject.GetComponent<DefaultTrackableEventHandler>().enabled = false; is working as well

 

void CarFound()

    {

  augmentation.SetActive(true);

}

 

Please help me

 

 

 

Creating Device Target Database as Asset Bundle

October 5, 2020 - 4:53am #2

Hi,

Please go over this post: https://developer.vuforia.com/forum/unity/vuforia-assetbundle

Thank you.

Vuforia Engine Support

Log in or register to post comments