Beispiel #1
0
    public static Pokemon ReadPokemonString(string strMon)
    {
        var pokeSave = JsonUtility.FromJson <SavePokemon>(strMon);              //Load SavePokemon
        var baseMon  = PokemonBase.ReadBaseMonString(pokeSave.pokemonBaseName); //Load PokemonBase SO
        var pokemon  = new Pokemon(baseMon, pokeSave.lvl);                      //Build Pokemon

        pokemon.HP = pokeSave.hp;

        return(pokemon);
    }
    void Start()
    {
        LoginFieldText = GetComponent <TMP_InputField>();
        if (LoginFieldText != null)
        {
            //LoginFieldText.text = "Hello";
            LoginFieldText.Select();
        }
        PokemonBase _base = PokemonBase.ReadBaseMonString("Squirtle");

        SaveSystem.startPokemon = new Pokemon(_base, 5);
    }
Beispiel #3
0
    public static Pokemon ReadPokemonLambda(string strMon)
    {
        var pokesave = JsonUtility.FromJson <LamdaPokemon>(strMon);
        var baseMon  = PokemonBase.ReadBaseMonString(pokesave.Pokemon);
        int lvl      = int.Parse(pokesave.Level);
        int hp       = int.Parse(pokesave.Health);
        var pokemon  = new Pokemon(baseMon, lvl);

        pokemon.HP = hp;

        return(pokemon);
    }
    public void StartBattle()
    {
        //Set up player
        playerUnit.Setup();
        playerHud.SetData(playerUnit.Pokemon);
        //Set up opponent
        var baseMon = PokemonBase.ReadBaseMonString(BattleData.pokemonName);

        enemyUnit.Pokemon    = new Pokemon(baseMon, BattleData.Lvl);
        enemyUnit.Pokemon.HP = BattleData.hp;
        enemyUnit.Setup();
        enemyHud.SetData(enemyUnit.Pokemon);

        StartCoroutine(SetupBattle());
    }
    public void PickStarter(string pokeName)
    {
        PokemonBase _base = PokemonBase.ReadBaseMonString(pokeName);

        SaveSystem.startPokemon = new Pokemon(_base, 5);
    }