Exemplo n.º 1
0
    // Use Awake as CombatManagers need to take in character in Start
    void Awake()
    {
        myCharacter   = GetComponent <Character>();
        myOpponent    = FindObjectOfType <PlayerScript>().GetComponent <Character>();
        mySkillScript = GetComponent <SkillScript>();
        myPlayerPrefs = FindObjectOfType <PlayerPrefsManager>();

        // TODO Only use for testing

        /*if (myPlayerPrefs != null)
         * {
         *  enemyEncountered = enemyLists[myPlayerPrefs.GetMonsterToBattle()];
         * }
         * else
         * {
         *  enemyEncountered = enemyLists[0];
         * }*/

        enemyEncountered = enemyLists[myPlayerPrefs.GetMonsterToBattle()];

        mySkillScript.SetThisCharacterOpponent(myOpponent);

        GetComponent <SpriteRenderer>().sprite = enemyEncountered.GetEnemySprite();
    }