void OnTriggerEnter(Collider other) { //if( other.name == "fingerPtr") //Debug.Log ("Object entered the trigger " + other.name); // send a message to cubeManager VectorsScr.setBoxName(other.name); // distroy our selfs when colliding with boxes Destroy(gameObject); }
// Update is called once per frame void Update() { if (HomeSwitch.GetTouching()) { //get the name of the brick boxName = VectorsScr.getBoxName(); // get the name from VectorsScr string[] digit = boxName.Split(','); // split the name of the box by the , int boxIndex; Int32.TryParse(digit[1], out boxIndex); // change the sting to an int //move that brick up to 1.5 if (boxIndex >= 0 && boxIndex <= grid.myField.fieldSize) { touchBrick(boxIndex); } //then move the rest of the bricks around it up to 1 // then move the bricks around the rest of the brick up to .5 } //once were no longer touching the screen cubeMan will take over again with normal movments }