Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

When to use plugins? - Confused for different platforms

Discussion in 'Scripting' started by djnewty, Dec 13, 2015.

  1. djnewty

    djnewty

    Joined:
    Apr 7, 2015
    Posts:
    40
    Hi,

    I'm a bit new to c# and unity, so just trying to figure out a few things. Just wondering really when I will need to use plugins for different OS's.

    Is it possible to write the TCP socket and other functions all in C#, and will it work in any platform, without the need for plugins? will it still work on IOS/Android etc without plugins?

    Or will I need to create a plugin for each platform (e.g. IOS, Android etc)?

    How do I know which functionality requires plugins and which doesn't? Is there a definitive list of functionality in unity, that show which functions require the writing of plugins?

    Any help is much appreciated

    :)
     
    Last edited: Dec 13, 2015
  2. djnewty

    djnewty

    Joined:
    Apr 7, 2015
    Posts:
    40
    Any1?
     
  3. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,380
    Anything written in C# will run on any platform.

    With some exceptions, certain platforms don't have access to certain parts of the Mono framework. Note this list:
    http://docs.unity3d.com/410/Documentation/ScriptReference/MonoCompatibility.html

    2.0 subset is usually the best target that gets you full support, if you really want ALL PLACES compatibility with no doubt about it target the more restrictive subsets. For example, I believe iOS has you target 2.0 subset (I've never built iOS apps, so I'm no 100% on that), so if you target that, you should be good to go.


    If you write anything in C++ or any other language that doesn't use the Mono framework, and you then use that as a plugin, you're going to have to compile a version for every platform you target.
     
  4. djnewty

    djnewty

    Joined:
    Apr 7, 2015
    Posts:
    40
    Wow this is hugely useful lordofduct, thankyou. You've saved me hours of scrabbling around. :)