示例#1
0
    public void goToPlayerShop()
    {
        shop.SetColors();
        int equippedIndex;

        if (inEnemy)
        {
            ExitEnemyAnim();
        }
        else if (inSword)
        {
            ExitSwordAnim();
        }


        Invoke("EnterPlayerAnim", 0.5f);
        moveToPlayerShop = true;
        scrollSnap       = PlayerShopCanvas.transform.GetComponentInChildren <DanielLochner.Assets.SimpleScrollSnap.SimpleScrollSnap>();
        equippedIndex    = shop.updateScrollSnap(scrollSnap);
        shop.updateShopUIReferences(HeroShopAchievementRequirement, HeroShopPurchaseButton,
                                    HeroShopItemName);
        shop.setItemValues();
        if (equippedIndex > -1)
        {
            scrollSnap.GoToPanel(equippedIndex);
        }
    }
示例#2
0
    public void goToShop()
    {
        int equippedIndex;

        ShopCamera.enabled     = true;
        MainMenuCamera.enabled = false;
        EnterPlayerAnim();
        mainMenuCanvas.enabled = false;
        shop.transform.GetChild(0).gameObject.SetActive(true);
        scrollSnap  = PlayerShopCanvas.transform.GetComponentInChildren <DanielLochner.Assets.SimpleScrollSnap.SimpleScrollSnap>();
        exitingShop = false;


        equippedIndex = shop.updateScrollSnap(scrollSnap);
        shop.updateShopUIReferences(HeroShopAchievementRequirement, HeroShopPurchaseButton,
                                    HeroShopItemName);
        shop.setItemValues();
        if (equippedIndex > -1)
        {
            scrollSnap.GoToPanel(equippedIndex);
        }
    }
示例#3
0
    public void goToSwordShop()
    {
        shop.SetColors();

        int equippedIndex;

        moveToSwordShop = true;
        ExitPlayerAnim();
        Invoke("EnterSwordAnim", 0.5f);
        SwordShopCanvas.enabled = true;
        bladeCoreSwitcher.resetScrollSnap();
        bladeCoreSwitcher.setEquippedIndex = true;

        equippedIndex = shop.updateScrollSnap(scrollSnapSword);
        shop.setItemValues();
        if (equippedIndex > -1)
        {
            scrollSnapSword.GoToPanel(equippedIndex);
        }


        shop.updateShopUIReferences(SwordShopAchievementRequirement, SwordShopPurchaseButton,
                                    SwordShopItemName);
    }
 public void switchSelects()
 {
     if (!initialSetupFlag)
     {
         swordSelect.transform.GetChild(0).GetChild(0).transform.gameObject.SetActive(true);
         shop.updateScrollSnap(scrollSnapSwordCore);
         UpdatePreviousPurchases();
         int equippedIndex = shop.updateScrollSnap(scrollSnapSwordCore);
         try
         {
             shop.setItemValues(2);
         }
         catch
         {
             Debug.Log("Broke");
         }
         coreSelect.SetActive(false);
         switchFlag        = true;
         swordIcon.enabled = true;
         coreIcon.enabled  = false;
         initialSetupFlag  = true;
         if (setEquippedIndex && equippedIndex > -1)
         {
             scrollSnapSwordCore.GoToPanel(equippedIndex);
             setEquippedIndex = false;
         }
         else if (equippedIndex < 0)
         {
             Debug.LogError("No item equipped");
         }
     }
     else
     {
         if (switchFlag)
         {
             shop.SetColors();
             shop.updateScrollSnap(scrollSnapSword);
             try
             {
                 shop.setItemValues();
             }
             catch
             {
                 Debug.Log("Broke");
             }
             coreSelect.SetActive(true);
             swordSelect.SetActive(false);
             switchFlag        = false;
             swordIcon.enabled = false;
             coreIcon.enabled  = true;
         }
         else
         {
             shop.SetColors();
             shop.updateScrollSnap(scrollSnapSwordCore);
             UpdatePreviousPurchases();
             int equippedIndex = shop.updateScrollSnap(scrollSnapSwordCore);
             try
             {
                 shop.setItemValues();
             }
             catch
             {
                 Debug.Log("Broke");
             }
             coreSelect.SetActive(false);
             swordSelect.SetActive(true);
             switchFlag        = true;
             swordIcon.enabled = true;
             coreIcon.enabled  = false;
             if (setEquippedIndex && equippedIndex > -1)
             {
                 scrollSnapSwordCore.GoToPanel(equippedIndex);
                 setEquippedIndex = false;
             }
             else if (equippedIndex < 0)
             {
                 Debug.LogError("No item equipped");
             }
         }
     }
 }