// Used by ShiftRow to shift the Master Market Grid rows // TODO: update to use animations private void ShiftMasterMarketGrid(int row, int units) { int marketWidth = Mathf.CeilToInt((float)MatchController.MasterDeck.marketCardDeck.Count / (float)config.GameGridHeight); for (int x = 0; x < marketWidth; x++) { for (int y = row; y < config.GameGridHeight; y++) { if (masterMarketGrid[x, y] != null) { float oldX = masterMarketGrid[x, y].CardObject.transform.position.x; float oldY = masterMarketGrid[x, y].CardObject.transform.position.y; // float oldZ = masterMarketGrid[x, y].tileObj.transform.position.z; StartCoroutine(CardAnimations.MoveTileCoroutine(masterMarketGrid[x, y].CardObject, new Vector3(0, shiftUnit, 0), .1f)); // masterMarketGrid[x, y].CardObject.transform.position = new Vector3(oldX, // (oldY += (shiftUnit * units)), // masterMarketGrid[x, y].CardObject.transform.position.z); } } } }
// Used by ShiftRow to shift the Master Grid rows private void ShiftMasterGrid(int row, int units) { for (int x = 0; x < config.GameGridWidth; x++) { for (int y = row; y < config.GameGridHeight; y++) { // Debug.Log(debugTag + "Looking for x" + x + ", y" + y); // Debug.Log(debug + "Shifting [" + x + ", " + y + "]"); float oldX = knownOwnersGrid[x, y].CardObject.transform.position.x; float oldY = knownOwnersGrid[x, y].CardObject.transform.position.y; float oldZ = knownOwnersGrid[x, y].CardObject.transform.position.z; StartCoroutine(CardAnimations.MoveTileCoroutine(knownOwnersGrid[x, y].CardObject, new Vector3(0, shiftUnit, 0), .1f)); // knownOwnersGrid[x, y].CardObject.transform.position = new Vector3(oldX, // (oldY += (shiftUnit * units)), // knownOwnersGrid[x, y].CardObject.transform.position.z); } } }