Ejemplo n.º 1
0
 /// <summary>
 /// Clears the dungeon data model
 /// </summary>
 public override void ResetModel()
 {
     DoorManager = new DoorManager();
     State       = DungeonModelBuildState.Initial;
     Config      = null;
     Cells       = new List <Cell>();
     ToolData    = new DungeonToolData();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets the configuration of the dungeon
 /// </summary>
 /// <returns></returns>
 public DungeonConfig GetDungeonConfig()
 {
     if (dungeonConfig == null)
     {
         dungeonConfig = GetSiblingComponent <DungeonConfig>();
     }
     return(dungeonConfig);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Builds the dungeon layout
        /// </summary>
        /// <param name="config">The builder configuration</param>
        /// <param name="model">The dungeon model that the builder will populate</param>
        public virtual void BuildDungeon(DungeonConfig config, DungeonModel model)
        {
            this.config = config;
            this.model  = model;

            nrandom = new PMRandom(config.Seed);
            random  = new PMRandom(config.Seed);

            isLayoutBuilt = true;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Builds the dungeon layout
        /// </summary>
        /// <param name="config">The builder configuration</param>
        /// <param name="model">The dungeon model that the builder will populate</param>
        public virtual void BuildDungeon(DungeonConfig config, DungeonModel model)
        {
            this.config     = config;
            this.model      = model;
            nrandom         = new PMRandom(config.Seed);
            random          = new PMRandom(config.Seed);
            GridToMeshScale = config.GridCellSize;

            isLayoutBuilt = true;
        }
Ejemplo n.º 5
0
        protected void Initialize()
        {
            config  = GetComponent <DungeonConfig>();
            dungeon = GetComponent <Dungeon>();

            if (itemParent != null && !itemParent.isStatic)
            {
                // The parent should be static for performance reasons, or all child generated items would be considered as non-static (? TODO: confirm)
                Debug.LogWarning("Dungeon Scene Items parent is not marked static (" + itemParent.name + ").  Please mark as static to improve performance");
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Builds the dungeon layout
        /// </summary>
        /// <param name="config">The builder configuration</param>
        /// <param name="model">The dungeon model that the builder will populate</param>
        public virtual void BuildDungeon(DungeonConfig config, DungeonModel model)
        {
            this.config = config;
            this.model  = model;

            nrandom = new PMRandom(config.Seed);
            random  = new PMRandom(config.Seed);

            propSockets = CreateMarkerListObject(config);

            isLayoutBuilt = true;
        }
Ejemplo n.º 7
0
        void Initialize()
        {
            if (config == null)
            {
                config = GetComponent <DungeonConfig> ();
            }

            if (sceneProvider == null)
            {
                sceneProvider = GetComponent <PooledDungeonSceneProvider> ();
            }

            if (dungeonBuilder == null)
            {
                dungeonBuilder = GetComponent <DungeonBuilder> ();
            }

            if (dungeonModel == null)
            {
                dungeonModel = GetComponent <DungeonModel> ();
            }
        }
Ejemplo n.º 8
0
 protected virtual LevelMarkerList CreateMarkerListObject(DungeonConfig config)
 {
     return(new SpatialPartionedLevelMarkerList(8));
 }
Ejemplo n.º 9
0
 protected void Initialize()
 {
     config  = GetComponent <DungeonConfig>();
     dungeon = GetComponent <Dungeon>();
 }