修改拼图相关参数为property,使其序列化

This commit is contained in:
ruanwujing
2024-02-04 16:28:04 +08:00
parent 231142a692
commit 7a7116f651
2 changed files with 244 additions and 1 deletions

View File

@@ -58,6 +58,7 @@ export class PuzzleSprite extends UIRenderer {
}
}
@property
private _row =1
@property({type:CCInteger, step:1, min:1})
public get row(){return this._row}
@@ -65,6 +66,7 @@ export class PuzzleSprite extends UIRenderer {
this._updateUVs()
}
@property
private _column = 1
@property({type:CCInteger, step:1, min:1})
public get column(){return this._column}
@@ -72,6 +74,7 @@ export class PuzzleSprite extends UIRenderer {
this._updateUVs()
}
@property
private _rowMax = 4
@property({type:CCInteger, step:1, min:1})
public get rowMax(){return this._rowMax}
@@ -79,6 +82,7 @@ export class PuzzleSprite extends UIRenderer {
this._updateUVs()
}
@property
private _columnMax = 4
@property({type:CCInteger, step:1, min:1})
public get columnMax(){return this._columnMax}
@@ -103,7 +107,6 @@ export class PuzzleSprite extends UIRenderer {
}
public onEnable () {
console.log("onEnable")
super.onEnable();
// Force update uv, material define, active material, etc