Exemple #1
0
        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;
            }
        }
Exemple #2
0
 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);
 }
Exemple #3
0
 private void ResetSwipe()
 {
     _swipeStartPos  = Vector3.zero;
     _onGoingSwipe   = SwipeDirection.None;
     _swipeStartCell = null;
 }
Exemple #4
0
 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);
 }