示例#1
0
    public void SaveGameOnline()
    {
        if (player != null)
        {
            //Build Url
            var    pokeSave = Pokemon.CreatePokemonLambda(PlayerController.pokemon);
            string uri      = "https://d8nwq2rco8.execute-api.us-east-2.amazonaws.com/default/savePlayerData/"
                              + "?Player=" + SaveSystem.currentPlayer
                              + "&Pokemon=" + pokeSave.Pokemon
                              + "&Health=" + pokeSave.Health
                              + "&Level=" + pokeSave.Level;
            UnityWebRequest quest = UnityWebRequest.Get(uri);
            if (!getting)
            {
                getting = true;//enforce only one GET running
                StartCoroutine(SendSave(quest));
            }

            SaveSystem.SavePlayer(player);
            //Debug.Log("Player Saved " + PlayerController.pokemon.Base.name);
        }
        else
        {
            Debug.LogError("PlayerController not Assigned");
        }
    }