예제 #1
0
        public void Dispose()
        {
            if (boxObj_m != null &&
                vuforiaPlane_m != null)
            {
                boxObj_m.transform.parent = null; // disconnect from vuforia parent
                VuforiaPool.Release(vuforiaPlane_m);
#if UNITY_EDITOR
                GameObject.DestroyImmediate(boxObj_m);
#else
                GameObject.Destroy(boxObj_m);
#endif
            }
        }
        public List <KeyValuePair <int, GameObject> > GrabVuforiaObjects(int count)
        {
            if (count <= VuforiaPool.NumAvailable)
            {
                List <KeyValuePair <int, GameObject> > objs = new List <KeyValuePair <int, GameObject> >();

                for (int i = 0; i < count; i++)
                {
                    int        index;
                    GameObject go = VuforiaPool.PullNext(out index);

                    KeyValuePair <int, GameObject> pair = new KeyValuePair <int, GameObject>(index, go);

                    objs.Add(pair);
                }

                return(objs);
            }
            else
            {
                return(null);
            }
        }