void Start() { var obj = AssetDatabase.LoadAssetAtPath <GameObject>(string.Format("Assets/Data_oe/world/terrains/{0}.prefab", "TerrainRoot")); root = Instantiate(obj).GetComponent <TerrainRoot>(); var config = AssetDatabase.LoadAssetAtPath <TerrainAssets>(string.Format("Assets/Data_oe/world/terrains/{0}.asset", "TerrainData")); root.Init(config, size); var pos = transform.position; root.MoveTo(pos.x, pos.z, dx, dz); }
void Update() { var pos = transform.position; root.MoveTo(pos.x, pos.z, dx, dz); }