Search Unity

How to import java program into unity3d??

Discussion in 'Android' started by rasarahul, Feb 4, 2011.

  1. rasarahul

    rasarahul

    Joined:
    Jan 19, 2011
    Posts:
    12
    Hello All,
    I am trying to import my java program into unity,but i am not able to complete it successfully...can anyone help???
     
  2. seon

    seon

    Joined:
    Jan 10, 2007
    Posts:
    1,441
    Unity doesn't support Java. Do you mean JavaScript?

    How can we help if you don't even post some code with the error you are getting? If you want help from the community here, you need to provide as much information as possible.
     
  3. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    I assume he means Plugin development for android.
    If thats the case then the answer is: you can't at least not just like that, java is not supported in any form.
    What you need to do is write a C layer basically that through JNI binds your Java Code (and which has the corresponding DLLImport inside of unity)
     
  4. rasarahul

    rasarahul

    Joined:
    Jan 19, 2011
    Posts:
    12
    Hello dreamora

    I am working on unity for android...What im trying to do is i am loading a 3d object into the scene,when the user taps on a part of the object i should fire an intent and go to other activity...Is there any way to do it
     
  5. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Through plugins yes.
    But otherwise no, as mentioned, you can not execute java code in unity nor can you interact with the whole java side from within Unity itself, you must talk to a native code plugin that binds to the java side through JNI to do this
     
  6. javatlacati

    javatlacati

    Joined:
    Apr 5, 2011
    Posts:
    6