22 lines
700 B
C#
22 lines
700 B
C#
// PuzzlePiece.cs
|
|
using UnityEngine;
|
|
|
|
public class PuzzlePiece : MonoBehaviour
|
|
{
|
|
[HideInInspector] public int correctRow; // 正确位置的行
|
|
[HideInInspector] public int correctCol; // 正确位置的列
|
|
[HideInInspector] public int currentRow; // 当前位置的行
|
|
[HideInInspector] public int currentCol; // 当前位置的列
|
|
[HideInInspector] public bool isEmpty; // 是否是空白块
|
|
|
|
private PuzzleManager puzzleManager;
|
|
|
|
public void Initialize(PuzzleManager manager, int row, int col)
|
|
{
|
|
puzzleManager = manager;
|
|
correctRow = row;
|
|
correctCol = col;
|
|
currentRow = row;
|
|
currentCol = col;
|
|
}
|
|
} |