Hey there!
So this is what I want to achieve:
I have a Bookmenu for the Quests. And everytime a quest is accepted a Label (the name of the quest) will be added to a Grid. This grid has also a custom script attached and has an ArrayList which adds every new Quest/Label to this list.
So, when I open the Questmenu (clicking on a normal UIButton) ALL these ListItems (the labels) shall:
- set active to true
- play a Tween (fade in)
- stay in their state (meaning, the alpha value should stay at 1.0f)
That's not the "hard" part. So now we're in the Questmenu and see the names (the labels) of the accepted Quests. NOW when we hit ONE of these labels, ALL of them should:
- play a Tween (fade out to 0.0f)
- set active to false
and then the particular QuestPage should be shown.
In order to get this working I attached a BoxCollider to my labels. What I can't manage to find is the way to access the information that any of the label in the list has been clicked.
I already tried something like this after some research:
http://www.tasharen.com/forum/index.php?topic=6987.msg32984#msg32984void Update ()
{
foreach(GameObject q in questList)
{
UIEventListener.Get(q).onClick += Clicked;
}
}
void Clicked()
{
Debug.Log ("Any was clicked");
}
But it just gives me errors.