コード例 #1
0
    private void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else
        {
            Destroy(gameObject);
            return;
        }
        Authentification.AfterAuth += () => Social.LoadAchievements((achievments) =>
        {
            pubertyAchieved
                = achievments?.ToList()
                  .Find((a) => a.id == GPGSIds.achievement_may_be_enougth)
                  ?.completed ?? false;
        });

        beatCount     = PlayerPrefs.GetInt("Achievments.BeatCount", 0);
        upgradesCount = PlayerPrefs.GetInt("Achievments.UpgradesCount", 0);


        Heartbeat.OnBeat      += CountBeat;
        GameManager.OnPause   += SaveProgress;
        GameManager.OnEndGame += ReportBeats;
    }
コード例 #2
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(instance);
     }
     else
     {
         Destroy(gameObject);
     }
 }