You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.3 KiB
54 lines
1.3 KiB
import AppPlatform from "../../Util/AppPlatform";
|
|
|
|
const { ccclass, property, menu, disallowMultiple } = cc._decorator;
|
|
|
|
/**
|
|
* 首页加载
|
|
*/
|
|
|
|
@ccclass
|
|
@disallowMultiple() //防止多个相同类型(或子类型)的组件被添加到同一个节点
|
|
@menu('FrameWork组件/LoadingView')
|
|
export default class LoadingView extends cc.Component {
|
|
//进度条
|
|
@property({ tooltip: "进度条", type: cc.ProgressBar })
|
|
private progressBar: cc.ProgressBar = null;
|
|
|
|
|
|
@property({ tooltip: "ttlogo", type: cc.Node })
|
|
private ttlogo: cc.Node = null;
|
|
|
|
@property({ tooltip: "wxlogo", type: cc.Node })
|
|
private wxlogo: cc.Node = null;
|
|
|
|
|
|
onLoad() {
|
|
if(AppPlatform.is_WECHAT_GAME_custom()){
|
|
this.ttlogo.active = false;
|
|
this.wxlogo.active = true;
|
|
}
|
|
this.setProcess_custom(0);
|
|
}
|
|
|
|
/**
|
|
* 设置进度条的进度
|
|
* @param process 0-1
|
|
*/
|
|
public setProcess_custom(process: number) {
|
|
if (process < 0) {
|
|
process = 0;
|
|
} else if (process > 1) {
|
|
process = 1;
|
|
}
|
|
this.progressBar.progress = process;
|
|
}
|
|
|
|
|
|
/**
|
|
* 获取 具体的进度
|
|
*/
|
|
public getProcess_custom(): number {
|
|
return this.progressBar.progress
|
|
}
|
|
|
|
}
|
|
|