S.A.P.S V0.4.0
A virtual reality stealth action game
 
Loading...
Searching...
No Matches
CharacterModel Class Reference

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)
 
Parameters
bodyMarginsRequired for character model to have the correct measurements of the body mesh

 
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< Featurefeatures = 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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ CharacterModel()

CharacterModel.CharacterModel ( BodyMargins bodyMargins)

Parameters
bodyMarginsRequired for character model to have the correct measurements of the body mesh

Member Function Documentation

◆ AddFeature()

Feature CharacterModel.AddFeature ( GameObject featurePrefab,
Feature.PlacementSetting placement )

Adds and instantiates a new feature.

Returns
The generated feature as a Feature

◆ RemoveFeature()

void CharacterModel.RemoveFeature ( Feature feature)

◆ SpawnBody()

GameObject CharacterModel.SpawnBody ( GameObject bodyObj,
Transform parent )

Instantiates the body GameObject as a child of the parent Transform.

Member Data Documentation

◆ body

GameObject CharacterModel.body

◆ bodyMargins

readonly BodyMargins CharacterModel.bodyMargins

◆ eyes

Feature CharacterModel.eyes

◆ features

List<Feature> CharacterModel.features = new()

◆ mouth

Feature CharacterModel.mouth

◆ snoz

Feature CharacterModel.snoz

Property Documentation

◆ Height

float CharacterModel.Height
getset

Setting this changes the Y scale of the character's body to match the height in meters.

◆ Radius

float CharacterModel.Radius
getset

Setting this changes the X/Z scale of the character's body to match the radius in meters.


The documentation for this class was generated from the following file: