Author Topic: Adding, and calling ability buttons  (Read 1258 times)

FuzzySmurf

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Adding, and calling ability buttons
« on: January 20, 2014, 01:03:33 PM »
Hello,

I have a few different characters to choose from, and when i select one from the character selection screen, I have 4 abilities i want to load, from a characters ability script, the character will provide.

The buttons should call the characters abilities, and work as toggles. also, load the texture from the script.

I have everything done already for the characterabilities, and know how to call it in a regular GUI Button, and have it working this way. However, I want to call it using NGUI instead.

so

NGUI Button 1 >> character ability 1

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Adding, and calling ability buttons
« Reply #1 on: January 21, 2014, 01:40:05 AM »
UIButton has "On Click" section in inspector you can use to trigger any remote "public void FuncName ()" type function.

Optionally you can add a script to your button that has an OnClick() function inside of it, and do your logic there.