-
-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use RestClient on Editor without running the game #121
Comments
Hello Rafarel, Thanks for using this Unity asset, let me know! 👍 |
It looks like the main reason you need the game running is to be able to access a coroutine. |
Ohh interesting, let me check! 👍 |
I'm trying to do this as well to download images from airtable for an AR experience. Import them into the assets and generate prefab variants and upload them to Unity Cloud Delivery. Anyway, I haven't gotten it to work yet, but there is a promising answer at the end here: https://answers.unity.com/questions/1403050/use-coroutine-in-batchmode.html |
Unity has editorCoroutines now. You can use these with unitywebrequests and I've been successful in doing so for downloading Pokemon TCG data from a rest api. I am not sure how to make Rest use the EditorCoRoutine though... |
Hello mate, can you share your example using UnityWebRequest system directly? Thanks for your collaboration! |
I've been fumbling around learning how to use networking stuff for the first time, It's been pretty educational struggling up until now lol. I just now need to figure out how to use RestClient with editorcoroutines and I'd be golden I was originally just ignorantly using RestClient in an editorwindow without realizing the difference between EditorWindows and Monos... So my editor window was generating tons of static coroutines |
EDIT!!!! ALMOST FORGOT A PART OF CODE::
So this is how I started using webrequest directly instead of RestClient package... problem is, restclient takes your paramaters and headers in the RequestHelper but I am not sure yet how to send that information to the UnityRequest system or to just make RestClient operate with EditorCoroutines... text that is assigned to above, is then assigned to a text field in the ongui method |
With RestClient I'm able to instantiate a RequestHelper that internally parameterizes my url+params...
I am not sure how to provide this information to the WebRequestSystem directly. So using EditorCoroutines + RestClient would be ideal... |
Here is an image of my editor window, the text field at the bottom left is text as seen in code above, an image prints the the right of it representing the card front. When I was using RestClient, I could plug each of these fields into the RequestHelper object and that would handle concatenating it properly. |
I think we can add a new option from
Let me know, it works in my mind 😄 |
For sure. Let me try out the things you kindly suggested and let you know. -Josh |
I had to adjust your closing parens and brackets at the end but it worked like a charm. Super quick response too! my code snippet now:
|
Thanks for the help btw, here is a progress demo of editor coroutine being used in the way we discussed above. |
@TelloVisionGames wow that's really impressive, thanks for sharing mate and happy new year! 🎉 |
Hello folks, hope you're doing well Please let me know what you think about this PR: #201 I'm not sure if we need to add that new dependency from Thanks for your collaboration! |
Bump |
First of all, thank you for your amazing work on the Rest Client for Unity !
I'm using it in my game to send all the players replay data to my Rest API and it works like a charm !
Today I'm making a Unity Editor Window to browse all data on my Rest API and launch a replay from any data retrieved by the API.
I'm wondering how I could get your Client working in an Editor script without the game running ?
Thanks for your help, have a nice day !
The text was updated successfully, but these errors were encountered: