public void StartGame() { gameState = GameState.Started; gameOverCanvas.SetActive(false); IGame game; for (int n = 0; n < iGameObjects.Length; n++) { foreach (Component comp in iGameObjects[n].GetComponents(typeof(IGame))) { game = comp as IGame; game.StartGame(); } } // Set borders: Vector3 lScale = ScreenScale.Scale(Camera.main, leftBorder); Vector3 rScale = ScreenScale.Scale(Camera.main, rightBorder); Vector3 tScale = ScreenScale.Scale(Camera.main, topBorder); Vector3 bScale = ScreenScale.Scale(Camera.main, bottomBorder); Vector3 backgroundScale = ScreenScale.Scale(Camera.main, background); leftBorder.transform.localScale = new Vector3(bScale.x, lScale.y); leftBorder.transform.position = PositionToScreen.Position(Camera.main, new Vector3(0.0f, 0.0f, 0.0f)); rightBorder.transform.localScale = new Vector3(tScale.x, rScale.y); rightBorder.transform.position = PositionToScreen.Position(Camera.main, new Vector3(1.0f, 1.0f, 0.0f)); topBorder.transform.localScale = new Vector3(tScale.x, rScale.y); topBorder.transform.position = PositionToScreen.Position(Camera.main, new Vector3(0.0f, 1.0f, 0.0f)); bottomBorder.transform.localScale = new Vector3(bScale.x, lScale.y); bottomBorder.transform.position = PositionToScreen.Position(Camera.main, new Vector3(0.0f, 0.0f, 0.0f)); background.transform.localScale = new Vector3(backgroundScale.x, backgroundScale.y); background.transform.position = PositionToScreen.Position(Camera.main, new Vector3(0.5f, 0.5f, 0.0f)); // Set ads: // Set Google Play Score: }
void Start() { Vector3 lScale = ScreenScale.Scale(Camera.main, l); Vector3 rScale = ScreenScale.Scale(Camera.main, r); Vector3 tScale = ScreenScale.Scale(Camera.main, t); Vector3 bScale = ScreenScale.Scale(Camera.main, b); l.transform.localScale = new Vector3(bScale.x, lScale.y); l.transform.position = PositionToScreen.Position(Camera.main, new Vector3(0.0f, 0.0f, 0.0f)); r.transform.localScale = new Vector3(tScale.x, rScale.y); r.transform.position = PositionToScreen.Position(Camera.main, new Vector3(1.0f, 1.0f, 0.0f)); t.transform.localScale = new Vector3(tScale.x, rScale.y); t.transform.position = PositionToScreen.Position(Camera.main, new Vector3(0.0f, 1.0f, 0.0f)); b.transform.localScale = new Vector3(bScale.x, lScale.y); b.transform.position = PositionToScreen.Position(Camera.main, new Vector3(0.0f, 0.0f, 0.0f)); }