Exemplo n.º 1
0
        //-------------------------------------Tracker call back------------------------------------------
        public void Ontrackerfoundevent(Imagetargettracker _imagetargettracker, GameObject _imagetarget)
        {
            //TODO:版本蓝图
            //1.识别图识别到后操作分为三大类型:A.基础类型操作(base),B.基于基础类型之上添加自定义操作(base+Custom),C.完全自定义操作(freedom)
            //2.识别到识别图后读取设置进行对识别图识别后进行区分操作
            //3.识别到识别图后进行的操作写入内容资源内部
            //4.调用资源内部方法进行执行

            if (!Browser.Getinstance().GetNetreachable(false))
            {
                return;
            }


            if (imagetracker != null)
            {
                if (!imagetracker.Equals(_imagetargettracker))
                {
                    imagetracker = _imagetargettracker;
                }
            }
            else
            {
                imagetracker = _imagetargettracker;
            }

            curtrackerstatus = Trackerstatus.FOUND;
            Scanview scanview = (Scanview)Uimanager.Getinstance().Getviewfromviewid(typeof(Scanview).Name);

            scanview.Updateviewstatus(Viewstatus.SHOW);
            if (_imagetargettracker.targetdata.Instantiatedobject != null)
            {
                _imagetargettracker.targetdata.Brokenlink();
            }
        }
Exemplo n.º 2
0
        internal void Parsingbundlecallback(Object obj)
        {
            if (this.imagetracker == null)
            {
                imagetracker = FindObjectOfType <Imagetargettracker>();
            }

            Getcurrecostatus = Scanstatus.SCANISDONE;
            //TODO:隐藏下载UI进度条
            Uimanager.Getinstance().Hideprogress();

            GameObject tmp = GameObject.Instantiate((GameObject)obj);

            tmp.transform.SetParent(Cloudrecoeventhandler.Getinstance().imagetargettemplate.transform);
            tmp.transform.localPosition    = Vector3.zero;
            tmp.transform.localEulerAngles = Vector3.zero;

            imagetracker.targetdata.losetype           = baseoperation.config.bundlelosetype;
            imagetracker.targetdata.rotation           = baseoperation.config.bundlerotation;
            imagetracker.targetdata.scale              = baseoperation.config.bundlescale;
            imagetracker.targetdata.centeroffset       = baseoperation.config.bundleposistionoffset;
            imagetracker.targetdata.Instantiatedobject = tmp;


            switch (curtrackerstatus)
            {
            case Trackerstatus.LOSE:
                Ontrackerloseevent(imagetracker, null);
                break;

            case Trackerstatus.FOUND:
                Ontrackerfoundevent(imagetracker, null);
                break;
            }


            if (onparsingitemend != null)
            {
                onparsingitemend.Invoke();
            }
        }
Exemplo n.º 3
0
        public void Ontrackerloseevent(Imagetargettracker _imagetargettracker, GameObject _imagetarget)
        {
            curtrackerstatus = Trackerstatus.LOSE;

            if (_imagetargettracker.targetdata == null)
            {
                return;
            }
            switch (_imagetargettracker.targetdata.losetype)
            {
            case Bundlelosetype.DESTROY:
                _imagetargettracker.targetdata.Releaseinstantiatedtarget();
                break;

            case Bundlelosetype.HIDING:
                _imagetargettracker.targetdata.Hideinstantiatedobject();
                break;

            case Bundlelosetype.SCREEN2D:
                _imagetargettracker.targetdata.Updatetocenter();
                break;
            }
        }