コード例 #1
0
 public void BlackTileAdded()
 {
     for (int i = 0; i < config.goalArray.Length; i++)
     {
         if (config.goalArray[i] is MergeBlackTiles_Goal)
         {
             MergeBlackTiles_Goal goal = config.goalArray[i] as MergeBlackTiles_Goal;
             goal.blackTilesSpawned++;
         }
     }
 }
コード例 #2
0
 public void BlackTileMerged()
 {
     for (int i = 0; i < config.goalArray.Length; i++)
     {
         if (config.goalArray[i] is MergeBlackTiles_Goal)
         {
             MergeBlackTiles_Goal goal = config.goalArray[i] as MergeBlackTiles_Goal;
             goal.currentAmount++;
             goal.currentAmount++;
         }
     }
 }
コード例 #3
0
    public bool CheckForBlackTiles(Cell cell)
    {
        Transform column = cell.transform.parent;

        foreach (Transform child in column)
        {
            if (child.GetComponent <Cell>())
            {
                Cell checkCell = child.GetComponent <Cell>();
                if (checkCell.tile)
                {
                    if (checkCell.tile.size == 7)
                    {
                        return(false);
                    }
                }
            }
        }

        for (int i = 0; i < config.goalArray.Length; i++)
        {
            if (config.goalArray[i] is MergeBlackTiles_Goal)
            {
                MergeBlackTiles_Goal goal = config.goalArray[i] as MergeBlackTiles_Goal;
                if (goal.currentAmount < goal.requiredAmount && goal.blackTilesSpawned < goal.requiredAmount)
                {
                    int turnsUsed = RootController.Instance.GameManager().turnsUsed;
                    if (goal.blackTilesSpawned == 0 && turnsUsed >= 1)
                    {
                        return(true);
                    }
                    else if (goal.blackTilesSpawned >= 1 && turnsUsed >= (5 * goal.blackTilesSpawned))
                    {
                        return(true);
                    }
                }
            }
        }

        return(false);
    }