| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- cc.Class({
- extends: cc.Component,
- properties: {
- grantnfoPrefabs: {
- default: null,
- type: cc.Prefab,
- serializable: true,
- },
- saleInfoPrefabs: {
- default: null,
- type: cc.Prefab,
- serializable: true,
- },
- //当前操作的果实信息
- fruitInfo: {
- default: null,
- serializable: true,
- visible: false
- }
- },
- // LIFE-CYCLE CALLBACKS:
- // onLoad () {},
- start() {
- },
- onGrantInfo() {
- let leasePanel = cc.instantiate(this.grantnfoPrefabs);
- let parent = cc.find('Canvas/UICamera');
- leasePanel.parent = parent;
- leasePanel.setPosition(0, 0);
- // leasePanel.zIndex = 999;
- let LeaseGrantInfoScript = leasePanel.getComponent("LeaseGrantInfo");
- LeaseGrantInfoScript.fruitInfo = this.fruitInfo;
- LeaseGrantInfoScript.upTarget = this.node;
-
- let _contentButton = this.getComponent("Content_Button");
- LeaseGrantInfoScript.setInfo(_contentButton.NameLabel.string, _contentButton.NumLabel.string);
- },
- onSaleInfo() {
- let leasePanel = cc.instantiate(this.saleInfoPrefabs);
- let parent = cc.find('Canvas/UICamera');
- leasePanel.parent = parent;
- leasePanel.setPosition(0, 0);
- // leasePanel.zIndex = 999;
- let leaseSaleInfoScript = leasePanel.getComponent("LeaseSaleInfo");
- leaseSaleInfoScript.fruitInfo = this.fruitInfo;
- leaseSaleInfoScript.upTarget = this.node;
-
- let _contentButton = this.getComponent("Content_Button");
- leaseSaleInfoScript.setInfo(_contentButton.NameLabel.string, _contentButton.NumLabel.string);
- }
- });
|