Пример #1
0
    public void scorePhrase(int choiceLineNum)
    {
        int            rating = 0;
        SpriteRenderer spriteRenderer;
        Sprite         Happy;

        // Check if your date is particularly impressed or offended first
        foreach (string impressee in conversation.getImpresses(choiceLineNum))
        {
            if (impressee == "COWBOY")
            {
                Debug.Log("Your date loved that");
                rating = 10;

                //Change the sprite to be happy
                date.setDateImg("Cowboy", 2);

                break;
            }
        }

        foreach (string offendee in conversation.getOffends(choiceLineNum))
        {
            if (offendee == "COWBOY")
            {
                Debug.Log("Your date hated that");
                rating = -10;

                //Change the sprite to be sad
                date.setDateImg("Cowboy", 0);

                break;
            }
        }

        // If not, add the general rating
        if (rating == 0)
        {
            rating = conversation.getGeneralRating(choiceLineNum);

            //Change the sprite to be neutral
            date.setDateImg("Cowboy", 1);
        }

        // Append this rating to the total score and set it
        score += rating;
        GameObject.Find("Score").GetComponent <Text>().text = score.ToString();
    }