Preferably in Typescript
For example I have a button which has an event that calls this function:
loadScene(sceneToLoad)
{
console.log("Button clicked"+sceneToLoad);
cc.director.loadScene(sceneToLoad,null);
}
However, how can I populate the ‘sceneToLoad’ string argument. I thought it would be as simple as just adding it to the customData parameter in the button component in the editor…but that didnt work.
1 post - 1 participant