Exemple #1
0
        private void LoadCloudTarget(ImageTarget target)
        {
            var uid = target.uid();

            loadedCloudTargetUids.Add(uid);
            var go = new GameObject(uid);

            targetObjs.Add(go);
            var targetController = go.AddComponent <ImageTargetController>();

            targetController.SourceType   = ImageTargetController.DataSource.Target;
            targetController.TargetSource = target;
            LoadTargetIntoTracker(targetController);

            targetController.TargetLoad += (loadedTarget, result) =>
            {
                if (!result)
                {
                    Debug.LogErrorFormat("target {0} load failed", uid);
                    return;
                }
                AddCubeOnTarget(targetController);
            };

            if (UseOfflineCache && Directory.Exists(OfflineCachePath))
            {
                if (target.save(OfflineCachePath + "/" + target.uid() + ".etd"))
                {
                    cachedTargetCount++;
                }
            }
        }