Esempio n. 1
0
 public void UpdateCollectionGoalsTiles2nd(Tiles2ndLayer tileToCheck)
 {
     if (m_levelGoalCollected != null)
     {
         m_levelGoalCollected.UpdateGoalsTiles2nd(tileToCheck);
     }
 }
Esempio n. 2
0
    public void ScorePoints2ndTiles(Tiles2ndLayer tile)
    {
        if (tile != null)
        {
            if (ScoreManager.Instance != null)
            {
                // score points
                ScoreManager.Instance.AddScore(tile.scoreValue);

                // update the scoreStars in the Level Goal component
                m_levelGoal.UpdateScoreStars(ScoreManager.Instance.CurrentScore);

                if (UIManager.Instance != null && UIManager.Instance.scoreMeter != null)
                {
                    UIManager.Instance.scoreMeter.UpdateScoreMeter(ScoreManager.Instance.CurrentScore,
                                                                   m_levelGoal.scoreStars);
                }
            }

            // play scoring sound clip
            if (SoundManager.Instance != null && tile.clearSound != null)
            {
                SoundManager.Instance.PlayRandom(tile.clearSound, Vector3.zero, SoundManager.Instance.fxVolume);
            }
        }
    }
Esempio n. 3
0
 public void CollectTile2nd(Tiles2ndLayer tile)
 {
     if (tile != null)
     {
         m_tile2nd = prefabToCollect.GetComponent <Tiles2ndLayer>();
         if (m_tile2nd != null && m_tile2nd.tileType == tile.tileType)
         {
             //numberToCollect--;
             numberToCollect = Mathf.Clamp(--numberToCollect, 0, numberToCollect);
         }
     }
 }
    public void UpdateGoalsTiles2nd(Tiles2ndLayer tileToCheck)
    {
        if (tileToCheck != null)
        {
            foreach (CollectionGoal goal in collectionGoals)
            {
                if (goal != null)
                {
                    goal.CollectTile2nd(tileToCheck);
                }
            }

            UpdateUI(tileToCheck.xIndex, tileToCheck.yIndex);
        }
    }