Ejemplo n.º 1
0
 private void OnDisable()
 {
     GameManager.HumanPlayer.GetComponent <UserInput> ().enabled = true;
     upgradesGraph.gameObject.SetActive(false);
     selectedEPB        = null;
     nameText.text      = "";
     messageText.text   = "";
     purchasedText.text = "";
     if (newEraAnnouncement.gameObject.activeSelf)
     {
         newEraAnnouncement.gameObject.SetActive(false);
     }
     foreach (MainButton mb in GameManager.Hud.mainButtons)
     {
         mb.gameObject.SetActive(true);
     }
 }
Ejemplo n.º 2
0
    private void TotalPercentChangeGraph()
    {
        messageText.text = "Total Percent Change";
        Vector3 costPosition = new Vector3(Screen.width * minAxisAnchors[0], Screen.height * minAxisAnchors[1]);

        Vector3[] rewardPositions = new Vector3[] { costPosition, costPosition };
        switchGraphsButton.transform.localEulerAngles = Vector3.zero;
        float[] costArray = GameManager.evoPanel.selectedEPB.GetCostArray();
        Dictionary <StatsType, float[]> rewardDick = GameManager.evoPanel.selectedEPB.GetRewardDick();

        StatsType[] statsTypesArray       = rewardDick.Keys.ToArray();
        int         secondaryUpgradeCount = 0;

        for (int i = 1; i <= GameManager.evoPanel.selectedEPB.rank && i <= costPoints.Length; i++)
        {
            costPosition = new Vector3(costPosition.x + Screen.width * xScalingFactor, costPosition.y + Screen.height * yScalingFactor * EvolutionPanelButton.RankIncrease(i, costArray[0], costArray[1], costArray[2], costArray[3], costArray[4]), 0f);
            costPoints[i - 1].transform.localPosition = costPosition;
            if (costPosition.y < Screen.height * maxAxisAnchors[1])
            {
                costPoints[i - 1].image.enabled = true;
            }
            for (int j = 0; j < statsTypesArray.Length; j++)
            {
                rewardPositions[j] = new Vector3(rewardPositions[j].x + Screen.width * xScalingFactor, rewardPositions[j].y + Screen.height * yScalingFactor * Mathf.Abs(EvolutionPanelButton.RankIncrease(i, rewardDick[statsTypesArray[j]][0], rewardDick[statsTypesArray[j]][1], rewardDick[statsTypesArray[j]][2], rewardDick[statsTypesArray[j]][3], rewardDick[statsTypesArray[j]][4])), 0f);
                rewardPoints[i + j + secondaryUpgradeCount - 1].transform.localPosition = rewardPositions[j];
                rewardPoints[i + j + secondaryUpgradeCount - 1].image.color             = GetRewardPointColor(j);
                if (rewardPositions[j].y < Screen.height * maxAxisAnchors[1])
                {
                    rewardPoints[i + j + secondaryUpgradeCount - 1].image.enabled = true;
                }
                secondaryUpgradeCount += j;
            }
        }
    }