|
@@ -4,6 +4,7 @@ import { SkinItem } from './SkinItem';
|
|
import { LayerMgr } from '../../script/Manager/LayerMgr';
|
|
import { LayerMgr } from '../../script/Manager/LayerMgr';
|
|
import { BundleName } from '../../script/Config/EnumCfg';
|
|
import { BundleName } from '../../script/Config/EnumCfg';
|
|
import EventMgr from '../../script/Manager/EventMgr';
|
|
import EventMgr from '../../script/Manager/EventMgr';
|
|
|
|
+import { SkinItem2 } from './SkinItem2';
|
|
const { ccclass, property } = _decorator;
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
|
@ccclass('SelectSkinPanel')
|
|
@ccclass('SelectSkinPanel')
|
|
@@ -16,6 +17,8 @@ export class SelectSkinPanel extends Component {
|
|
spineoffset:Vec2 = new Vec2(0,0);
|
|
spineoffset:Vec2 = new Vec2(0,0);
|
|
@property(Button)
|
|
@property(Button)
|
|
btnClose: Button = null;
|
|
btnClose: Button = null;
|
|
|
|
+ @property(Boolean)
|
|
|
|
+ addListenerShowUsingLabel:boolean = false;
|
|
|
|
|
|
_skinData: SkinData = null
|
|
_skinData: SkinData = null
|
|
_allSkinList:{ [key: number]: string };
|
|
_allSkinList:{ [key: number]: string };
|
|
@@ -24,6 +27,8 @@ export class SelectSkinPanel extends Component {
|
|
|
|
|
|
protected start(): void {
|
|
protected start(): void {
|
|
this.btnClose.node.on(Node.EventType.TOUCH_END,this.onBtnCloseClick,this)
|
|
this.btnClose.node.on(Node.EventType.TOUCH_END,this.onBtnCloseClick,this)
|
|
|
|
+ if(this.addListenerShowUsingLabel)
|
|
|
|
+ EventMgr.ins.addEventListener("showUsingLabel",this.showUsingLabel,this)
|
|
}
|
|
}
|
|
|
|
|
|
init() {
|
|
init() {
|
|
@@ -143,6 +148,19 @@ export class SelectSkinPanel extends Component {
|
|
item.getComponent(SkinItem).setSelectSkin(false)
|
|
item.getComponent(SkinItem).setSelectSkin(false)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ showUsingLabel(para:any[2])
|
|
|
|
+ {
|
|
|
|
+ let item = para[0]
|
|
|
|
+ let isUnlock = para[1]
|
|
|
|
+
|
|
|
|
+ this._items.forEach(element => {
|
|
|
|
+ if(element == item && isUnlock)
|
|
|
|
+ (element.getComponent(SkinItem) as SkinItem2).usingLabel.active = true
|
|
|
|
+ else
|
|
|
|
+ (element.getComponent(SkinItem) as SkinItem2).usingLabel.active = false
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|