예제 #1
0
        public override void DebugDrawGizmos()
        {
            if (cityConfig == null)
            {
                cityConfig = GetComponent <CircularCityDungeonConfig>();
                if (cityConfig == null)
                {
                    return;
                }
            }

            if (model == null)
            {
                model = GetComponent <CircularCityDungeonModel>();
            }

            if (cityModel == null)
            {
                cityModel = model as CircularCityDungeonModel;
            }

            if (cityModel == null)
            {
                return;
            }

            DebugDrawGraphGizmo(cityModel.roadGraph, Color.green, Color.red);
            DebugDrawGraphGizmo(cityModel.layoutGraph, Color.yellow, Color.blue);
        }
예제 #2
0
        public override void OnDestroyed()
        {
            base.OnDestroyed();

            cityModel = model as CircularCityDungeonModel;
            if (cityModel.roadGraph != null)
            {
                //cityModel.roadGraph.nodes = new RoadGraphNode[0];
            }
        }
예제 #3
0
        /// <summary>
        /// Builds the dungeon layout.  In this method, you should build your dungeon layout and save it in your model file
        /// No markers should be emitted here.   (EmitMarkers function will be called later by the engine to do that)
        /// </summary>
        /// <param name="config">The builder configuration</param>
        /// <param name="model">The dungeon model that the builder will populate</param>
        public override void BuildDungeon(DungeonConfig config, DungeonModel model)
        {
            var sw = System.Diagnostics.Stopwatch.StartNew();

            base.BuildDungeon(config, model);

            random = new System.Random((int)config.Seed);

            // We know that the dungeon prefab would have the appropriate config and models attached to it
            // Cast and save it for future reference
            cityConfig       = config as CircularCityDungeonConfig;
            cityModel        = model as CircularCityDungeonModel;
            cityModel.Config = cityConfig;

            // Generate the city layout and save it in a model.   No markers are emitted here.
            GenerateCityLayout();

            sw.Stop();
            Debug.Log("Time elapsed: " + (sw.ElapsedMilliseconds / 1000.0f) + " s");
        }
예제 #4
0
 void BuildTerrain(CircularCityDungeonModel model)
 {
     //SetupTextures();
     //UpdateTerrainTextures(model);
 }