unity3d Transform对象实例化要用到Resources.Load
Prefab放到Resources文件夹下
实例化用到
Instantiate (original : Object, position : Vector3, rotation : Quaternion)


预设的引用用Resources.Load得到 然后实例化
public class BuildBuildingControl : MonoBehaviour {

private GameObject ViewCenter;
void Start () {
ViewCenter = GameObject.Find("ViewCenter");
}
public void build(string str)
{
print(str);
GameObject Tower_F = Resources.Load("Tower_F") as GameObject;
GameObject tower = Instantiate(Tower_F,ViewCenter.transform.position,ViewCenter.transform.rotation) as GameObject;
print(tower.transform.position);
}
// Update is called once per frame
void Update () {
}
}