コード例 #1
0
 private void InitializeChapterIconColors()
 {
     Color[] fColorsList = { playerStats.HexToRGB("#FFFF62") };
     chapterIconColors.Add(fColorsList);
     Color[] sColorsList = { playerStats.HexToRGB("#A564FF"), playerStats.HexToRGB("#8832FF") };
     chapterIconColors.Add(sColorsList);
     Color[] tColorsList = { playerStats.HexToRGB("#FFC886"), playerStats.HexToRGB("#FFB051"), playerStats.HexToRGB("#FFA232") };
     chapterIconColors.Add(tColorsList);
     Color[] foColorsList = { playerStats.HexToRGB("#BBF1FF"), playerStats.HexToRGB("#75E2FF"), playerStats.HexToRGB("#51DAFF"), playerStats.HexToRGB("#2DD2FF") };
     chapterIconColors.Add(foColorsList);
 }
コード例 #2
0
    private void SetActiveBackgroundIndex()
    {
        int numUpgrades = playerStats.upgradesList.Count;

        for (int i = 0; i < numUpgrades; i++)
        {
            PlayerStatistics.Upgrade currUpgrade = playerStats.upgradesList[i];
            if (currUpgrade.IsActive)
            {
                if (currUpgrade.ApplicableOn == ObjectsDescription.Player)
                {
                    currentActiveBackgroundIndex = RetrieveBackgroundIndex(currUpgrade.ParticlesColor, currUpgrade.UpgradeCategory);
                    break;
                }
            }
        }

        GameObject backgroundInstance = gameObject.transform.GetChild(0).gameObject;

        backgroundInstance.GetComponent <MeshRenderer>().material = backgroundMaterials[currentActiveBackgroundIndex].Main;
        Debug.Log(playerStats.HexToRGB("#" + backgroundMaterials[currentActiveBackgroundIndex].hexCode));
        objectsColor.SetColor("_Color", playerStats.HexToRGB("#" + backgroundMaterials[currentActiveBackgroundIndex].hexCode));
        //objectsColor.color = playerStats.HexToRGB(backgroundMaterials[currentActiveBackgroundIndex].hexCode);
    }
コード例 #3
0
    private void UpdateUiData(PlayerStatistics.Upgrade currentUpgrade)
    {
        currentUpgrade = playerStats.upgradesList[selectedUpgradeIndexForPreview];
        if (currentUpgrade.IsUnlocked)
        {
            uiPreviewArea.GetComponent <Image>().color = playerStats.HexToRGB("#30303030");

            unlockButtonsGO.SetActive(true);

            if (currentUpgrade.IsActive)
            {
                if (!currentUpgrade.ColorStuff[currentUpgrade.ParticlesColor.ToString()].IsUnlocked)
                {
                    unlockButtonsGO.SetActive(false);
                    lockButtonsGO.SetActive(true);
                    int coinsRequired = currentUpgrade.ColorStuff[currentUpgrade.ParticlesColor.ToString()].CoinCost;
                    if (coinsRequired > playerStats.playerCoins)
                    {
                        lockButtonsGO.transform.GetChild(0).GetComponent <Image>().color = playerStats.HexToRGB("#FF7B3B78");
                    }
                    else
                    {
                        lockButtonsGO.transform.GetChild(0).GetComponent <Image>().color = playerStats.HexToRGB("#00FFBC78");
                    }
                    moneyCostTMPro.text = coinsRequired.ToString();
                    coinCostTMPro.text  = currentUpgrade.ColorStuff[currentUpgrade.ParticlesColor.ToString()].CoinCost.ToString();
                }
                else
                {
                    lockButtonsGO.SetActive(false);
                    if (currentUpgrade.ColorStuff[currentUpgrade.ParticlesColor.ToString()].IsActive)
                    {
                        unlockButtonTMPro.text = "Selected";
                        unlockButtonsGO.transform.GetChild(0).GetComponent <Image>().color = playerStats.HexToRGB("#FF7B3B78");
                    }
                    else
                    {
                        unlockButtonTMPro.text = "Select Color";
                        unlockButtonsGO.transform.GetChild(0).GetComponent <Image>().color = playerStats.HexToRGB("#00FFBC78");
                    }
                }
                colorSelector.SetActive(true);
                colorSelector.GetComponent <Image>().color = playerStats.colorsData[currentUpgrade.ParticlesColor.ToString()].ThirdColor;
            }
            else
            {
                unlockButtonTMPro.text = "Select Skin";
                unlockButtonsGO.transform.GetChild(0).GetComponent <Image>().color = playerStats.HexToRGB("#00FFBC78");
                lockButtonsGO.SetActive(false);
                colorSelector.SetActive(false);
            }
        }
        else
        {
            uiPreviewArea.GetComponent <Image>().color = playerStats.HexToRGB("#30303082");
            unlockButtonsGO.SetActive(false);
            lockButtonsGO.SetActive(true);
            int coinsRequired = currentUpgrade.CoinCost;
            if (coinsRequired > playerStats.playerCoins)
            {
                lockButtonsGO.transform.GetChild(0).GetComponent <Image>().color = playerStats.HexToRGB("#FF7B3B78");
            }
            else
            {
                lockButtonsGO.transform.GetChild(0).GetComponent <Image>().color = playerStats.HexToRGB("#00FFBC78");
            }

            colorSelector.SetActive(false);
            moneyCostTMPro.text = currentUpgrade.MoneyCost.ToString();
            coinCostTMPro.text  = currentUpgrade.CoinCost.ToString();
        }
    }
コード例 #4
0
 public void UpgradeChosen(int index)
 {
     itemsList[prevIndex].GetComponent <Image>().color = playerStats.HexToRGB("#30303078");
     itemsList[index].GetComponent <Image>().color     = playerStats.HexToRGB("#9A2DB378");
     prevIndex = index;
 }