public MinimapDisplay(Transform parent) { for (int row = 0; row < tiles.GetLength(0); row++) { for (int col = 0; col < tiles.GetLength(1); col++) { var pos = new Vector2(row * 32, col * 16); var s = new Sprite(HUDSpriteFactory.Instance.CreateMinimapBlack()); MapTile t = new MapTile(s, pos); tiles[row, col] = t; Scene.Add(t); parent.AddChild(t); } } // link linkPosition = new HUDItem(HUDSpriteFactory.Instance.CreateMapGreenSquare(), new Vector2(0, 0)); SetLinkPosition(); Constants.SetLayerDepth(linkPosition, Constants.LayerDepth.Debug); Scene.Add(linkPosition); parent.AddChild(linkPosition); // boss bossRoom = new HUDItem(HUDSpriteFactory.Instance.CreateMapBossLocation(), new Vector2(0, 0)); var bossSprite = bossRoom.GetComponent <Sprite>(); bossSprite.SetVisible(false); bossSprite.SetAnimate(true); bossSprite.SetUpdateFrameSpeed(10); SetBossPosition(); Constants.SetLayerDepth(bossRoom, Constants.LayerDepth.Debug); Scene.Add(bossRoom); parent.AddChild(bossRoom); }
private void SetLinkPosition() { string currentLevel = LevelManager.currentLevelPath; var split = currentLevel.Split('_'); int roomX = Int16.Parse(split[0]); int roomY = Int16.Parse(split[1]); linkPosition.GetComponent <Transform>().position = new Vector2(((roomX + 1) * 32) + 8, (roomY + 1) * 16); }
public void BossRoomVisible() { bossRoom.GetComponent <Sprite>().SetVisible(true); }