Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class TileTest : MonoBehaviour {
- public Tile tile;
- private Tilemap tilemap;
- public int currentSize;
- void Start () {
- tilemap = GetComponent<Tilemap>;
- Grow();
- }
- void Update() {
- for (var i = 0; i < 100; i++) {
- Grow();
- }
- Debug.Log(currentSize);
- }
- private void Grow() {
- for (int x = 0; x < currentSize; x++) {
- tilemap.SetTile(new Vector3Int(x, currentSize, 0), tile);
- }
- for (int y = 0; y < currentSize; y++) {
- tilemap.SetTile(new Vector3Int(currentSize, y, 0), tile);
- }
- tilemap.SetTile(new Vector3Int(currentSize, currentSize, 0), tile);
- currentSize++;
- }
- }
- public class TileTest : MonoBehaviour {
- public Tile tile;
- private Tilemap tilemap;
- public int currentSize;
- void Start () {
- tilemap = GetComponentInChildren<Tilemap>();
- }
- void Update() {
- tilemap.SetTile(new Vector3Int(currentSize, currentSize, 0), tile);
- currentSize+= 100;
- }
- }
Add Comment
Please, Sign In to add comment