void TouchCell(Vector3 position) { position = transform.InverseTransformPoint(position); CellCoords coordinates = CellCoords.FromPosition(position); Debug.Log("daddy touched me at " + coordinates.ToString()); }
//Converts touch position to cell coordinates via the CellCoords script void TouchCell(Vector3 position) { position = transform.InverseTransformPoint(position); CellCoords coordinates = CellCoords.FromPosition(position); Debug.Log("contact at " + coordinates.ToString()); int index = coordinates.X + coordinates.Y * width; SquareCellScript cell = cells[index]; cell.color = touchedColor; }
public override void OnGUI( Rect position, SerializedProperty property, GUIContent label ) { CellCoords coordinates = new CellCoords( property.FindPropertyRelative("x").intValue, property.FindPropertyRelative("y").intValue ); position = EditorGUI.PrefixLabel(position, label); GUI.Label(position, coordinates.ToString()); }