Beispiel #1
0
		// Use this for initialization
		void Start () {

			//
			int width = 20;
			int height = 20;
			level.RegisterStructurePlacedCallBack (OnStructurePlacedOnSurface);
//			level.RegisterSurfaceChangedCallBack (OnSurfaceTerrainCreated);
			level.CreateEmptyLevel(width, height);
			//surfaceViews = new Views.Surfaces[width * height];

			//Create Dictionary Maps
			surfaceModelViewMap = new Dictionary<Models.Surfaces, Surfaces>();
			structureModelViewMap = new Dictionary<Models.Structures, Structures> ();

			for (int x = 0; x < level.Width; x++) {
				for (int y = 0; y < level.Height; y++) {
					//Get Surface Model
					Models.Surfaces surfaceModel = level.GetSurfaceAt (x, y);
					this.OnSurfaceTerrainCreated (surfaceModel);
				}
			}

			//Tell the level model about any changes to individual surfaces instead of registering with each surface
			level.RegisterSurfaceChangedCallBack (OnSurfaceTerrainChanged);


		}