Unity Code C # encapsulated as DLL

Source: Internet
Author: User

1 Visual Studio Software opens after you create a project

2 and select the class library type

3 Write a simple code to see the effect (the discovery will be error), mainly do not add class library, and using Unityengine; reference space

4 adding class libraries, referencing spaces

The discovery will still error, this needs to add the application library Unityengine.dll, the method is as follows

Find the UnityEngine.dll installed in the Unity directory, and you'll find that the red place disappears when you add it.

5 Right-click Solution, Build Solution

Prior to this you need to select the running. Framwork version, which needs to be consistent with unity's usage version, Mine is under. framwork3.5

6. At this point you can find the DLL file in the project and join the Unity

Calling a DLL in code requires a using-namespace

Caveats: Methods in C # functions encapsulated as DLLs must use static public methods

This is what I do. Link: https://pan.baidu.com/s/1i3LBHrkQOg7eCh9Sf-EQVw Password: AQVP

What's the good way, great God, a lot of messages

Unity Code C # encapsulated as DLL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.