Adds personality traits to a GameObject. More...
Public Member Functions | |
void | FindResources () |
Finds a faction database if it's unassigned, first looking on a FactionManager and failing that the first FactionDatabase it finds. | |
float | GetTrait (string traitName) |
Gets a trait value by name. | |
void | OnDrawGizmos () |
Static Public Member Functions | |
static void | Copy (float[] source, ref float[] dest) |
Deep copies a source array into a destination array. | |
static float[] | Allocate (int count) |
Allocates an array of a specified size. | |
static float[] | Allocate (int count, bool initialize) |
Allocates an array of a specified size. | |
static void | Initialize (float[] traits) |
Initializes an array to zero. | |
static float | Alignment (float[] a, float[] b) |
Computes the "alignment" of two sets of values, which is close their values are. | |
Public Attributes | |
FactionDatabase | factionDatabase |
An editor-time-only reference to the FactionDatabase, to be used only by the editor to get the presets list for the Traits custom editor. | |
float[] | traits = new float[0] |
The personality traits. | |
Adds personality traits to a GameObject.
This isn't necessary if the GameObject has a FactionMember but may be useful for other GameObjects such as items and locations.
This class also provides utility methods to work with trait arrays.
|
inlinestatic |
Computes the "alignment" of two sets of values, which is close their values are.
a | The first set of values. |
b | The second set of values. Both arrays should be the same length. |
|
inlinestatic |
Allocates an array of a specified size.
count | Count. |
|
inlinestatic |
Allocates an array of a specified size.
count | Count. |
///
initialize | Set true to initialize the array to zero. |
|
inlinestatic |
Deep copies a source array into a destination array.
source | Source. |
dest | Destination. |
|
inline |
Finds a faction database if it's unassigned, first looking on a FactionManager and failing that the first FactionDatabase it finds.
|
inline |
Gets a trait value by name.
traitName | The trait name. |
|
inlinestatic |
Initializes an array to zero.
traits | Traits |
|
inline |
FactionDatabase PixelCrushers.LoveHate.Traits.factionDatabase |
An editor-time-only reference to the FactionDatabase, to be used only by the editor to get the presets list for the Traits custom editor.
float [] PixelCrushers.LoveHate.Traits.traits = new float[0] |
The personality traits.