Esempio n. 1
0
        private GameObject CreateVerticalWallPiece(GameObject piece, bool isNewLeftWall)
        {
            int     x, y;
            Vector3 wallSpawnPosition;

            GetNewPieceSpawnPosition(piece, out x, out y, out wallSpawnPosition);

            GameObject createdWallPiece = Instantiate(ArenaWallPiece,
                                                      wallSpawnPosition,
                                                      ArenaWallPiece.transform.rotation,
                                                      ArenaGrid.transform);

            WallHandler.PlayTriggerAnimation("Spawn");

            WallHandler handler = createdWallPiece.GetComponentInChildren <WallHandler>();

            handler.CoordinateX = x;
            handler.CoordinateY = y;

            handler.WallType  = isNewLeftWall ? Utilities.WallType.Left : Utilities.WallType.Right;
            handler.WallState = Utilities.WallState.Creating;

            return(createdWallPiece);
        }