Ejemplo n.º 1
0
    // Call this when player removes an item, ie. pushes a bottle off the belt
    public void PlayerRemovedItem(GameObject itemGameObject)
    {
        IScoringItem scoringItem = itemGameObject.GetComponent <IScoringItem>();

        if (scoringItem != null)
        {
            var score = scoringItem.GetPlayerRemovalScore();
            ApplyScore(score);

            // Sound plays at the score board
            if (score > 0)
            {
                SoundManager.instance.Play(m_PlayerRemovedCorrectItem, m_GreenBulb.transform.position, 0.9f, 1f);
            }
            else
            {
                SoundManager.instance.Play(m_PlayerRemovedWrongItem, m_RedBulb.transform.position, 0.9f, 1f);
            }
        }
    }
Ejemplo n.º 2
0
    // Call this when player removes an item, ie. pushes a bottle off the belt
    public void ItemReachedEndOfBelt(GameObject itemGameObject)
    {
        IScoringItem scoringItem = itemGameObject.GetComponent <IScoringItem>();

        if (scoringItem != null)
        {
            var score = scoringItem.GetEndOfBeltScore();
            ApplyScore(score);

            // Sound plays at end of belt
            if (score > 0)
            {
                SoundManager.instance.Play(m_CorrectItemReachedEndOfBelt, m_Destroyer.transform.position, 0.9f, 1f);
            }
            else
            {
                SoundManager.instance.Play(m_WrongItemReachedEndOfBelt, m_Destroyer.transform.position, 0.9f, 1f);
            }
        }
    }