提示当前格子
This commit is contained in:
@@ -220,6 +220,12 @@ export class Stage extends Laya.Script {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onClickHint(evt: Laya.Event): void {
|
onClickHint(evt: Laya.Event): void {
|
||||||
|
if (this.selectedBlock && this.selectedBlock.getData().get_checked() == false) {//当前选中的格子没有完成
|
||||||
|
var correct = this.selectedBlock.getData().get_correct()
|
||||||
|
var candy = this.candys[correct-1]
|
||||||
|
this.onApplyCandy(candy)
|
||||||
|
}
|
||||||
|
else {
|
||||||
var list: Array<Block> = new Array()
|
var list: Array<Block> = new Array()
|
||||||
for (var i=0; i<this.blocks.length; i++) {
|
for (var i=0; i<this.blocks.length; i++) {
|
||||||
var block = this.blocks[i]
|
var block = this.blocks[i]
|
||||||
@@ -238,6 +244,7 @@ export class Stage extends Laya.Script {
|
|||||||
this.onApplyCandy(candy)
|
this.onApplyCandy(candy)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public onApplyCandy(candy: Candy): void {
|
public onApplyCandy(candy: Candy): void {
|
||||||
if (this.selectedBlock && this.selectedBlock.getData().get_checked() == false) {
|
if (this.selectedBlock && this.selectedBlock.getData().get_checked() == false) {
|
||||||
|
|||||||
Reference in New Issue
Block a user