// Use this for initialization void Start() { difficulty = GameObject.Find("Difficulty").GetComponent <DifficultyScript> ().getDifficulty(); GameObject.Find("NormalButton").GetComponent <DifficultyButtonScript> ().setState(Enums.SelectorState.Blocked); GameObject.Find("HardButton").GetComponent <DifficultyButtonScript> ().setState(Enums.SelectorState.Blocked); GameObject.Find("ExpertButton").GetComponent <DifficultyButtonScript> ().setState(Enums.SelectorState.Blocked); GameObject.Find("Back").GetComponent <BackScript> ().setState(Enums.SelectorState.Blocked); Vector3 scale = GameObject.Find("Selector").GetComponent <Transform> ().localScale; scale.x = 0.5F; scale.y = 0.5F; GameObject.Find("Selector").GetComponent <Transform> ().localScale = scale; switch (difficulty) { case 1: //ANDROID GameObject.Find("Main Camera").GetComponent <Camera> ().orthographicSize = 4.7F; GameObject.Find("Hand Camera").GetComponent <Camera> ().orthographicSize = 4.7F; GameObject.Find("Selector").GetComponent <Transform> ().Translate(new Vector3(0, 4f, 0), Space.World); GameObject.Find("Quit").GetComponent <Transform> ().Translate(new Vector3(0, 4f, 0), Space.World); GameObject.Find("Back").GetComponent <Transform> ().Translate(new Vector3(0, 4f, 0), Space.World); break; case 2: GameObject.Find("Main Camera").GetComponent <Camera> ().orthographicSize = 5.4F; GameObject.Find("Hand Camera").GetComponent <Camera> ().orthographicSize = 5.4F; GameObject.Find("Selector").GetComponent <Transform> ().Translate(new Vector3(0, 4f, 0), Space.World); GameObject.Find("Quit").GetComponent <Transform> ().Translate(new Vector3(0, 4f, 0), Space.World); GameObject.Find("Back").GetComponent <Transform> ().Translate(new Vector3(0, 4f, 0), Space.World); break; case 3: GameObject.Find("Main Camera").GetComponent <Camera> ().orthographicSize = 5.4F; GameObject.Find("Hand Camera").GetComponent <Camera> ().orthographicSize = 5.4F; GameObject.Find("Selector").GetComponent <Transform> ().Translate(new Vector3(0, 4.8F, 0), Space.World); GameObject.Find("Quit").GetComponent <Transform> ().Translate(new Vector3(0, 4.8f, 0), Space.World); GameObject.Find("Back").GetComponent <Transform> ().Translate(new Vector3(0, 4.8f, 0), Space.World); break; } // Generating the random map with a given difficulty. mapCreator = new MapCreator(difficulty); // Retrieving the BoardManager. boardManager = GetComponent <BoardManager> (); // Retrieving the hand. hand = GameObject.Find("Hand").GetComponent <HandPrefabScript> (); // Drawing the tiles of the board on the screen. boardManager.run(mapCreator); // Drawing the tiles of the hand on the screen. hand.setHand(mapCreator.getHand(), difficulty); // Setting up the moves storing. moves = new System.Collections.Generic.List <TileScript> (); targetCoord = new System.Collections.Generic.List <Coordinate> (); targetEntr = new System.Collections.Generic.List <int> (); targetPos = new System.Collections.Generic.List <Vector3> (); // Starting the game. startGame(); }
// Use this for initialization void Start () { difficulty = GameObject.Find ("Difficulty").GetComponent<DifficultyScript> ().getDifficulty (); GameObject.Find ("NormalButton").GetComponent<DifficultyButtonScript> ().setState (Enums.SelectorState.Blocked); GameObject.Find ("HardButton").GetComponent<DifficultyButtonScript> ().setState (Enums.SelectorState.Blocked); GameObject.Find ("ExpertButton").GetComponent<DifficultyButtonScript> ().setState (Enums.SelectorState.Blocked); GameObject.Find ("Back").GetComponent<BackScript> ().setState (Enums.SelectorState.Blocked); Vector3 scale = GameObject.Find ("Selector").GetComponent<Transform> ().localScale; scale.x = 0.5F; scale.y = 0.5F; GameObject.Find ("Selector").GetComponent<Transform> ().localScale = scale; switch (difficulty) { case 1: //ANDROID GameObject.Find ("Main Camera").GetComponent<Camera> ().orthographicSize = 4.7F; GameObject.Find ("Hand Camera").GetComponent<Camera> ().orthographicSize = 4.7F; GameObject.Find ("Selector").GetComponent<Transform> ().Translate (new Vector3 (0, 4f, 0), Space.World); GameObject.Find ("Quit").GetComponent<Transform> ().Translate (new Vector3 (0, 4f, 0), Space.World); GameObject.Find ("Back").GetComponent<Transform> ().Translate (new Vector3 (0, 4f, 0), Space.World); break; case 2: GameObject.Find ("Main Camera").GetComponent<Camera> ().orthographicSize = 5.4F; GameObject.Find ("Hand Camera").GetComponent<Camera> ().orthographicSize = 5.4F; GameObject.Find ("Selector").GetComponent<Transform> ().Translate (new Vector3 (0, 4f, 0), Space.World); GameObject.Find ("Quit").GetComponent<Transform> ().Translate (new Vector3 (0, 4f, 0), Space.World); GameObject.Find ("Back").GetComponent<Transform> ().Translate (new Vector3 (0, 4f, 0), Space.World); break; case 3: GameObject.Find ("Main Camera").GetComponent<Camera> ().orthographicSize = 5.4F; GameObject.Find ("Hand Camera").GetComponent<Camera> ().orthographicSize = 5.4F; GameObject.Find ("Selector").GetComponent<Transform> ().Translate (new Vector3 (0, 4.8F, 0), Space.World); GameObject.Find ("Quit").GetComponent<Transform> ().Translate (new Vector3 (0, 4.8f, 0), Space.World); GameObject.Find ("Back").GetComponent<Transform> ().Translate (new Vector3 (0, 4.8f, 0), Space.World); break; } // Generating the random map with a given difficulty. mapCreator = new MapCreator (difficulty); // Retrieving the BoardManager. boardManager = GetComponent<BoardManager> (); // Retrieving the hand. hand = GameObject.Find ("Hand").GetComponent<HandPrefabScript> (); // Drawing the tiles of the board on the screen. boardManager.run (mapCreator); // Drawing the tiles of the hand on the screen. hand.setHand (mapCreator.getHand (), difficulty); // Setting up the moves storing. moves = new System.Collections.Generic.List<TileScript> (); targetCoord = new System.Collections.Generic.List<Coordinate> (); targetEntr = new System.Collections.Generic.List<int> (); targetPos = new System.Collections.Generic.List<Vector3> (); // Starting the game. startGame (); }