I have a script that handles hint pop up boxes and kept alive through scenes using DontDestroyOnLoad().
When the user taps the hint box it is supposed to move through a series of hint pages using currentPage+=1;
This works fine in one scene, but when I call the function from any other scene the mouseUp function is called twice. I can find no duplicate scripts within these other scene and the function is only called once so I am bemused as to what is happening. ANy ideas?
Here is my on mouse up function…
function OnMouseUp()
{
print("MOUSE UP RUN");//Happens Twice!!!!???
//only if the overlay is fully faded IN can we tap it
if(isActive)
{
currentPage+=1;
//if current page exceeds number of pages then fade out
if(currentPage>=startLineNumber+numberOfPages)
{
yield FadeOutHintOverlay();
}
else
{
myTextObject.guiText.text=textLine[currentPage];
}
}
}