Example #1
0
    void Eat()
    {
        Achieve = new char[Caught.Count];
        GetComponent <CircleCollider2D>().enabled = false;
        EatTime = Time.time;
        HorseFace.SetTrigger("Eat");
        int tempScore = 0, i = 0;

        foreach (GameObject C in Caught)
        {
            Achieve[i++] = (char)(C.GetComponent <Mob>().AchieveType + 49);
            tempScore   += Score[(int)C.GetComponent <Mob>().Type];
        }
        Array.Sort(Achieve);
        string AchieveString = new string(Achieve);

        foreach (AchievementsData.Achievement a in achievementData.List)
        {
            if (a.Code == AchieveString)
            {
                PlayerPrefs.SetInt(AchieveString, 1);
                StartCoroutine(AchieveAchievement(a.Name));
            }
        }
        GameManager.Instance.Score        += tempScore;
        GameManager.Instance.ScoreforDiff += tempScore;
        Count = 0;
        Caught.Clear();
    }
Example #2
0
    void Eat()
    {
        int tempScore = 0;

        HorseFace.SetTrigger("Eat");
        Count = 0;
        foreach (GameObject C in Caught)
        {
            tempScore += Score[(int)C.GetComponent <Mob>().Type];
        }
        Caught.Clear();
        GameManager.Instance.Score += tempScore;
    }