void InitializationEnvironment() { _modelService = InjectionRepository.Instance.Get<IModelService>(); _backdropImage = Resources.Load("Image/LevelBackground/0") as Texture2D; var layoutContract = _modelService.GetProperLayout(Screen.width, Screen.height, 100); var sliceContract = _modelService.GetSlice(_backdropImage, layoutContract, SlicePattern.Default); var pieceContracts = _modelService.GeneratePieceContracts(sliceContract); _rows = layoutContract.Rows; _columns = layoutContract.Columns; _visionWidth = GlobalConfiguration.PictureHeightInMeter * Screen.width / Screen.height; _pieceWidth = _visionWidth / _columns; _flightHeight = _pieceWidth; _circleDistance = Mathf.PI * _flightHeight / 2; _backdropPieceViewModels = new BackdropPieceViewModel[layoutContract.Rows, layoutContract.Columns]; _backdropNormalMap = _modelService.GenerateNormalMap(sliceContract); _straightSpeed = GlobalConfiguration.PictureHeightInMeter; _corneringSpeed = _straightSpeed * 0.2f; _rotationSpeed = 45 / _pieceWidth; for (var i = 0; i < _rows; i++) { for (var j = 0; j < _columns; j++) { var pieceContract = pieceContracts[i, j]; _backdropPieceViewModels[i, j] = new BackdropPieceViewModel { Position = pieceContract.Position, MappingMesh = pieceContract.MappingMesh, BackseatMesh = pieceContract.BackseatMesh, Distance = _circleDistance + 4f * (_visionWidth - 2 * (pieceContract.Position.x + _pieceWidth * (UnityEngine.Random.value - 1))) }; } } }