Ejemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     if (m_MainCamera != null)
     {
         Camera[] cams = FindObjectsOfType <Camera>();
         foreach (Camera cam in cams)
         {
             if (cam.tag == "MainCamera")
             {
                 m_MainCamera = FindObjectOfType <Camera>();
             }
             break;
         }
     }
     m_GameManger = FindObjectOfType <ClassicGameManager>();
     m_Skin       = (SkinData)m_GameManger.Skin;
     m_Tiles      = m_Skin.m_BoardTiles;
     if (m_GameManger == null)
     {
         Debug.LogError("No GameManager in Scene");
     }
     else
     {
         m_Board = m_GameManger.m_Board;
         BuildBoard();
         PlaceButtons();
         ScaleBoardToScreen();
     }
 }
Ejemplo n.º 2
0
 void Awake()
 {
     if (!m_GameManager)
     {
         m_GameManager = this;
         // DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
     if (m_Debug != 99)
     {
         GamePrefs.Difficulty = m_Debug;
         GamePrefs.Size       = m_Debug;
     }
     if (GamePrefs.Difficulty != -1)
     {
         m_MineDesity = m_Difficulty[GamePrefs.Difficulty].DifficultyRatio;
     }
     if (GamePrefs.Size != -1)
     {
         m_BoardHieght = m_GameSizes[GamePrefs.Size].Height;
         m_BoardWidth  = m_GameSizes[GamePrefs.Size].Width;
     }
 }
Ejemplo n.º 3
0
 private void Awake()
 {
     GM = this;
 }
Ejemplo n.º 4
0
 private void Start()
 {
     m_Tiles       = m_PlayArea.GetPlayArea();
     m_GameManager = (ClassicGameManager)m_PlayArea.GetGameManager();
     BuildBorders();
 }