备份CatanBuilding瘦身独立工程
This commit is contained in:
39
Assets/Scripts/SandDig/model/Data/GridData.cs
Normal file
39
Assets/Scripts/SandDig/model/Data/GridData.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user