screen callbacks

0 votes
asked Feb 2, 2016 by anonymous
Hello! it's posible to execute a function when a screen transition is finished?

I cant find any callback method to do this.

 

Thanks!

1 Answer

0 votes
answered Feb 3, 2016 by admin (31,720 points)
selected Feb 4, 2016 by admin
 
Best answer

Hey there :)
You could either do that via code, or via the inspector!

Using code:

[SerializeField] private ScreenView m_ScreenView;

void OnEnable()
{
	m_ScreenView.onScreenEndTransition.AddListener(screenTransitionEnded);
}

void OnDisable()
{
	m_ScreenView.onScreenEndTransition.RemoveListener(screenTransitionEnded);
}

private void screenTransitionEnded(int screenIndex)
{
	Debug.Log("Screen (" + screenIndex + ") transition ended!");
}

Using the inspector:

Simply select your ScreenView GameObject, and you'll see two UnityEvents at the bottom, OnScreenBeginTransition and OnScreenEndTransition ;)

commented Feb 3, 2016 by anonymous
edited Feb 3, 2016
Hi, thanks for the answer!!

You are doing a great job. I encourage you to continue improving it because is great!!

Thank you!!
commented Feb 3, 2016 by admin (31,720 points)
Thanks a lot ;)
That's the goal, go on improving things weeks after weeks!

PS: Don't forget to select the answer as 'best answer' so people can see the problem is solved ;)

PS2: If you have a few minutes and can rate MaterialUI 5 stars with a nice comment on the Asset Store, it will help a lot!
Welcome to MaterialUI support! Ask us anything :)
...