// Start is called before the first frame update void Start() { gameManager = GameManager.Instance; gameManager.OnGameStart += OnGameStart; tilemapInfo = TilemapInfo.Instance; InitializeTowerPositions(); }
// Start is called before the first frame update void Start() { gameManager = GameManager.Instance; gameManager.OnGameStart += OnGameStart; tilemapInfo = TilemapInfo.Instance; }
// Start is called before the first frame update void Start() { this.tilemapInfo = TilemapInfo.Instance; this.grid = tilemapInfo.GetGrid(); this.sprite = this.GetComponent <Sprite>(); isInitialized = true; }
void Start() { tilemapInfo = TilemapInfo.Instance; tiles = Tiles.Instance; tilemap = tilemapInfo.GetTilemap(); AddDependencies(); }
/** * Default spawn bounds = tilemap floor size - sprite padding */ void InitDefaultSpawnBounds() { TilemapInfo tilemapInfo = TilemapInfo.Instance; Vector3 bottomLeft = tilemapInfo.GetWorldCoordinatesOfTilePosition(tilemapInfo.GetBottomLeftCornerTilePosition()); Vector3 topRight = tilemapInfo.GetWorldCoordinatesOfTilePosition(tilemapInfo.GetTopRightCornerTilePosition()); this.minX = bottomLeft.x; this.maxX = topRight.x; this.minY = bottomLeft.y; this.maxY = topRight.y; }
// Start is called before the first frame update void Start() { tilemapInfo = TilemapInfo.Instance; tilemap = tilemapInfo.GetTilemap(); grid = tilemapInfo.GetGrid(); tiles = Tiles.Instance; prevHighlightedTile = new PrevHighlightedTile(); int numDirections = GetDirections().Length; highlightedNeighbors = new PrevHighlightedTile[numDirections]; for (int i = 0; i < numDirections; i++) { highlightedNeighbors[i] = new PrevHighlightedTile(); } }
/** * Randomly spawns n doors * Possible door tile positions include any position on the top/bot rows and left/right cols */ public void SpawnNDoors(int n) { TilemapInfo tilemapInfo = TilemapInfo.Instance; Vector3Int bottomLeft = tilemapInfo.GetBottomLeftCornerTilePosition(); Vector3Int topRight = tilemapInfo.GetTopRightCornerTilePosition(); for (int i = 0; i < n; i++) { int randRow = UnityEngine.Random.Range(bottomLeft.y + 1, topRight.y - 1); int randCol = UnityEngine.Random.Range(bottomLeft.x + 1, topRight.x - 1); int row = randRow; int col = randCol; switch (i % 4) { case 0: //top row = topRight.y; break; case 1: //bot row = bottomLeft.y; break; case 2: //left col = bottomLeft.x; break; case 3: //right col = topRight.x; break; } Vector3Int doorTilePosition = new Vector3Int(col, row, 0); Vector3 doorWorldPosition = tilemapInfo.GetWorldCoordinatesOfTilePosition(doorTilePosition); SpawnSprite(doorWorldPosition, Quaternion.identity); } }
// Use this for initialization void Start() { ti = tilemap.GetComponent <TilemapInfo>(); if (currentDir == null) { if (downDir.activeSelf) { currentDir = downDir; } else if (upDir.activeSelf) { currentDir = upDir; } else if (rightDir.activeSelf) { currentDir = rightDir; } else if (leftDir.activeSelf) { currentDir = leftDir; } } }
protected virtual void Init() { tilemapInfo = TilemapInfo.Instance; spriteMovement = this.GetComponent <SpriteMovement>(); }
void Awake() { Instance = this; }
// Start is called before the first frame update void Start() { tilemapInfo = TilemapInfo.Instance; OnNewSpriteSelected += OnNewSpriteSelectedHandler; OnSpriteDeselected += OnSpriteDeselectedHandler; }
void Start() { ti = tilemap.GetComponent <TilemapInfo>(); }