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