Exemplo n.º 1
0
    private void OnGetInventorySuccess(GetUserInventoryResult result)
    {
        //Debug
        //Debug.Log("PlayFab - GetInventorySuccess");
        DebugText.text += "\nPlayFab - GetInventorySuccess";

        //Set Virtual currecy & Items owned
        CharacterReferences.instance.playerInfo.SetCurrency(result.VirtualCurrency["CO"], result.VirtualCurrency["GE"]);
        CharacterReferences.instance.charactersInfo.CheckCharacters(result.Inventory);


        EnvironmentController ec = EnvironmentController.instance;

        ec.setsList = new List <EnvironmentSet>();

        EnvironmentPrefabController temp = ec.prefabsInstantiated[0];

        ec.prefabsInstantiated = new List <EnvironmentPrefabController>();
        Destroy(temp.gameObject);

        ec.GetEnvironments();
        ec.SetEnvironment();

        ParallaxMainController.instance.SetParallaxNewElements();
        //Debug.Log("PlayFabLogin GET INVENTORY");

        MMA.UpdateTexts(true);

        MMA.ToogleShopWindow();
        ShopController.instance.InstantiateNewCharacter();
        MMA.ToogleShopWindow();

        isPlayFabLogged = true;
    }
        public void GetEnvironments_ShouldWork()
        {
            var context = _contextFake.GetContext("GetEnvironments_ShouldWork")
                          .AddFakeEnvironments();

            var repo = new EnvironmentRepository(context);

            var controller = new EnvironmentController(repo, _mapper);
            var pageFilter = new PageFilter();

            var result = controller.GetEnvironments(pageFilter);

            Assert.IsType <ActionResult <PageViewModel <EnvironmentViewModel> > >(result);
            var actionResult = Assert.IsType <OkObjectResult>(result.Result);

            Assert.IsType <PageViewModel <EnvironmentViewModel> >(actionResult.Value);
        }
Exemplo n.º 3
0
    public void StartNoInternet()
    {
        saveLocalInfo = true;

        EnvironmentController ec = EnvironmentController.instance;

        Destroy(ec.prefabsInstantiated[0].gameObject);
        ec.setsList = new List <EnvironmentSet>();

        ec.GetEnvironments();
        ec.SetEnvironment();

        ParallaxMainController.instance.SetParallaxNewElements();
        //Debug.Log("PlayFabLogin");

        MMA.UpdateTexts(true);

        MMA.ToogleShopWindow();
        ShopController.instance.InstantiateNewCharacter();
        MMA.ToogleShopWindow();

        //NotSave
        noInternet = true;
    }
Exemplo n.º 4
0
    public void ResetLocalData()
    {
        playerName       = "";
        playerLevel      = 1;
        currentMedals    = 0;
        medalsToNextRank = 3;
        medalHolder      = 0;

        metersRecord = 0;
        pointsRecord = 0;

        coins = 0;
        gems  = 0;

        selectedCharacter = 0;

        language = 0;

        challengesIndex    = new int[3];
        challengesProgress = new int[3];

        firstConection = true;
        isLocal        = true;

        totalAttacks             = 0;
        totalChallengesCompleted = 0;
        totalCoinsEarned         = 0;
        totalDeaths        = 0;
        totalEnemiesKilled = 0;
        totalJumps         = 0;
        totalMetersRunned  = 0;
        totalSpecialUsed   = 0;

        CharactersInfo chi = CharacterReferences.instance.charactersInfo;

        int length = chi.characters.Length;

        for (int i = 1; i < length; i++)
        {
            chi.characters[i].unlocked = false;
        }

        EnvironmentController ec = EnvironmentController.instance;

        ec.setsList = new List <EnvironmentSet>();

        EnvironmentPrefabController temp = ec.prefabsInstantiated[0];

        ec.prefabsInstantiated = new List <EnvironmentPrefabController>();
        Destroy(temp.gameObject);

        ec.GetEnvironments();
        ec.SetEnvironment();

        ParallaxMainController.instance.SetParallaxNewElements();
        Debug.Log("CharacterInfo");


        MainMenuAnimator.instance.ToogleShopWindow();
        ShopController.instance.InstantiateNewCharacter();
        MainMenuAnimator.instance.ToogleShopWindow();
    }