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 DaveA · Mar 20, 2011 at 05:53 AM · dllapiexternal

Can Unity API's be called from assemblies?

I'd like to call Unity API's from an external DLL assembly I'll be making. Can this be done? For example, create a GameObject, add Components, etc.?

What would the syntax for getting that going look like? Any online samples or tutorials? (I'm more familiar with old school C++ DLL building, never done this with C#, so any help greatly appreciated).

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
Best Answer

Answer by Mike 3 · Mar 20, 2011 at 06:00 AM

Yeah, it's fairly simple

In monodevelop, you just right click references, click edit references, go to the last tab, then search for the UnityEngine.dll

In visual studio it'll almost be the same i'd bet (See http://msdn.microsoft.com/en-us/library/wkze6zky(VS.80).aspx )

Either way, it's not much like c++ linking, it's a hell of a lot simpler and generally "just works".

After you've done that, you'll have full unity intellisense too, yay!

Comment
Add comment · Show 5 · 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 DaveA · Mar 20, 2011 at 06:38 AM 0
Share

Yay indeed! Thanks again

avatar image DaveA · Mar 21, 2011 at 06:15 AM 0
Share

Just to be clear: Do I create a new 'class library' or 'empty project' or what? Then just add the reference, and start coding same as if it were in Unity? Insert a 'using Unity.Engine' and so forth?

avatar image Mike 3 · Mar 21, 2011 at 06:40 AM 0
Share

Class library and then yup, exactly like unity

avatar image DaveA · Mar 21, 2011 at 06:47 AM 0
Share

Then build, and copy resulting .dll file to? On Windows, $$anonymous$$ac, iOS, Android? I've heard tell of a 'plugins' folder, would that be the same one the Editor uses?

avatar image Mike 3 · Mar 21, 2011 at 07:38 AM 0
Share

Anywhere but the Plugins folder. That folder is for native plugins only really, and you'll end up with duplicated copies added into builds. All you need to do is drop it anywhere (but Plugins) in your assets folder and it'll get added in for use with editor and all platforms

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

No one has followed this question yet.

Related Questions

How to work with Steam API? 1 Answer

Unity TestTools and External DLL conflict? 1 Answer

Creating Scenes Programmatically From A Deployed Build in Unity 1 Answer

External dll: namespace recognized by mono, not by UT 2 Answers

Why can't I build Web Player in Unity while I have no problems with building standalone versions? 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