Achievements.UnlockAchievement C# (CSharp) Method

UnlockAchievement() public method

public UnlockAchievement ( string s ) : void
s string
return void
    public void UnlockAchievement(string s)
    {
        if (PlayerPrefs.GetInt(s) == 0) {
            PlayerPrefs.SetInt (s, 1);
            achieved_achievements.Add(s);
            recent_unlocked_achievements.Add(s);
            show_onetime = true;
        }
    }

Usage Example

示例#1
0
    void CheckSOS()
    {
        if (buffer.Count != 9)
        {
            return;
        }

        for (int i = 0; i < 9; i++)
        {
            if (i < 3 || i > 5)
            {
                if (buffer[i] > 0.3f)
                {
                    return;
                }
            }
            else
            {
                if (buffer[i] < 0.3f)
                {
                    return;
                }
            }
        }
        Achievements.UnlockAchievement(Achievements.DISTRESS);
    }
All Usage Examples Of Achievements::UnlockAchievement