-
Notifications
You must be signed in to change notification settings - Fork 14
Guide 101: SmartData Basics
This page is basically housekeeping before getting to the meat, but it's important to read. I avoided calling it Housekeeping to trick you into reading it. Sorry.
If you haven't already, please watch Ryan Hipple's original talk. It explains why a framework like SmartData will probably improve your projects, whether you're a coder or a designer. Even if you don't end up using SmartData it's a great talk, and while Ryan is wrong about opening brace placement, he's right on pretty much everything else.
For simplicity, Ryan's talk focuses on a minimal framework. SmartData goes well beyond this both in features and tools. His talk therefore gives a fantastic overview of the concept, and these guides teach the specifics of SmartData as an implementation of it.
SmartData has a precise high-level nomenclature. Understanding this is necessary to understand the guides.
- SmartData is the name of the overall framework. It does not refer to objects, values or anything within the framework.
-
SmartObject means a
ScriptableObject
asset within the SmartData framework.- E.g. a
FloatVar
, aBoolMulti
and anEventVar
are all SmartObjects.
- E.g. a
-
SmartRef means a plain (but serializable) class which links to a SmartObject asset.
- E.g. a
FloatReader
, aStringSetWriter
and anEventDispatcher
are all SmartRefs.
- E.g. a
-
SmartComponent means the MonoBehaviours generated by the framework to help designers. These contain SmartRefs.
- E.g. a
ReadSmartFloat
, aWriteSmartVector3
and aListenSmartEvent
are all SmartComponents.
- E.g. a
-
SmartType is the high-level group of all of these sharing the same underlying type. Each SmartType has a namespace. The generator creates entire SmartTypes at once.
- E.g. the SmartType of
FloatVar
,FloatSet
,FloatMultiReader
andWriteSmartFloat
is SmartFloat, and they exist within theSmartData.SmartFloat
namespace.
- E.g. the SmartType of
Each SmartType involves a large number of script files. While you could manually inherit from the various base classes to make your own SmartTypes, it would be error-prone and difficult. SmartData includes a tool to generate these files for you. See Guide 401: Generating Custom SmartTypes for more.
It is not recommended to manually create SmartTypes or modify generated code files. SmartData provides powerful tools to avoid this, including the type generator and custom template support.