Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17118

How do I send Custom Data to a buttons click function?

$
0
0

Preferably in Typescript :slight_smile:

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

Read full topic


Viewing all articles
Browse latest Browse all 17118

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>