Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Add Event listener on Button Entity

Discussion in 'Project Tiny' started by TheFordeD, Jan 24, 2019.

  1. TheFordeD

    TheFordeD

    Joined:
    Jul 9, 2018
    Posts:
    32
    Hi guys, how add Event listener on click on button Entity (Button Component)?
    And how add listener on ComponentSystem script too?

    Screenshot_6.png
     
  2. vincismurf

    vincismurf

    Joined:
    Feb 28, 2013
    Posts:
    200
    Keep searching the forums specifically posts I have made
     
  3. tomny

    tomny

    Joined:
    Sep 12, 2015
    Posts:
    16
    I just used the CustomButton from TinyArms sample proj. (Component and script)

    and do it like this
    Code (JavaScript):
    1. let shareBtn = this.world.getComponentData(this.world.getEntityByName("ShareButton"), game.CustomButton);
    2. if (shareBtn.JustDown) {
    3.       // do something when clicked
    4. }