39 lines
981 B
C#
39 lines
981 B
C#
using Newtonsoft.Json;
|
|
using UnityEngine;
|
|
|
|
namespace Script.RuntimeScript.model.Data
|
|
{
|
|
public class GridData
|
|
{
|
|
public int PropId = 0;
|
|
public bool IsBorder = false;
|
|
public bool DoubleClick = false;
|
|
public Vector3 LocalPos = Vector3.zero;
|
|
public int ID = 1;
|
|
public int Row = 0;
|
|
public int Col = 0;
|
|
public GridPropData ConfigData;
|
|
|
|
public bool IsOpen { get; set; } = false;
|
|
/// <summary>
|
|
/// 已经点击的个数
|
|
/// </summary>
|
|
public int hasClickCount = 0;
|
|
|
|
public void Init()
|
|
{
|
|
Row = (int)LocalPos.x;
|
|
Col = (int)LocalPos.y;
|
|
}
|
|
|
|
public string ToJson()
|
|
{
|
|
ServerGridData data = new ServerGridData();
|
|
data.Row = Row;
|
|
data.Col = Col;
|
|
data.IsOpen = IsOpen ? 1 : 0;
|
|
data.hasClickCount = hasClickCount;
|
|
return data.ToJson();
|
|
}
|
|
}
|
|
} |