UserInteractionItem.js 476 B

12345678910111213141516171819202122232425262728293031
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. interactionLabel: cc.Label,
  5. backgroundSprite: cc.Sprite,
  6. },
  7. // LIFE-CYCLE CALLBACKS:
  8. // onLoad () {},
  9. start () {
  10. },
  11. init(interaction) {
  12. this.interaction = interaction;
  13. },
  14. configData(model) {
  15. this.interactionLabel.string = model.content;
  16. },
  17. // update (dt) {},
  18. selectItem() {
  19. this.interaction.selectInteraction();
  20. }
  21. });