Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by amdinis · Dec 22, 2015 at 09:13 AM · c#unity 5visual studio

How can I send data from WPF application to Unity?

I have a WPF application that reads some data from user and I need that data to control the character on Unity. I don't know how to do this. How can I send data from WPF to Unity? Is it even possible? What is the best way to do it? I also thought of another possibility, but I don't know either if it is a good practice or if it is possible to do. The idea was to embed unity game inside WPF. Maybe it would be easier to pass data from one place to another. Let me know your opinions.

P.S.: I'm not fluent in english and therefore it is likely that my question is not entirely noticeable. Sorry about that.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by wibble82 · Dec 22, 2015 at 11:23 AM

Hi amdnis

This is a windows-only solution, but I'm guessing that's fine because WPF is windows only!

Please look into windows 'pipes' for inter-process communication:

https://msdn.microsoft.com/en-us/library/bb546102(v=vs.110).aspx

This is the simplest way to get 2 processes talking to each other in windows.

Alternatively, you could look into using Sockets, to do network communication between the 2 applications. In .net this is also quite easy. This is a good tutorial:

http://www.codeproject.com/Articles/1415/Introduction-to-TCP-client-server-in-C

This might be a good way to go (although you'll probably need to investigate threads to do it asyncronously), as it is platform independent and can work easily over a network.

-Chris

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image amdinis · Dec 28, 2015 at 10:52 AM 0
Share

Hi @wibble82,

First of all, thanks for the answer.

Yes, that's totally fine!

In the meanwhile I try to do it using a X$$anonymous$$L file. On the WPF side I write data to the file and on Unity side I read it. I'm not sure if this is a good solution or not, so I will take a look into your sugestions, thanks :)

avatar image allenallenallen amdinis · Dec 28, 2015 at 10:53 AM 0
Share

Use comments and not answers when you don't have an answer!!! Converted to comment.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Errors Everywhere when updating unity 1 Answer

Player didnt take damage from the Spikes 1 Answer

Scrollview can't scroll with buttons that have Event Triggers 0 Answers

Code in void not executing 0 Answers

CS8025 C# Feature 'local functions' is not available in C# 4. Please use language version 7 or greater. 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges