Пример #1
0
        //feed in shape into this scene
        public void HandleTranslateRequest(Shape mCurrentShape, UnityEngine.Vector3 movementVector)
        {
            mWasShapeAddedToScene = false;

                        //bool shapesCollided = DoAnyShapesCollideInScene (mCurrentShape, movementVector); //only do this once
                        if (CheckCollisionWithLeftWall (mCurrentShape, movementVector) ||
                                CheckCollisionWithRightWall (mCurrentShape, movementVector))
                                return; //no action
                        else if (CheckCollisionWithBotWall (mCurrentShape, movementVector) || (DoAnyShapesCollideInScene (mCurrentShape, movementVector) && movementVector.y != 0)) {
                                //mCurrentShape.PlayCollisionAudio ();
                                mWasShapeAddedToScene = true;
                                ++mPlacedShapeCount;
                                mListOfShapes.Add (mCurrentShape);
                                AddCurrentShapeToSceneBitGrid (mCurrentShape, true);
                                mSceneGrid.PrintBitArray (); //debug print
                        } else if (!DoAnyShapesCollideInScene (mCurrentShape, movementVector))
                                mCurrentShape.Translate (movementVector);
        }