I'm working on a basketball game, and I was hoping I could do something like...
The player presses the shoot button, the animation starts... and depending on where in the animation the player releases the button, that would change the accuracy of their shot, etc... I was HOPING that I could use the "float" field in the events to do this, so that if you release during specific moments during a shot, then I could add a value there that would either give a bonus, or a penalty, to their shot % chance.
I have the event setup and everything, so when I test it in Unity, I can trigger things to happen (such as have Debug tell me "You just shot the ball!"), but I can't figure out how to access the int, float, or string information in my event.
Inside Spine, I set those to (4, 5.7 & "Shoot!") just to test them out, but when I try to read them in Unity, they always seem to show up as blank. Am I missing the point of why those fields are there?
I'm basically just calling on:
Debug.Log(e.Data.String + " vs. " + e.Data.Int + " vs. " + e.Data.Float);
...when the event triggers. The only output it gives me though is:
" vs. 0 vs. 0"
Which would suggest that there is no string, and float & int are both empty (0).
Any suggestions? Or if this isn't how you're supposed to use events, could you maybe give me an example of what those fields are for, if you can't read them in Unity?
Oh, wait... nevermind. I figured it out.
I was doing this...
Debug.Log(e.Data.String + " vs. " + e.Data.Int + " vs. " + e.Data.Float);
The solution to my problem was this...
Debug.Log(e.stringValue + " vs. " + e.intValue + " vs. " + e.floatValue);
Keep up the good work! Spine is awesome. I'm sure all of this will come easier once I get more than a day or two of experience with it.