import { _decorator, Component, Node } from 'cc'; import { interact_puzzle_data } from '../../../data/data'; import { receive_res_item } from './receive_res_item'; const { ccclass, property } = _decorator; @ccclass('res_interact_puzzle') export class res_interact_puzzle extends Component { @property(Node) bg:Node = null; @property(Node) puzzle1:Node = null; @property(Node) puzzle2:Node = null; @property(Node) puzzle3:Node = null; @property(Node) puzzle4:Node = null; @property(Node) puzzle5:Node = null; @property(Node) puzzle6:Node = null; private m_data:interact_puzzle_data = null; public initView(data:interact_puzzle_data){ this.m_data = data; this.bg.getComponent(receive_res_item).initView( this.m_data.bg) this.puzzle1.getComponent(receive_res_item).initView( this.m_data.puzzle1) this.puzzle2.getComponent(receive_res_item).initView( this.m_data.puzzle2) this.puzzle3.getComponent(receive_res_item).initView( this.m_data.puzzle3) this.puzzle4.getComponent(receive_res_item).initView( this.m_data.puzzle4) this.puzzle5.getComponent(receive_res_item).initView( this.m_data.puzzle5) this.puzzle6.getComponent(receive_res_item).initView( this.m_data.puzzle6) } }