public InfiniteTileGOGrid(GameObject parent, int regionSize) { componentGrid = new InfiniteComponentGrid(regionSize); if (Application.isPlaying) { foreach (Transform t in parent.transform) { if (t.name == "tile container") { Object.Destroy(t.gameObject); } } } else { foreach (Transform t in parent.transform) { if (t.name == "tile container") { Object.DestroyImmediate(t.gameObject); } } } container = new GameObject("tile container"); container.transform.SetParent(parent.transform, false); }
public override void ResetListener() { if (components == null) { components = new InfiniteComponentGrid(Grid.REGION_SIZE); } if (containerGO == null) { containerGO = new GameObject("colliders"); containerGO.transform.SetParent(transform, false); } base.ResetListener(); }
public override void ResetListener() { if (regionRenderers == null) { regionRenderers = new List <PositionRegionRenderer> (); } if (triangles == null) { triangles = new InfiniteComponentGrid(Grid.REGION_SIZE); } if (containerGO == null) { containerGO = new GameObject("sprites"); containerGO.transform.SetParent(transform, false); } base.ResetListener(); }