整理代码格式
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
|
||||
|
||||
|
||||
export class ResourceManager {
|
||||
private static instance: ResourceManager
|
||||
public static getInstance(): ResourceManager {
|
||||
@@ -9,5 +6,4 @@ export class ResourceManager {
|
||||
}
|
||||
return ResourceManager.instance
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,86 +1,85 @@
|
||||
const { regClass, property } = Laya;
|
||||
const { regClass, property } = Laya
|
||||
|
||||
@regClass()
|
||||
export class Script extends Laya.Script {
|
||||
@property(Laya.Label)
|
||||
public title: Laya.Label
|
||||
|
||||
@property(Laya.Label)
|
||||
public title: Laya.Label
|
||||
@property(Laya.Image)
|
||||
public icon: Laya.Image
|
||||
|
||||
@property(Laya.Image)
|
||||
public icon: Laya.Image
|
||||
@property(Laya.Box)
|
||||
public obj_eases: Laya.Box
|
||||
|
||||
@property(Laya.Box)
|
||||
public obj_eases: Laya.Box
|
||||
onAwake(): void {
|
||||
const list: Array<any> = []
|
||||
list.push(Laya.Ease.backIn)
|
||||
list.push(Laya.Ease.backInOut)
|
||||
list.push(Laya.Ease.backOut)
|
||||
|
||||
onAwake(): void {
|
||||
let list = []
|
||||
list.push(Laya.Ease.backIn)
|
||||
list.push(Laya.Ease.backInOut)
|
||||
list.push(Laya.Ease.backOut)
|
||||
list.push(Laya.Ease.bounceIn)
|
||||
list.push(Laya.Ease.bounceInOut)
|
||||
list.push(Laya.Ease.bounceOut)
|
||||
|
||||
list.push(Laya.Ease.bounceIn)
|
||||
list.push(Laya.Ease.bounceInOut)
|
||||
list.push(Laya.Ease.bounceOut)
|
||||
list.push(Laya.Ease.circIn)
|
||||
list.push(Laya.Ease.circInOut)
|
||||
list.push(Laya.Ease.circOut)
|
||||
|
||||
list.push(Laya.Ease.circIn)
|
||||
list.push(Laya.Ease.circInOut)
|
||||
list.push(Laya.Ease.circOut)
|
||||
list.push(Laya.Ease.cubicIn)
|
||||
list.push(Laya.Ease.cubicInOut)
|
||||
list.push(Laya.Ease.cubicOut)
|
||||
|
||||
list.push(Laya.Ease.cubicIn)
|
||||
list.push(Laya.Ease.cubicInOut)
|
||||
list.push(Laya.Ease.cubicOut)
|
||||
list.push(Laya.Ease.elasticIn)
|
||||
list.push(Laya.Ease.elasticInOut)
|
||||
list.push(Laya.Ease.elasticOut)
|
||||
|
||||
list.push(Laya.Ease.elasticIn)
|
||||
list.push(Laya.Ease.elasticInOut)
|
||||
list.push(Laya.Ease.elasticOut)
|
||||
list.push(Laya.Ease.expoIn)
|
||||
list.push(Laya.Ease.expoInOut)
|
||||
list.push(Laya.Ease.expoOut)
|
||||
|
||||
list.push(Laya.Ease.expoIn)
|
||||
list.push(Laya.Ease.expoInOut)
|
||||
list.push(Laya.Ease.expoOut)
|
||||
list.push(Laya.Ease.linearIn)
|
||||
list.push(Laya.Ease.linearInOut)
|
||||
list.push(Laya.Ease.linearNone)
|
||||
list.push(Laya.Ease.linearOut)
|
||||
|
||||
list.push(Laya.Ease.linearIn)
|
||||
list.push(Laya.Ease.linearInOut)
|
||||
list.push(Laya.Ease.linearNone)
|
||||
list.push(Laya.Ease.linearOut)
|
||||
list.push(Laya.Ease.quadIn)
|
||||
list.push(Laya.Ease.quadInOut)
|
||||
list.push(Laya.Ease.quadOut)
|
||||
|
||||
list.push(Laya.Ease.quadIn)
|
||||
list.push(Laya.Ease.quadInOut)
|
||||
list.push(Laya.Ease.quadOut)
|
||||
list.push(Laya.Ease.quartIn)
|
||||
list.push(Laya.Ease.quartInOut)
|
||||
list.push(Laya.Ease.quartOut)
|
||||
|
||||
list.push(Laya.Ease.quartIn)
|
||||
list.push(Laya.Ease.quartInOut)
|
||||
list.push(Laya.Ease.quartOut)
|
||||
list.push(Laya.Ease.quintIn)
|
||||
list.push(Laya.Ease.quintInOut)
|
||||
list.push(Laya.Ease.quintOut)
|
||||
|
||||
list.push(Laya.Ease.quintIn)
|
||||
list.push(Laya.Ease.quintInOut)
|
||||
list.push(Laya.Ease.quintOut)
|
||||
list.push(Laya.Ease.sineIn)
|
||||
list.push(Laya.Ease.sineInOut)
|
||||
list.push(Laya.Ease.sineOut)
|
||||
|
||||
list.push(Laya.Ease.sineIn)
|
||||
list.push(Laya.Ease.sineInOut)
|
||||
list.push(Laya.Ease.sineOut)
|
||||
list.push(Laya.Ease.strongIn)
|
||||
list.push(Laya.Ease.strongInOut)
|
||||
list.push(Laya.Ease.strongOut)
|
||||
console.log("length", list.length)
|
||||
|
||||
list.push(Laya.Ease.strongIn)
|
||||
list.push(Laya.Ease.strongInOut)
|
||||
list.push(Laya.Ease.strongOut)
|
||||
console.log("length", list.length)
|
||||
this.title.text = ""
|
||||
|
||||
this.title.text = ""
|
||||
|
||||
for (let i = 0; i<list.length; i++) {
|
||||
const label = this.obj_eases.getChildAt(i) as Laya.Label
|
||||
label.text = list[i].name
|
||||
label.on(Laya.Event.CLICK, this, (evt: Laya.Event)=>{
|
||||
const label = evt.target as Laya.Label
|
||||
this.title.text = label.text
|
||||
this.icon.x = 400
|
||||
for (let j=0; j<list.length; j++) {
|
||||
const obj = list[j]
|
||||
if (obj.name === label.text) {
|
||||
Laya.Tween.to(this.icon, {x: 1500}, 2000, obj)
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
const label = this.obj_eases.getChildAt(i) as Laya.Label
|
||||
label.text = list[i].name
|
||||
label.on(Laya.Event.CLICK, this, (evt: Laya.Event) => {
|
||||
const label = evt.target as Laya.Label
|
||||
this.title.text = label.text
|
||||
this.icon.x = 400
|
||||
for (let j = 0; j < list.length; j++) {
|
||||
const obj = list[j]
|
||||
if (obj.name === label.text) {
|
||||
Laya.Tween.to(this.icon, { x: 1500 }, 2000, obj)
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,6 @@ export class ScoreAdd extends Laya.Script {
|
||||
}
|
||||
|
||||
onStart(): void {
|
||||
|
||||
Laya.Tween.to(this.label, { scaleX: 1, scaleY: 1 }, 300, Laya.Ease.bounceIn, null, 0)
|
||||
|
||||
Laya.Tween.to(this.label, { y: -102 }, 300, Laya.Ease.linearOut, null, 500)
|
||||
|
||||
@@ -143,12 +143,11 @@ export class Stage extends Laya.Script {
|
||||
this.btn_hint_ad = this.btn_hint.getChildByName("Image").getChildByName("ad") as Laya.Box
|
||||
this.btn_hint_label = this.btn_hint.getChildByName("Image").getChildByName("normal").getChildByName("label") as Laya.Label
|
||||
|
||||
|
||||
//失去舞台焦点(切出游戏)的处理
|
||||
// 失去舞台焦点(切出游戏)的处理
|
||||
Laya.stage.on(Laya.Event.BLUR, this, () => {
|
||||
Stage.EventUpdatePause(true)
|
||||
})
|
||||
//获得舞台焦点(切回游戏)的处理
|
||||
// 获得舞台焦点(切回游戏)的处理
|
||||
Laya.stage.on(Laya.Event.FOCUS, this, () => {
|
||||
Stage.EventUpdatePause(false)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user