This is a Unity project that demonstrates how to make HTTP requests using the HttpClient
class from .NET. The project includes a Player
class that makes an HTTP request to a specified URL when it collides with a game object with a specific tag.
- Clone the repository to your local machine using
git clone https://github.com/emirariemir/dotNET-HTTP-Request-Unity.git
. - Open the project in Unity.
- Attach the
Player
script to a game object in your scene. - Set the
API_URL
constant in thePlayer
script to the URL you want to send the HTTP request to. - Add a game object to your scene with the tag
call-box
, or change the tag, whatever. - When the
Player
collides with thecall-box
object, an HTTP request will be sent to the specified URL.
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.