The visual representation of an NPCNote that there are multiple uses of DestroyImmediate
, this is so character creator can work inside the editor when not in play mode.
More...
Classes | |
struct | BodyMargins |
Measurements of the capsule mesh used to create the body. More... | |
class | Feature |
An object that is on (or worn by) a character body. More... | |
Public Member Functions | |||
CharacterModel (BodyMargins bodyMargins) | |||
| |||
GameObject | SpawnBody (GameObject bodyObj, Transform parent) | ||
Instantiates the body GameObject as a child of the parent Transform. | |||
Feature | AddFeature (GameObject featurePrefab, Feature.PlacementSetting placement) | ||
Adds and instantiates a new feature. | |||
void | RemoveFeature (Feature feature) | ||
Public Attributes | |
readonly BodyMargins | bodyMargins |
GameObject | body |
Feature | eyes |
Feature | snoz |
Feature | mouth |
List< Feature > | features = new() |
Properties | |
float | Radius [get, set] |
Setting this changes the X/Z scale of the character's body to match the radius in meters. | |
float | Height [get, set] |
Setting this changes the Y scale of the character's body to match the height in meters. | |
The visual representation of an NPC
Note that there are multiple uses of DestroyImmediate
, this is so character creator can work inside the editor when not in play mode.
CharacterModel.CharacterModel | ( | BodyMargins | bodyMargins | ) |
bodyMargins | Required for character model to have the correct measurements of the body mesh |
Feature CharacterModel.AddFeature | ( | GameObject | featurePrefab, |
Feature.PlacementSetting | placement ) |
Adds and instantiates a new feature.
Feature
void CharacterModel.RemoveFeature | ( | Feature | feature | ) |
GameObject CharacterModel.SpawnBody | ( | GameObject | bodyObj, |
Transform | parent ) |
Instantiates the body GameObject as a child of the parent Transform.
GameObject CharacterModel.body |
readonly BodyMargins CharacterModel.bodyMargins |
Feature CharacterModel.eyes |
List<Feature> CharacterModel.features = new() |
Feature CharacterModel.mouth |
Feature CharacterModel.snoz |
|
getset |
Setting this changes the Y scale of the character's body to match the height in meters.
|
getset |
Setting this changes the X/Z scale of the character's body to match the radius in meters.