在unity3d中确定位置坐标生成模型,调用生成模型,然而模型不再该确定的位置上。这个问题怎么解决?
怎样将模型调用出现在设定的位置上?
void search(string information)
{
for (int i = 0; i < list.Count; i++)
GameObject.Destroy((Object)list[i]);
list.Clear();
for (int i = 0; i < Remdata.Length; i++)
{
for (int j = 0; j < Remdata[i].Length; j++)
{
Regex reg = new Regex(Remdata[i][j]);
if (reg.IsMatch(information))
{
//statics = resource[i];
//GameObject gFbx1 = (GameObject)Instantiate(objs[i], new Vector3(0,0, 2),new Quaternion());
gFbx1 = (GameObject)Instantiate(Remobjs[i]); //调用模型
//Debug.Log(gFbx1);
//GameObject gFbx1 = (GameObject)Instantiate(objs[i]); //调用模型
//list.Add(gFbx1);
switch (temp)
{
case 0: gFbx1.transform.position = new Vector3(0, 0, 2); break;
case 1: gFbx1.transform.position = new Vector3(0, 2, 2); break;
case 2: gFbx1.transform.position = new Vector3(2, 0, 2); break;
case 3: gFbx1.transform.position = new Vector3(0, 5, 2); break;
case 4: gFbx1.transform.position = new Vector3(0, 0, 5); break;
default: break;
// list.Add(gFbx1);
}
list.Add(gFbx1);
temp++;
}
}
}
}