private void HandleHit(Vector3 pos) { var ray = Camera.main.ScreenPointToRay(pos); RaycastHit hit; if (Physics.Raycast(ray, out hit, 20f)) { var cell = hit.collider.GetComponent <CellScript>(); _swipeStartPos = Camera.main.ScreenToWorldPoint(new Vector3(pos.x, pos.y, Camera.main.nearClipPlane)); _onGoingSwipe = SwipeDirection.None; _swipeStartCell = cell; } }
private void SetCellPosition(CellScript cell, int column, int row) { cell.transform.name = string.Format("Cell_{0}_{1}", column, row); cell.transform.SetParent(CellContainer.transform); cell.transform.position = new Vector3(column * BGSIZE, -row * BGSIZE, 0f); }
private void ResetSwipe() { _swipeStartPos = Vector3.zero; _onGoingSwipe = SwipeDirection.None; _swipeStartCell = null; }
private void SetupCellData(int column, int row, CellScript cell, Colour bgColour, CubeModel cube, bool lockedHorizontally, bool lockedVertically) { cell.Setup(column, row, bgColour, cube, lockedHorizontally, lockedVertically); }