Hi guys,
I have some code that plays nicely with unifycommunity.com as long as my code isn’t set to #pragma strict. Here is the code:
` function AddScore(notification: Notification) { score += notification.data; } function AddGems(notification: Notification) { gems += notification.data; } `
If I use #pragma strict, I get this error:
Assets/Game Logic/LevelStatus.js(119,15): BCE0051: Operator '+' cannot be used with a left hand side of type 'int' and a right hand side of type 'Object'.
This is because data is an untyped variable in class Notification in the wiki code link. In order to get around the strict compilation issue, the code that I wrote needs some way to determine data’s datatype. What should I do?
MachCUBED