Show / Hide Table of Contents

Class MobileUnit

Daggerfall mobile enemy. Handles loading resources and rendering object (i.e. a billboard) based on orientation and state. Note for implementors: an instance of a component extending this class can be added to a prefab named "DaggerfallMobileUnit" and bundled with a mod.

Inheritance
Object
Object
Component
Behaviour
MonoBehaviour
MobileUnit
DaggerfallMobileUnit
Namespace: DaggerfallWorkshop
Assembly: Assembly-CSharp.dll
Syntax
public abstract class MobileUnit : MonoBehaviour

Fields

| Improve this Doc View Source

summary

Declaration
[SerializeField]
protected MobileUnit.MobileUnitSummary summary
Field Value
Type Description
MobileUnit.MobileUnitSummary

Properties

| Improve this Doc View Source

ClassicSpawnDistanceType

An index that defines spawn distance type.

Declaration
public abstract byte ClassicSpawnDistanceType { get; protected set; }
Property Value
Type Description
Byte
| Improve this Doc View Source

DoMeleeDamage

True if melee damage is scheduled to be performed, false otherwise. This is set by implementation when required during animation.

Declaration
public abstract bool DoMeleeDamage { get; set; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

Enemy

Basic properties of this enemy.

Declaration
public abstract MobileEnemy Enemy { get; protected set; }
Property Value
Type Description
MobileEnemy
| Improve this Doc View Source

EnemyState

Current animation in progrees. Set with ChangeEnemyState(MobileStates).

Declaration
public abstract MobileStates EnemyState { get; protected set; }
Property Value
Type Description
MobileStates
| Improve this Doc View Source

FrameSpeedDivisor

Slow down the animation of this mobile unit by a divisor of frames per second. Used when enemies are slowed by spells etc.

Declaration
public abstract int FrameSpeedDivisor { get; set; }
Property Value
Type Description
Int32
| Improve this Doc View Source

FreezeAnims

True if animation shouldn't be performed, for example because enemy is paralyzed, false if animation should be performed as usual.

Declaration
public abstract bool FreezeAnims { get; set; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsBackFacing

True if enemy is facing away from player and might be backstabbed, false otherwise.

Declaration
public abstract bool IsBackFacing { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsSetup

True if enemy has been set, false otherwise.

Declaration
public abstract bool IsSetup { get; protected set; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

ShootArrow

True if arrow shoot is scheduled to be performed, false otherwise. This is set by implementation when required during animation.

Declaration
public abstract bool ShootArrow { get; set; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

SpecialTransformationCompleted

True if special transformation is completed, false otherwise. See SetSpecialTransformationCompleted().

Declaration
public abstract bool SpecialTransformationCompleted { get; protected set; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

Summary

Get the MobileUnitSummary data

Declaration
public MobileUnit.MobileUnitSummary Summary { get; }
Property Value
Type Description
MobileUnit.MobileUnitSummary

Methods

| Improve this Doc View Source

ApplyEnemy(DaggerfallUnity)

Applies enemy properties. Implementation should perform setup for specific Enemy (for example load/instantiate objects and materials) and then start current animation (EnemyState).

Declaration
protected abstract void ApplyEnemy(DaggerfallUnity dfUnity)
Parameters
Type Name Description
DaggerfallUnity dfUnity

Current instance of Daggerfall Unity.

| Improve this Doc View Source

ApplyEnemyStateChange(MobileStates, MobileStates)

Applies change to enemy state. Implementation should perform transition to new animation (already assigned to EnemyState by caller).

Declaration
protected abstract void ApplyEnemyStateChange(MobileStates currentState, MobileStates newState)
Parameters
Type Name Description
MobileStates currentState

Enemy state before the change.

MobileStates newState

Enemy state after the change.

| Improve this Doc View Source

ChangeEnemyState(MobileStates)

Sets a new enemy state and restarts frame counter, if not freezed. Certain states are one-shot only (such as attack and hurt) and return to idle when completed. Continuous states (such as move) will keep looping until changed.

Declaration
public void ChangeEnemyState(MobileStates newState)
Parameters
Type Name Description
MobileStates newState

New state.

| Improve this Doc View Source

GetSize()

Gets size of enemy in scene.

Declaration
public abstract Vector3 GetSize()
Returns
Type Description
Vector3

2D or 3D size of enemy object in scene.

| Improve this Doc View Source

IsAttacking()

Gets true if playing any attack animation.

Declaration
public bool IsAttacking()
Returns
Type Description
Boolean

True if playing attack animation.

| Improve this Doc View Source

IsPlayingOneShot()

Gets true if playing a one-shot animation like attack and hurt.

Declaration
public bool IsPlayingOneShot()
Returns
Type Description
Boolean

True if playing one-shot animation.

| Improve this Doc View Source

OneShotPauseActionsWhilePlaying()

Gets true if motor should prevent action state changes while playing current oneshot anim.

Declaration
public bool OneShotPauseActionsWhilePlaying()
Returns
Type Description
Boolean

True if motor should pause state changes while playing.

| Improve this Doc View Source

SetEnemy(DaggerfallUnity, MobileEnemy, MobileReactions, Byte)

Sets enemy data for setup.

Declaration
public void SetEnemy(DaggerfallUnity dfUnity, MobileEnemy enemy, MobileReactions reaction, byte classicSpawnDistanceType)
Parameters
Type Name Description
DaggerfallUnity dfUnity

Current instance of Daggerfall Unity.

MobileEnemy enemy

Basic properties of this enemy.

MobileReactions reaction

Reaction setting for this enemy.

Byte classicSpawnDistanceType

An index that defines spawn distance type.

| Improve this Doc View Source

SetSpecialTransformationCompleted()

Set special transformation completed, e.g. Daedra Seducer into winged form. Used internally by mobile unit after playing seducer animations. Called when restoring save game if unit has raised transformation completed flag.

Declaration
public void SetSpecialTransformationCompleted()

Extension Methods

MBExtensions.Invoke(MonoBehaviour, Action, Single)
MBExtensions.Invoke<T>(MonoBehaviour, Action<T>, T, Single)
MBExtensions.Invoke<T1, T2>(MonoBehaviour, Action<T1, T2>, T1, T2, Single)
MBExtensions.Invoke<T1, T2, T3>(MonoBehaviour, Action<T1, T2, T3>, T1, T2, T3, Single)
MBExtensions.Invoke<T1, T2, T3, T4>(MonoBehaviour, Action<T1, T2, T3, T4>, T1, T2, T3, T4, Single)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX