简体   繁体   中英

Multiple image targets and instantiated prefabs as objects doesn't show simuntaneously

I'm facing an odd problem. I wrote 2 identical scripts with different variable names that read a CSV file of xyz points and instantiates my prefab based on those points:

void Start()
    {
        Load(file);

        for (i = 1; i < numberOfPoints; i++)
        {
            string j = i.ToString();


            x = Single.Parse(Find_point_number(j).my_x);
            y = Single.Parse(Find_point_number(j).my_y);
            z = Single.Parse(Find_point_number(j).my_z);

            isDesired = Single.Parse(Find_point_number(j).is_desired);

            if (isDesired == 1)
            {
                desired++;
                myArray.Add(x);
                myArray.Add(y);
                myArray.Add(z);
                myArray.Add(0);
                prefab.Add((GameObject)Instantiate(go)); 
            }
        }

        int g = 0;

        for (int i = 0; i < prefab.Count; i++)
        {
            prefab[i].transform.localPosition = new Vector3(myArray[g], myArray[g + 1], myArray[g + 2]);
            g += 4;
        }
    }

My first set of points start at 12,24 and -15 and my second set of points start at 0.35, -1.6 and -1.4

I've copied this code for my other image and changed all the variable names.

在此处输入图片说明

Both of my databases are selected and activated.

My object prefabs are different.

My problem is it sees the first object, but it doesn't show the second object when I put the image targets side by side. The two different group of objects move relative to each other although they shouldn't be related.

You cannot activate two database at same time because you have to add Licence Key.There is Unique licence key for each database.you can add one licence key per application. Add both images in single database, it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM