Beispiel #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();
 }
Beispiel #2
0
 /// <summary>
 /// Gets the configuration of the dungeon
 /// </summary>
 /// <returns></returns>
 public DungeonConfig GetDungeonConfig()
 {
     if (dungeonConfig == null)
     {
         dungeonConfig = GetSiblingComponent <DungeonConfig>();
     }
     return(dungeonConfig);
 }
Beispiel #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;
        }
Beispiel #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;
        }
Beispiel #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");
            }
        }
Beispiel #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;
        }
Beispiel #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> ();
            }
        }
Beispiel #8
0
 protected virtual LevelMarkerList CreateMarkerListObject(DungeonConfig config)
 {
     return(new SpatialPartionedLevelMarkerList(8));
 }
Beispiel #9
0
 protected void Initialize()
 {
     config  = GetComponent <DungeonConfig>();
     dungeon = GetComponent <Dungeon>();
 }