示例#1
0
    // -----------------------------------------------------------------------//

    void displayTestText()
    {
        PlayerRank       = PlayerPrefs.GetInt("PlayerRank");
        Ability1         = prefs.getAbilityTF("NewAbility1");
        Ability2         = prefs.getAbilityTF("NewAbility2");
        Sparring         = prefs.getAbilityTF("SparringMatch");
        Rank2Upgrades    = PlayerPrefs.GetInt("Rank2Upgrades");
        Rank1Upgrades    = PlayerPrefs.GetInt("Rank1Upgrades");
        PlayerMaxHP      = PlayerPrefs.GetInt("PlayerMaxHP");
        PlayerMaxStamina = PlayerPrefs.GetInt("PlayerMaxStamina");
        PlayerPower      = PlayerPrefs.GetInt("PlayerPower");
        PlayerSpeed      = PlayerPrefs.GetInt("PlayerSpeed");
        PlayerTough      = PlayerPrefs.GetInt("PlayerTough");
        PlayerEXP        = PlayerPrefs.GetInt("PlayerEXP");
        TotalEXP         = PlayerPrefs.GetInt("TotalEXP");

        testingUpdate.GetComponent <Text>().text  = "";
        testingUpdate.GetComponent <Text>().text += PlayerRank + "\n";
        testingUpdate.GetComponent <Text>().text += Sparring + "\n";
        testingUpdate.GetComponent <Text>().text += Ability1 + "\n";
        testingUpdate.GetComponent <Text>().text += Ability2 + "\n";
        testingUpdate.GetComponent <Text>().text += Rank2Upgrades + "\n";
        testingUpdate.GetComponent <Text>().text += Rank1Upgrades + "\n";
        testingUpdate.GetComponent <Text>().text += PlayerMaxHP + "\n";
        testingUpdate.GetComponent <Text>().text += PlayerMaxStamina + "\n";
        testingUpdate.GetComponent <Text>().text += PlayerPower + "\n";
        testingUpdate.GetComponent <Text>().text += PlayerSpeed + "\n";
        testingUpdate.GetComponent <Text>().text += PlayerTough + "\n";
        testingUpdate.GetComponent <Text>().text += PlayerEXP + "\n";
        testingUpdate.GetComponent <Text>().text += TotalEXP + "\n";
    }
    // -----------------------------------------------------------------------//

    // Start is called before the first frame update
    void Start()
    {
        // Set correct values
        SparringR2EXP = 250;
        SparringR1EXP = 500;
        MatchR2EXP    = 3000;
        MatchR1EXP    = 6000;
        MaxEXPR2      = 3000;
        MaxEXPR1      = 6000;

        exitButton.enabled = false;
        exitButton.GetComponent <Image>().enabled = false;

        PlayerRank = PlayerPrefs.GetInt("PlayerRank");
        rankText.GetComponent <Text>().text = "" + PlayerRank;

        Sparring  = prefs.getAbilityTF("SparringMatch");
        PlayerEXP = PlayerPrefs.GetInt("PlayerEXP");
        TotalEXP  = PlayerPrefs.GetInt("TotalEXP");
        MaxedOut  = checkMaxed();


        if (Sparring)
        {
            if (MaxedOut)
            {
                GiveThisMuchEXP = 0;
                expText.GetComponent <Text>().text = "+" + GiveThisMuchEXP + "\n" + PlayerEXP;
            }
            else
            {
                // Do sparing-only code
                SparringMatchSetup();

                // Turn Sparring off in player prefs
                prefs.SavePrefBool("SparringMatch", false);
            }
        }
        else
        {
            // Real Match set-up
            TrueMatchSetup();
        }
    }
示例#3
0
    // -----------------------------------------------------------------------//

    void displayTestText()
    {
        PlayerRank       = PlayerPrefs.GetInt("PlayerRank");
        Ability1         = prefs.getAbilityTF("NewAbility1");
        Ability2         = prefs.getAbilityTF("NewAbility2");
        Sparring         = prefs.getAbilityTF("SparringMatch");
        Rank2Upgrades    = PlayerPrefs.GetInt("Rank2Upgrades");
        Rank1Upgrades    = PlayerPrefs.GetInt("Rank1Upgrades");
        PlayerMaxHP      = PlayerPrefs.GetInt("PlayerMaxHP");
        PlayerMaxStamina = PlayerPrefs.GetInt("PlayerMaxStamina");
        int PWR = PlayerPrefs.GetInt("PlayerPower");
        int SPD = PlayerPrefs.GetInt("PlayerSpeed");
        int TGH = PlayerPrefs.GetInt("PlayerTough");

        PlayerEXP = PlayerPrefs.GetInt("PlayerEXP");
        TotalEXP  = PlayerPrefs.GetInt("TotalEXP");
        int   MaxSP = (int)(PWR * 20);
        int   MaxHP = (int)((TGH * 100) / 2);
        float DMG   = ((float)PWR * 10) / 100;
        float DEF   = ((float)TGH * 10) / 200;
        float EVA   = ((float)SPD * 10) / 300;
        float LCK   = ((float)PWR + TGH + (2 * SPD)) / 200;
        float REC   = (float)SPD / 200;


        testingUpdate.GetComponent <Text>().text  = "\n\n";
        testingUpdate.GetComponent <Text>().text += PlayerRank + "\n";
        testingUpdate.GetComponent <Text>().text += PlayerEXP + "\n";
        testingUpdate.GetComponent <Text>().text += MaxHP + "\n";
        testingUpdate.GetComponent <Text>().text += MaxSP + "\n";
        testingUpdate.GetComponent <Text>().text += PWR + "\n";
        testingUpdate.GetComponent <Text>().text += SPD + "\n";
        testingUpdate.GetComponent <Text>().text += TGH + "\n";

        testingUpdate.GetComponent <Text>().text += "\n\n\n\n\n\n";

        if (!Ability1 && !Ability2)
        {
            testingUpdate.GetComponent <Text>().text += "None\n";
        }
        else
        {
            if (Ability1)
            {
                testingUpdate.GetComponent <Text>().text += "Sunday P.\n";
            }
            if (Ability2)
            {
                testingUpdate.GetComponent <Text>().text += "ButterBee\n";
            }
        }

        /* OLD VERSION:
         *         testingUpdate.GetComponent<Text>().text += PlayerRank + "\n";
         *      testingUpdate.GetComponent<Text>().text += Sparring + "\n";
         *      testingUpdate.GetComponent<Text>().text += Ability1 + "\n";
         *      testingUpdate.GetComponent<Text>().text += Ability2 + "\n";
         *      testingUpdate.GetComponent<Text>().text += Rank2Upgrades + "\n";
         *      testingUpdate.GetComponent<Text>().text += Rank1Upgrades + "\n";
         *      testingUpdate.GetComponent<Text>().text += MaxHP + "\n";
         *      testingUpdate.GetComponent<Text>().text += MaxSP + "\n";
         *      testingUpdate.GetComponent<Text>().text += PWR + "\n";
         *      testingUpdate.GetComponent<Text>().text += SPD + "\n";
         *      testingUpdate.GetComponent<Text>().text += TGH + "\n";
         *      testingUpdate.GetComponent<Text>().text += PlayerEXP + "\n";
         *      testingUpdate.GetComponent<Text>().text += TotalEXP + "\n";
         */
    }