filmov
tv
UDataAsset - Data Assets in Unreal C++ - Data Instances and Data Classes - UE C++ Tutorial

Показать описание
This video covers the information you need to know about data assets from a c++ perspective.
The C++ capabilities, and how blueprints interact with code data assets.
I think of things in terms of data instances and data (sub)classes.
When you subclass UDataAsset, you're creating a new type of data class.
Your new subclass can be used to create data instances, where designers will populate the variables on your data class.
Data instances are atomic units of data, and do not support inheritance.
No data inheritance on data instances is actually a feature.
In my opinion, the lack of data inheritance makes these data assets easily to maintain.
You cannot have your data asset corrupted, because something changed in the parent.
If you need to modify multiple asset values, the property matrix editor is a good solution.
Select all the assets that need data updating (hint, you can go to root of content broswer and search to find multiple folders to select all at once)
Right click on one, go to asset actions, and then "edit selection in property matrix"
And now you can update multiple assets at the same time.
When refactoring, you can change a data instance's type to upgrade it.
You can right click a data instance in the content browser, and an option to convert the data asset type will be available.
Note that this does not cover primary data assets, which I plan to cover later.
Primary data assets are an extension of UDataAsset, and I think you should understand all the content in this video before moving on to Primary Data Assets.
0:00 Video Preview Summary (Quick Reference)
2:23 Video Start
2:28 DataAsset: Subclassing UDataAsset in code to make a data class
2:47 DataAsset: Setting up a data property
3:43 Spawner: Making a spawner actor that uses the data asset
4:05 Spawner: data asset instance reference
5:10 Spawner: Overlap spawning logic
6:41 DataAsset: Data asset instances are singletons
7:02 CPP: including files for data assets
8:05 Visual Actor: making the visual sphere actors in editor (actors to spawn via spawners)
8:36 DataAsset: Making the data asset instances in editor
9:10 Spawner: Making the spawner in editor
9:47 Level: Placing spawners in the level
9:53 Testing spawning: using the spawners
10:05 Pointer Addresses: Evidence data asset instances are shared memory
11:06 Constness: Prefer const data asset pointers
11:20 Level: Mores spawners with different data! Specified by level instances!
11:54 Data Instance vs Data Class (ie Data Subclass)
12:29 Making a Data Class in blueprint instead of code (code must opt-in to allowing this)
14:14 Making a data instance from a blueprint data class
14:50 Data Asset Casting: Making a specialized spawner that uses the blueprint extended data class
15:42 Level: Testing the customized blueprint spawners
17:00 Code Data Subclasses: Code subclassing of data assets to make new data classes.
17:27 Refactoring: changing data asset types (convert data asset)
17:40 Testing code data subclass
18:07 Data inheritance is not allowed for data instances. Data instances are explicitly specified atomic units units of data.
18:51 Bonus Tip: Efficiently modifying multiple assets (property matrix view)
20:10 Closing Summary
20:54 Outro
The C++ capabilities, and how blueprints interact with code data assets.
I think of things in terms of data instances and data (sub)classes.
When you subclass UDataAsset, you're creating a new type of data class.
Your new subclass can be used to create data instances, where designers will populate the variables on your data class.
Data instances are atomic units of data, and do not support inheritance.
No data inheritance on data instances is actually a feature.
In my opinion, the lack of data inheritance makes these data assets easily to maintain.
You cannot have your data asset corrupted, because something changed in the parent.
If you need to modify multiple asset values, the property matrix editor is a good solution.
Select all the assets that need data updating (hint, you can go to root of content broswer and search to find multiple folders to select all at once)
Right click on one, go to asset actions, and then "edit selection in property matrix"
And now you can update multiple assets at the same time.
When refactoring, you can change a data instance's type to upgrade it.
You can right click a data instance in the content browser, and an option to convert the data asset type will be available.
Note that this does not cover primary data assets, which I plan to cover later.
Primary data assets are an extension of UDataAsset, and I think you should understand all the content in this video before moving on to Primary Data Assets.
0:00 Video Preview Summary (Quick Reference)
2:23 Video Start
2:28 DataAsset: Subclassing UDataAsset in code to make a data class
2:47 DataAsset: Setting up a data property
3:43 Spawner: Making a spawner actor that uses the data asset
4:05 Spawner: data asset instance reference
5:10 Spawner: Overlap spawning logic
6:41 DataAsset: Data asset instances are singletons
7:02 CPP: including files for data assets
8:05 Visual Actor: making the visual sphere actors in editor (actors to spawn via spawners)
8:36 DataAsset: Making the data asset instances in editor
9:10 Spawner: Making the spawner in editor
9:47 Level: Placing spawners in the level
9:53 Testing spawning: using the spawners
10:05 Pointer Addresses: Evidence data asset instances are shared memory
11:06 Constness: Prefer const data asset pointers
11:20 Level: Mores spawners with different data! Specified by level instances!
11:54 Data Instance vs Data Class (ie Data Subclass)
12:29 Making a Data Class in blueprint instead of code (code must opt-in to allowing this)
14:14 Making a data instance from a blueprint data class
14:50 Data Asset Casting: Making a specialized spawner that uses the blueprint extended data class
15:42 Level: Testing the customized blueprint spawners
17:00 Code Data Subclasses: Code subclassing of data assets to make new data classes.
17:27 Refactoring: changing data asset types (convert data asset)
17:40 Testing code data subclass
18:07 Data inheritance is not allowed for data instances. Data instances are explicitly specified atomic units units of data.
18:51 Bonus Tip: Efficiently modifying multiple assets (property matrix view)
20:10 Closing Summary
20:54 Outro
Комментарии