Exemplo n.º 1
0
    void Awake()
    {
        music   = GetComponent <AudioSource>();
        achievs = GetComponent <achievementManager>();
        if (_restore)
        {
            float tver = PlayerPrefs.GetFloat("version", 0);
            if (tver > version)
            {
                Debug.Log("version do save mais nova q o apk");
            }
            if (version > tver)
            {
                Debug.Log("atualizacao d save");
            }
            if (version == tver)
            {
                Debug.Log("mesma versao save");
            }

            string data = PlayerPrefs.GetString("player_data", "");
            if (data == "")
            {
                player = new playerData();
                player.todosAchievments = achievs.inicia();
            }
            else
            {
                player = playerData.restauraDados(data);

                if (player.todosAchievments == null)
                {
                    player.todosAchievments = achievs.inicia();
                }
                else
                {
                    //carregar achievments
                }
            }
        }
        else
        {
            player = new playerData();
            player.todosAchievments = achievs.inicia();
        }
        achievs.todosAchievments = player.todosAchievments;
    }
Exemplo n.º 2
0
 void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
         achievs   = GetComponent <achievementManager>();
         DontDestroyOnLoad(gameObject);
         Screen.SetResolution(1280, 720, true);
         Application.targetFrameRate           = 60;
         Screen.autorotateToLandscapeLeft      = false;
         Screen.autorotateToLandscapeRight     = false;
         Screen.autorotateToPortrait           = true;
         Screen.autorotateToPortraitUpsideDown = true;
         Screen.orientation = ScreenOrientation.AutoRotation;
         jogador            = GetComponent <saveManager>();
     }
     else
     {
         DestroyImmediate(gameObject);
     }
 }
Exemplo n.º 3
0
 void Start()
 {
     achievs = GetComponent <achievementManager>();
     play    = GetComponent <saveManager>().player;
     //play.todosAchievments=achievs.todosAchievments;
 }