OnColorChangeListener returns HexCoordinates, witch has been painted. Removed unnecessary files

This commit is contained in:
dddushesss 2021-12-14 16:15:12 +03:00
parent 740205bc3d
commit fa9398993e
5 changed files with 17 additions and 11 deletions

13
.idea/.idea.S_Jump-and-grub/.idea/.gitignore generated vendored Normal file
View File

@ -0,0 +1,13 @@
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/projectSettingsUpdater.xml
/contentModel.xml
/modules.xml
/.idea.S_Jump-and-grub.iml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -12,9 +12,9 @@ namespace Controller
hexGrid.OnHexPainted += DoSomething; hexGrid.OnHexPainted += DoSomething;
} }
private void DoSomething() private void DoSomething(HexCoordinates coordinates)
{ {
Debug.Log("Painted!" ); Debug.Log("Painted! " + coordinates );
} }
} }
} }

View File

@ -20,7 +20,7 @@ namespace HexFiled
private Canvas _gridCanvas; private Canvas _gridCanvas;
private HexMesh _hexMesh; private HexMesh _hexMesh;
private GameObject _baseGameObject; private GameObject _baseGameObject;
public Action OnHexPainted; public Action<HexCoordinates> OnHexPainted;
public HexGrid(FieldData fieldData) public HexGrid(FieldData fieldData)
{ {
@ -63,7 +63,7 @@ namespace HexFiled
HexCell cell = _cells[index]; HexCell cell = _cells[index];
cell.color = _touchedColor; cell.color = _touchedColor;
_hexMesh.Triangulate(_cells); _hexMesh.Triangulate(_cells);
OnHexPainted.Invoke(); OnHexPainted.Invoke(coordinates);
} }
void CreateCell (int x, int z, int i) { void CreateCell (int x, int z, int i) {
Vector3 position; Vector3 position;

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 198923afa36640e48b1ab9562775b526
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: