import { _decorator, Component, Node } from 'cc';
import { RewardIcon } from './RewardIcon';
import { TbGEntity } from '../../../config/data/schema';
import JNScrollViewItem from '../../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollViewItem';
import { tween } from 'cc';
import { v3 } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('RewardIconScrollScaleAnim')
export class RewardIconScrollScaleAnim extends JNScrollViewItem<TbGEntity.TReward> {

    @property(RewardIcon)
    icon:RewardIcon;

    onLoad(){
        //播放缩放动画
        this.node.scale = v3(0,0,0);
        tween(this.node)
            .to(.2,{scale:v3(1,1,1)})
            .start();
    }

    onInit(data:TbGEntity.TReward){

        this.icon.set(data);

    }
}


