Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by rodrigob · Jul 08, 2013 at 08:04 PM · c++interop

Unity integration options

Dear Unity community,

I am a complete newcomer to Unity, considering using it for a project or not, and I have a few questions of interoperability.

  1. Can I call existing C++ code (for desktop deployment) ? I understand that Unity is a Mono/.Net environment, so doing PInvoke should be straighfoward, but the documentation seems to imply that a Pro version is needed.
    Is the Mono environment somehow "blocked" in some of its functionalities ?

  2. Can I create an executable that does not show any window ?
    Think an application that reads a text file and creates a video out of it. The rendering of the video would be done via Unity, but no need to show it in a window.

  3. Can I call Unity code from C++ ?
    Again, being based on mono / .Net it should be not a problem, but being a closed source product, maybe this is not possible. How would that work ?

Thanks for your answers.

Comment
Add comment · Show 5
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 Em3rgency · Jul 08, 2013 at 08:05 PM 0
Share

Unity uses either c# or javascript, whichever you prefer. c++ is not that different from c#, so porting would not be hard. As for your questions, I'll let someone more experiences answer, as frankly, I'm not even sure what it is you're asking at some of these points.

avatar image rodrigob · Jul 08, 2013 at 08:24 PM 0
Share

Porting existing code base to c# is not an option in our scenario. Thanks for the feedback, but if you cannot understand the questions, providing a meaningful answer is difficult indeed.

avatar image Em3rgency · Jul 08, 2013 at 08:28 PM 0
Share

Well regardless of the other points, I'm telling you outright, you can't code in unity with c++. Its either c#, javascript or boo (whatever the hell THAT is).

avatar image rodrigob · Jul 08, 2013 at 08:31 PM 0
Share

Are you refering to point 1 or 3 ? Point 1 is doable, just unclear if from Pro version only or not. Point 3 is not about coding unity functions in C++, but rather calling unity as an engine from C++. Think having C++ that calls "now run the following unity program" (but without creating a new process).

avatar image Em3rgency · Jul 08, 2013 at 08:35 PM 0
Share

Ok, now I understand a bit more what it is you're trying to do. Its quite a few rungs above the usual questions you see on unity answers. You should probably try ant contact unity staff directly, to find out if such things are possible. Particularly point 3.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Graham-Dunnett · Jul 08, 2013 at 08:39 PM

  1. Unity has a feature called "plugins" which allows script code to call into native DLLs.

  2. No.

  3. No.

Comment
Add comment · Show 1 · 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 mhtraylor · Jul 09, 2013 at 08:47 PM 0
Share

I thought I would add something to your answer, namely that the documentation you linked above describes "plugins" as a Pro-only feature, but also goes into detail about your standard PInvoke stuff for using native libraries in managed code. The documentation could be confusing, as there doesn't seem to be any restriction on the latter as opposed to calling a DLL that uses the Unity plugin API.

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

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Interop with mono_add_internal_call 1 Answer

Getting an array of verts and triangles from a Native plugin 1 Answer

Shared memory between c# and c++ 1 Answer

Receiving information from a serial port 7 Answers

How can I catch an Unahndled Null exception in a DLL? 2 Answers


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