Search Unity

Creating a Unity API

Discussion in 'Documentation' started by jmoney18, Nov 16, 2017.

  1. jmoney18

    jmoney18

    Joined:
    Apr 28, 2017
    Posts:
    2
    Hi,
    Is there a way for a person to create a Unity API. I'm working on a project and we need an API for it. Thanks!
     
  2. robnw

    robnw

    Joined:
    Sep 1, 2017
    Posts:
    4
    Are you talking about generating documentation from your comments/signatures/metadata? You would want something like doxygen. If you are talking about creating a sort of extendable mod API, you can look here:
    https://forum.unity.com/threads/making-a-moddable-game.312490/
    https://stackoverflow.com/questions...ly-compile-and-execute-c-sharp-code-fragments

    If you are talking about creating your own shared library for later use/distribution, you can read this guide to get like step-by-step info (creating a DLL, using a DLL): https://docs.unity3d.com/Manual/UsingDLL.html. You can use something like doxygen to expose the logic to users.

    What you are asking sounds a bit broad
     
    TwoBitMachines likes this.
  3. jmoney18

    jmoney18

    Joined:
    Apr 28, 2017
    Posts:
    2
    Thank you for the response and info. I'm actually not entirely sure myself. We basically want to interface our video game software with our hardware, so that, for instance, if you turn around in the game, it sends data to the device and calls a method to turn the device accordingly.We basically want developers to be able to call our methods in order to control the device
     
  4. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,335
    You've got a piece of hardware, and you want to control it with a Unity app?

    First of all, wrong subforums. This is for issues about the documentation, not specific programming issues. The scripting forum is for that.
    Second, you'd do it exactly the same way you do with any other program. Unity runs vanilla C#, so you make a vanilla C# library for controlling your hardware, make sure you compile it with a version that's compatible with Unity.