Option_ prefab members of DaggerfallUnity class

Discuss coding questions, pull requests, and implementation details.
Post Reply
User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Option_ prefab members of DaggerfallUnity class

Post by Hazelnut »

Can someone tell me what the Option_ThingyPrefab members of DaggerfallUnity class are for please?

(hopefully this is not a really dumb question - my best guess is maybe some settings from Unity prefab objects or something)

Code: Select all

        // Prefab options
        public bool Option_ImportLightPrefabs = true;
        public Light Option_CityLightPrefab = null;
        public Light Option_DungeonLightPrefab = null;
        public Light Option_InteriorLightPrefab = null;
        public bool Option_ImportDoorPrefabs = true;
        public DaggerfallActionDoor Option_DungeonDoorPrefab = null;
        public DaggerfallActionDoor Option_InteriorDoorPrefab = null;
        public DaggerfallRMBBlock Option_CityBlockPrefab = null;
        public DaggerfallRDBBlock Option_DungeonBlockPrefab = null;
        public MobilePersonMotor Option_MobileNPCPrefab = null;
        public bool Option_ImportEnemyPrefabs = true;
        public DaggerfallEnemy Option_EnemyPrefab = null;
        public bool Option_ImportRandomTreasure = true;
        public DaggerfallLoot Option_LootContainerPrefab = null;
        public GameObject Option_DungeonWaterPrefab = null;
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Option_ prefab members of DaggerfallUnity class

Post by Interkarma »

They're slots for prefabs that are instantiated at runtime. For example, a basic DFTFU scene might use a basic enemy type while the full game uses a heavier serialisable enemy prefab instead.

Check the DaggerfallUnity gameobject inspector in game scene to see the prefabs currently assigned.

It's a fairly common Unity pattern for setting references to prefabs that spawn later (e.g. missiles, particles, mobiles, etc.)

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Option_ prefab members of DaggerfallUnity class

Post by Hazelnut »

Thanks mate. Amazing how I've managed to contribute a bit while remaining relatively ignorant about Unity isn't it? :D
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Option_ prefab members of DaggerfallUnity class

Post by Interkarma »

Don't worry, I feel the same way. :) I learned more about Unity while tooling up the initial systems. For the last couple of years I've been drenched in quest and magic systems which are about 95% divorced from Unity except for a few places they touch the world. I feel my learning has stalled for a while now.

Post Reply