public void CheckTarget(Block target) { int x = target.x; int y = target.y; E_BLOCK_TYPE eType = target.eBlockType; Inlist(eType, x + 1, y); Inlist(eType, x - 1, y); Inlist(eType, x, y + 1); Inlist(eType, x, y - 1); }
public void Init(GameScene gameScene, E_BLOCK_TYPE eBlockType, int x, int y) { this.gameScene = gameScene; this.eBlockType = eBlockType; this.x = x; this.y = y; InitBlockType(); InitPosition(); view.btnBlock.Init(OnClickBlock); SetupItem(); }
private void Inlist(E_BLOCK_TYPE eType, int x, int y) { if (BlockManager.Instance.isCheckedBlock(x, y)) { return; } BlockManager.Instance.CheckBlockPopMap(x, y); var block = BlockManager.Instance.GetBlock(x, y); if (block != null && eType == block.eBlockType) { BlockList.Add(block); } }
public void CreateBlock(E_BLOCK_TYPE eBlockType, int x, int y) { if (!CanCreate(x, y)) { return; } Block newBlock = Instantiate <Block>(blockTemplate); newBlock.transform.parent = trHolder; newBlock.Init(gameScene, eBlockType, x, y); BlockMap[x, y] = newBlock; BlockList.Add(newBlock); }