Exemple #1
0
        public static void Log(String msg,Level level)
        {
            switch (level) {
                case Level.Debug:
                    Debug.Log(msg);
                    break;
                case Level.Warning:
                    Debug.LogWarning(msg);
                    break;
                case Level.Error:
                    Debug.LogError(msg);
                    break;

            }
        }
Exemple #2
0
		public Level GetLevel(int levelNum)
		{
			if (levelNum < 1 && levelNum >= m_levels.Count)
				throw new Exception ( "Level " + levelNum + " not exists." );

			string fileName = m_levels[levelNum - 1];
			string gameDir = GameManager.Instance.GameDirectory;
			JSONObject jsonObject = TextLoader.GetFileAsJson ( gameDir, fileName );

			var level = new Level ( )
			{
				Number = levelNum
			};

			level.Load ( jsonObject );

			level.Init();

			if (OnLevelChange != null)
				OnLevelChange.Invoke(level);

			return level;
		}