void Awake()
    {
        UnityEngine.Debug.Log("OCWorldGenerator::Awake!");
        map = GetComponent <OpenCog.Map.OCMap>();

        if (MapName != string.Empty)
        {
            //Debug.Log ("In WorldGenerator, MapName defined");
            OCFileTerrainGenerator fileTerrainGenerator = new OCFileTerrainGenerator(map, MapName);

            fileTerrainGenerator.LoadLevel();
        }
        else
        {
            terrainGenerator = new OCTerrainGenerator(map);

            OCBlock[] woodBlocks   = map.GetBlockSet().GetBlocks("Wood");
            OCBlock[] leavesBlocks = map.GetBlockSet().GetBlocks("Leaves");

            treeGenerator = new OCTreeGenerator[Math.Max(woodBlocks.Length, leavesBlocks.Length)];
            for (int i = 0; i < treeGenerator.Length; i++)
            {
                OCBlock wood   = woodBlocks[i % woodBlocks.Length];
                OCBlock leaves = leavesBlocks[i % leavesBlocks.Length];
                treeGenerator[i] = new OCTreeGenerator(map, wood, leaves);
            }
        }
    }
    void Awake()
    {
        UnityEngine.Debug.Log("OCWorldGenerator::Awake!");
        map = GetComponent <OpenCog.Map.OCMap>();
        //map = OCMap.Instance;

        if (MapName != string.Empty)
        {
            //Debug.Log ("In WorldGenerator, MapName defined");
            OCFileTerrainGenerator fileTerrainGenerator = new OCFileTerrainGenerator(map, MapName);

            fileTerrainGenerator.LoadLevel();
        }
        else
        {
            terrainGenerator = new OCTerrainGenerator(map);

            OCBlock[] woodBlocks   = map.GetBlockSet().GetBlocks("Wood");
            OCBlock[] leavesBlocks = map.GetBlockSet().GetBlocks("Leaves");

            treeGenerator = new OCTreeGenerator[Math.Max(woodBlocks.Length, leavesBlocks.Length)];
            for (int i = 0; i < treeGenerator.Length; i++)
            {
                OCBlock wood   = woodBlocks[i % woodBlocks.Length];
                OCBlock leaves = leavesBlocks[i % leavesBlocks.Length];
                treeGenerator[i] = new OCTreeGenerator(map, wood, leaves);
            }
        }

        TextAsset configFile = (TextAsset)Resources.Load("embodiment");

        if (configFile != null)
        {
            OCConfig.Instance.LoadFromTextAsset(configFile);
        }
        OCConfig.Instance.LoadFromCommandLine();

        string testValue = OCConfig.Instance.get("test");
        string quitValue = OCConfig.Instance.get("quit");

        if (testValue == "internal_XGA")
        {
            Screen.SetResolution(1024, 768, false);
            Console.WriteLine("Level Loaded...");
        }

        if (quitValue == "true")
        {
            Application.Quit();
        }
    }
	void Awake() {
		UnityEngine.Debug.Log ("OCWorldGenerator::Awake!");
		map = GetComponent<OpenCog.Map.OCMap>();
		//map = OCMap.Instance;

		if (MapName != string.Empty)
		{
			//Debug.Log ("In WorldGenerator, MapName defined");
			OCFileTerrainGenerator fileTerrainGenerator = new OCFileTerrainGenerator(map, MapName);
			
			fileTerrainGenerator.LoadLevel();
		}
		else
		{
			terrainGenerator = new OCTerrainGenerator(map);
			
			OCBlock[] woodBlocks = map.GetBlockSet().GetBlocks("Wood");
			OCBlock[] leavesBlocks = map.GetBlockSet().GetBlocks("Leaves");
			
			treeGenerator = new OCTreeGenerator[ Math.Max(woodBlocks.Length, leavesBlocks.Length) ];
			for(int i=0; i<treeGenerator.Length; i++) {
				OCBlock wood = woodBlocks[ i%woodBlocks.Length ];
				OCBlock leaves = leavesBlocks[ i%leavesBlocks.Length ];
				treeGenerator[i] = new OCTreeGenerator(map, wood, leaves);
			}	
		}
		
		TextAsset configFile = (TextAsset)Resources.Load("embodiment");
        if(configFile != null) OCConfig.Instance.LoadFromTextAsset(configFile);
				OCConfig.Instance.LoadFromCommandLine();
		
		string testValue = OCConfig.Instance.get("test");
		string quitValue = OCConfig.Instance.get("quit");
		
		if(testValue == "internal_XGA")
		{
			Screen.SetResolution(1024, 768, false);
			Console.WriteLine("Level Loaded...");
		}
		
		if(quitValue == "true")
		{
			Application.Quit();
		}
	}