Skip to content

Commit

Permalink
Touch gestures greatly improved.
Browse files Browse the repository at this point in the history
  • Loading branch information
chadpaulson committed Jun 2, 2013
1 parent e0d62b9 commit c728ba9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Assets/BlockManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,12 @@ void Update () {
RaycastHit touchHit;
Ray touchRay = Camera.main.ScreenPointToRay(touch.position);
if(Physics.Raycast(touchRay, out touchHit, Mathf.Infinity)) {
this.touchBlock = touchHit.rigidbody.gameObject;

if(touchHit.rigidbody.gameObject.CompareTag("block")) {
if(isBlockInSide(touchHit.rigidbody.gameObject)) {
this.touchBlock = touchHit.rigidbody.gameObject;
}
}
}
}
if(touch.phase == TouchPhase.Ended && this.touchStart && this.touchBlock == null) {
Expand Down Expand Up @@ -983,7 +988,7 @@ private IEnumerator removeBlocks(List<GameObject> blocks,float start=1f, float e
}


private IEnumerator moveCube(int startSide, int newSide, float rotateTime = 0.121f) {
private IEnumerator moveCube(int startSide, int newSide, float rotateTime = 0.161f) {

this.cubeRotation = true;
this.cubeSide = newSide;
Expand Down

0 comments on commit c728ba9

Please sign in to comment.