Example #1
0
    public void Init(int StageNumber, List <Skill> unlockedSkills, List <Skill> AllSkills, MainCharacterController MainControl, int upgrades)
    {
        maincont = MainControl;
        GlobalVariables.Instance.HasUI = true;
        if (StageNumber <= XMLLoad.Instance.stageList.stage.Count)
        {
            StageCompleteText.text = "Stage " + StageNumber + " Completed";
        }
        else
        {
            StageCompleteText.text = "Endless Stage " + (StageNumber - XMLLoad.Instance.stageList.stage.Count) + " Complete";
        }

        SkillsUnlocked = new List <Skill>();
        SkillsUnlocked = unlockedSkills;

        if (unlockedSkills.Count < 1)
        {
            SkillUnlocked.SetActive(false);
        }
        else
        {
            SkillUnlockLeftButton.SetActive(false);
            SkillUnlockRightButton.SetActive(false);
            SkillUnlocked.SetActive(true);
            DisplaySkill(unlockedSkills[0]);
            if (unlockedSkills.Count > 1)
            {
                SkillUnlockedText.text = SkillsUnlocked.Count + " New Skills Unlocked!";
                SkillUnlockRightButton.SetActive(true);
            }
            else
            {
                SkillUnlockedText.text = "New Skill Unlocked!";
            }
        }

        NewMaxHealth.text = "Max Health: " + (100 + 10 * (StageNumber));
        NewStamRegen.text = (10 + 1 * (StageNumber)) + " Stamina/Second";

        UpgradesAvailable.text = "Upgrades Avaialble: " + upgrades;

        if (StageNumber == 1)
        {
            SkillSwapButton.gameObject.SetActive(false);
        }
        else
        {
            SkillSwapButton.gameObject.SetActive(true);
        }
        SkillSwapOverlay.Init(maincont, maincont.GetSlottedSkills(), AllSkills);

        CurrentSkillIndex = 0;
    }
Example #2
0
    /// <summary>
    /// shows the upgrade screen overlay
    /// </summary>
    public void ShowUpgradeScreen()
    {
        MainCharacterController cont = PlayerInstance.GetComponent <MainCharacterController>();

        if (!UpgradeScreenInstance)
        {
            UpgradeScreenInstance = Instantiate(UpgradeScreenPrefab, CameraUI.transform);
        }
        else
        {
            UpgradeScreenInstance.SetActive(true);
        }
        UpgradeScreenInstance.GetComponent <UpgradeController>().Init(cont.GetSkillsWithUpgrades(), cont.GetSlottedSkills(), upgradesLeft, this);
    }
Example #3
0
 void SwapSkill(Skill newSkill, int index)
 {
     //Debug.Log("swap");
     maincont.SlotSkill(newSkill, index, true);
     Init(maincont, maincont.GetSlottedSkills(), allSkills);
 }