public static Townv2 CreateNew(TownGen gen, Transform parent, Vector3 position, GameObject debug) { GameObject go = new GameObject("Town"); go.transform.SetParent(parent); go.transform.position = position; if (debug != null) { Instantiate(debug, go.transform).transform.localPosition = Vector3.zero; } Townv2 town = go.AddComponent <Townv2>(); town.Init(gen); return(town); }
private void Init(TownGen gen) { generator = gen; }