Search Unity

Is it possible to make my C# game cerated with unity 3d work on android

Discussion in '2D' started by yesyesok, Apr 21, 2016.

  1. yesyesok

    yesyesok

    Joined:
    Apr 17, 2016
    Posts:
    13
    Hey, Recently i created a basic 2d game in unity 3d, I wrote my scripts in c# but i i wanted to convert it and make it work on android devices

    is that possible or i need to re-write the whole game again in java?

    MY GAME Is kinda like a clone of flappy bird and i've written it in c# and the input key is space button to make the bird fly. what all should i do to make it work on an android and ios device and change the input key to a touch screen.

    sorry for my bad English and i'm new to unity.
     
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Just change the input from keyboard to touch screen and build for the mobile platforms.
    I may be speaking about something not in my wheel house, but from my understanding script language has not bearing on deployment platform. (artist knowledge - buyer beware)
     
  3. Eroy2

    Eroy2

    Joined:
    Sep 27, 2015
    Posts:
    6
    An easy way for you to do that would just be to create a canvas with an invisible image taking the whole screen, then assign an EventTrigger component to the image's gameobject and connect an OnPointerDown event to your jump function (Beware of multi-touch).
     
    theANMATOR2b likes this.
  4. yesyesok

    yesyesok

    Joined:
    Apr 17, 2016
    Posts:
    13
    L
    Sorry i didn't get you.
     
  5. thtcaribbeanguy

    thtcaribbeanguy

    Joined:
    Jul 4, 2014
    Posts:
    32
    simple solution a big button in canvas no artwork or text and Ipointerup and Ipointerdown

    the harder solution
    touch class
    import
    //please not this is off my head
    foreach ( touch touches in Touch) {
    getcomponent<rigidbody>().addforce

    }
     
    theANMATOR2b likes this.
  6. jc-drile77

    jc-drile77

    Joined:
    Jul 1, 2014
    Posts:
    230
    Just use the mouse input, it works as a single touch, and it is quite easy.