积分遮挡问题

This commit is contained in:
2025-06-13 16:26:18 +08:00
parent 9d573c0582
commit c487abd4fc
4 changed files with 2763 additions and 166 deletions

View File

@@ -19,6 +19,9 @@ export class Block extends Laya.Script {
@property(Number)
public YGroup: number = 0
@property(Laya.Box)
private obj_pos: Laya.Box
private sprite_show: Laya.Sprite
private blockSize: number
private obj_notes: Laya.Box
@@ -31,11 +34,12 @@ export class Block extends Laya.Script {
private data: DOBlock
public onInit(XIndex: number, YIndex: number, XGroup: number, YGroup: number, handler: any, func: any): void {
public onInit(XIndex: number, YIndex: number, XGroup: number, YGroup: number, obj_pos: Laya.Box, handler: any, func: any): void {
this.XIndex = XIndex
this.YIndex = YIndex
this.XGroup = XGroup
this.YGroup = YGroup
this.obj_pos = obj_pos
this.sprite_show = this.owner.getChildByName("Sprite") as Laya.Sprite
this.blockSize = this.sprite_show.width
@@ -136,7 +140,7 @@ export class Block extends Laya.Script {
if (this.data.get_checked()) {
this.data.set_score(score)
if (score > 0)
G_ShowScoreTips(`+${score}`, this.owner)
G_ShowScoreTips(`+${score}`, this.obj_pos)
} else {
if (this.data.get_score() !== 0)
this.data.set_score(0)