1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- const Api = require('../net/Api');
- cc.Class({
- extends: cc.Component,
- properties: {
- questItem: {
- default: null,
- type: cc.Node,
- },
- questWrap: {
- tooltip: '每日任务容器',
- default: null,
- type: cc.Node
- },
- actGifts: {
- tooltip: '活跃度奖励节点',
- default: [],
- type: [cc.Node]
- },
- actGiftSprite: {
- tooltip: '活跃度奖励素材',
- default: [],
- type: [cc.SpriteFrame]
- },
- actProgress: {
- tooltip: '每日活跃度进度',
- default: null,
- type: cc.Node
- }
- },
- onLoad () {
- },
- init (quest) {
- this.quest = quest
- let initSize = Math.floor(Math.random() * 8) + 4
- for(let i = 0; i < initSize; i++) {
- let item = cc.instantiate(this.questItem)
- this.questWrap.addChild(item)
- item.getComponent('QuestDailyItem').init(i % 3)
- }
- },
- start () {
- }
- });
|