改了格子大小
This commit is contained in:
@@ -29,9 +29,9 @@ public class GridSelector : MonoBehaviour
|
||||
public int moveNum;
|
||||
|
||||
private ComputeBuffer inputbuffer;
|
||||
private RenderData[] dataArray;
|
||||
public RenderData[] dataArray;
|
||||
|
||||
private List<int> selectedGridIndex = new List<int>();
|
||||
public List<int> selectedGridIndex = new List<int>();
|
||||
private int shiftBeginIndex;
|
||||
|
||||
private List<Vector2> lassoPos = new List<Vector2>();
|
||||
@@ -456,10 +456,11 @@ public class GridSelector : MonoBehaviour
|
||||
for (int i = 0; i < dataArray.Length; i++)
|
||||
{
|
||||
CellType cell = (CellType)dataArray[i].barrier;
|
||||
if (!cell.HasFlag(UICellEditor.Instance.editorGrid))
|
||||
if (cell.HasFlag(CellType.Move))
|
||||
{
|
||||
dataArray[i].barrier |= (int)UICellEditor.Instance.editorGrid;
|
||||
dataArray[i].barrier &= ~(int)CellType.Move;
|
||||
}
|
||||
dataArray[i].barrier |= (int)CellType.Obstacle;
|
||||
}
|
||||
RefreshPlaneRender();
|
||||
}
|
||||
@@ -468,10 +469,11 @@ public class GridSelector : MonoBehaviour
|
||||
for (int i = 0; i < dataArray.Length; i++)
|
||||
{
|
||||
CellType cell = (CellType)dataArray[i].barrier;
|
||||
if (cell.HasFlag(UICellEditor.Instance.editorGrid))
|
||||
if (cell.HasFlag(CellType.Obstacle))
|
||||
{
|
||||
dataArray[i].barrier &= ~(int)UICellEditor.Instance.editorGrid;
|
||||
dataArray[i].barrier &= ~(int)CellType.Obstacle;
|
||||
}
|
||||
dataArray[i].barrier |= (int)CellType.Move;
|
||||
}
|
||||
RefreshPlaneRender();
|
||||
}
|
||||
@@ -490,7 +492,7 @@ public class GridSelector : MonoBehaviour
|
||||
inputbuffer.SetData(dataArray);
|
||||
mapRenderer.material.SetBuffer("_InputData", inputbuffer);
|
||||
}
|
||||
private void GetXyByIndex(int index,out int x,out int y)
|
||||
public void GetXyByIndex(int index,out int x,out int y)
|
||||
{
|
||||
x = index % horizontalNumber;
|
||||
y = index / horizontalNumber;
|
||||
|
||||
Reference in New Issue
Block a user