public IEnumerator Start() { this.preview = new BlocGrid(6, 4); GameObject rendererObject = Instantiate(this.rendererPrefab) as GameObject; rendererObject.transform.parent = this.transform; rendererObject.transform.localPosition = Vector3.zero; this.previewRenderer = rendererObject.GetComponent<BlocGridRenderer>(); this.previewRenderer.OverrideBlocSpriteDescription(new BlocSpriteDescription(BlocSpriteDescription.BlocColor.Black, this.backgroundTexture)); this.previewRenderer.Initialize(this.preview, Vector2.zero); while (Application.Instance == null || Application.Instance.Game == null) { yield return null; } Application.Instance.Game.CurrentTetrominoChange += this.Game_CurrentTetrominoChange; }
private void Start() { #if UNITY_ANDROID Screen.fullScreen = true; #endif Instance = this; this.Game = new Game(10, 22); // View. GameObject rendererObject = Instantiate(this.rendererPrefab) as GameObject; this.blocGridRenderer = rendererObject.GetComponent<BlocGridRenderer>(); this.blocGridRenderer.Initialize(this.Game, Vector2.zero); this.PostScreenChange(ApplicationScreen.Game); }