Class MobilePersonAsset
The component that handles graphics for a mobile person.
Namespace: DaggerfallWorkshop
Assembly: Assembly-CSharp.dll
Syntax
public abstract class MobilePersonAsset : MonoBehaviour
Remarks
Implementations should be added to a prefab named "MobilePersonAsset" bundled with a mod. This prefab acts as a provider for all custom npcs graphics. This allows mods to replace classic MobilePersonBillboard with 3d models or other alternatives. The actual graphic asset for specific npc should be loaded when requested by SetPerson(Races, Genders, Int32, Boolean, Int32, Int32).
Properties
| Improve this Doc View SourceIsIdle
Gets or sets idle state. Daggerfall NPCs are either in or motion or idle facing player. This only controls animation state, actual motion is handled by MobilePersonMotor.
Declaration
public abstract bool IsIdle { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Trigger
Trigger collider used for interaction with player. The collider should be altered to enclose the entire npc mesh when SetPerson(Races, Genders, Int32, Boolean, Int32, Int32) is called. A sign of badly setup collider is misbehaviour of idle state and talk functionalities.
Declaration
protected CapsuleCollider Trigger { get; }
Property Value
Type | Description |
---|---|
CapsuleCollider |
Methods
| Improve this Doc View SourceGetLayerMask()
Gets a bitmask that provides all the layers used by this asset.
Declaration
public virtual int GetLayerMask()
Returns
Type | Description |
---|---|
Int32 | A layer mask. |
GetSize()
Gets size of asset used by this person (i.e size of bounds). Used to adjust position on terrain.
Declaration
public abstract Vector3 GetSize()
Returns
Type | Description |
---|---|
Vector3 | Size of npc. |
SetPerson(Races, Genders, Int32, Boolean, Int32, Int32)
Setup this person based on race, gender and outfit variant. Enitities in a npcs pool can be recycled when out of range, meaning that this method can be called more than once with different parameters.
Declaration
public abstract void SetPerson(Races race, Genders gender, int personVariant, bool isGuard, int personFaceVariant, int personFaceRecordId)
Parameters
Type | Name | Description |
---|---|---|
Races | race | Race of target npc. |
Genders | gender | Gender of target npc. |
Int32 | personVariant | Which basic outfit does the person wear. |
Boolean | isGuard | True if this npc is a city watch guard. |
Int32 | personFaceVariant | |
Int32 | personFaceRecordId |