update
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { _decorator, Component, Label, Node, Sprite } from 'cc';
|
||||
import { _decorator, Component, Label, Node, Sprite, UITransform } from 'cc';
|
||||
import {Theme} from "db://assets/Scripts/Main/Config/Config18x";
|
||||
import {GButton} from "db://assets/Scripts/Main/Common/GButton";
|
||||
import {DemoManager} from "db://assets/Scripts/test/DemoManager";
|
||||
import ResManager from "db://assets/Scripts/Main/Manager/ResManager";
|
||||
import Utils from "db://assets/Scripts/Main/Common/Utils";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('ThemeItem')
|
||||
@@ -11,22 +13,32 @@ export class ThemeItem extends Component {
|
||||
@property(Label)
|
||||
titleName:Label;
|
||||
|
||||
@property(Sprite)
|
||||
img:Sprite;
|
||||
|
||||
private id:number;
|
||||
|
||||
private isLocked:boolean;
|
||||
start()
|
||||
{
|
||||
}
|
||||
refresh(themeData:Theme)
|
||||
{
|
||||
this.lockImg.node.active = !themeData.isRelease;
|
||||
this.isLocked = !themeData.isRelease;
|
||||
this.titleName.string = themeData.name;
|
||||
this.id = themeData.themeId;
|
||||
ResManager.I.changeBundleSpriteFrame(this.img,themeData.pic.url,"Chat18x",()=>{
|
||||
let sizeTran = this.img.node.parent.getComponent(UITransform);
|
||||
Utils.adjustBgPixelRatioToSize(sizeTran.contentSize,this.img.node,2);
|
||||
});
|
||||
GButton.RemoveAndBandClick(this.node,this.OnClickThis,this);
|
||||
|
||||
}
|
||||
|
||||
OnClickThis()
|
||||
{
|
||||
if(this.isLocked){ return;}
|
||||
DemoManager.getInstance().EnterGirlList(this.id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user