Search Unity

[GUI] Simple Question

Discussion in 'Immediate Mode GUI (IMGUI)' started by Mikibey, Mar 7, 2015.

  1. Mikibey

    Mikibey

    Joined:
    Feb 20, 2015
    Posts:
    5
    Hello everyone,so i've made a canvas and then i've added 2 buttons inside of it.
    ButtonRight
    ButtonLeft
    I want to know how can i create a script that uses the touch input from the android.
    For example something like
    if (ButtonRight is touched)
    {
    do stuff
    }
    if {ButtonLeft is touched)
    {
    do stuff
    }

    If you can link me some refrence or something like that it would be great! Thanks again.
    I am using java script.
     
  2. spryx

    spryx

    Joined:
    Jul 23, 2013
    Posts:
    557
    Have you tried running on Android?... The buttons that I create automatically trigger via touch when run on a platform that supports it.

    You can add whatever you want to the OnClick() method...

    http://unity3d.com/learn/tutorials/modules/beginner/ui/ui-button

    Perhaps I am not understanding what you are wanting to do?
     
  3. Mikibey

    Mikibey

    Joined:
    Feb 20, 2015
    Posts:
    5
    Yes the project is for the android platform.
    Hmm i will try to check out your link. Thanks!