Table of Contents

Class WildlifeBody

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

A wild animal's body and its animation: the species' procedural mesh (WildlifeBodyMesh) under the character's mesh root, posed each frame by four shader parameters (FishMMO/Wildlife). Stands in for the humanoid CharacterAnimationController on wildlife prefabs, so the ability and damage code that triggers attacks, casts and deaths reaches it unchanged. Client only; on the server it does nothing.

public class WildlifeBody : CharacterBehaviour, ICharacterAnimationController, ICharacterBehaviour
Inheritance
Object
Component
Behaviour
MonoBehaviour
NetworkBehaviour
WildlifeBody
Implements
Inherited Members
NetworkBehaviour.IsSpawned
NetworkBehaviour.ComponentIndex
NetworkBehaviour.NetworkObject
NetworkBehaviour.MAXIMUM_NETWORKBEHAVIOURS
NetworkBehaviour.UNSET_NETWORKBEHAVIOUR_ID
NetworkBehaviour.ToString()
NetworkBehaviour.Reset()
NetworkBehaviour.OnValidate()
NetworkBehaviour.IsBehaviourReconciling
NetworkBehaviour.ClearReplicateCache()
NetworkBehaviour.RequestReconcileSends()
NetworkBehaviour.CreateReconcile()
NetworkBehaviour.Reconcile_Reader_Remote<T>(PooledReader, ref T)
NetworkBehaviour.ClearBuffedRpcs()
NetworkBehaviour.IsClientOnly
NetworkBehaviour.IsServerOnly
NetworkBehaviour.IsHost
NetworkBehaviour.IsClient
NetworkBehaviour.IsServer
NetworkBehaviour.IsDeinitializing
NetworkBehaviour.NetworkManager
NetworkBehaviour.ServerManager
NetworkBehaviour.ClientManager
NetworkBehaviour.ObserverManager
NetworkBehaviour.TransportManager
NetworkBehaviour.TimeManager
NetworkBehaviour.SceneManager
NetworkBehaviour.PredictionManager
NetworkBehaviour.RollbackManager
NetworkBehaviour.NetworkObserver
NetworkBehaviour.IsClientInitialized
NetworkBehaviour.IsClientStarted
NetworkBehaviour.IsClientOnlyInitialized
NetworkBehaviour.IsClientOnlyStarted
NetworkBehaviour.IsServerInitialized
NetworkBehaviour.IsServerStarted
NetworkBehaviour.IsServerOnlyInitialized
NetworkBehaviour.IsServerOnlyStarted
NetworkBehaviour.IsHostInitialized
NetworkBehaviour.IsHostStarted
NetworkBehaviour.IsOffline
NetworkBehaviour.IsNetworked
NetworkBehaviour.GetIsNetworked()
NetworkBehaviour.IsManagerReconciling
NetworkBehaviour.Observers
NetworkBehaviour.IsOwner
NetworkBehaviour.IsController
NetworkBehaviour.HasAuthority
NetworkBehaviour.Owner
NetworkBehaviour.OwnerId
NetworkBehaviour.ObjectId
NetworkBehaviour.LocalConnection
NetworkBehaviour.OwnerMatches(NetworkConnection)
NetworkBehaviour.Despawn(GameObject, DespawnType?)
NetworkBehaviour.Despawn(NetworkObject, DespawnType?)
NetworkBehaviour.Despawn(DespawnType?)
NetworkBehaviour.Spawn(GameObject, NetworkConnection, Scene)
NetworkBehaviour.Spawn(NetworkObject, NetworkConnection, Scene)
NetworkBehaviour.RemoveOwnership()
NetworkBehaviour.GiveOwnership(NetworkConnection)
NetworkBehaviour.GetInstance<T>()
NetworkBehaviour.TryRegisterInstance<T>(T)
NetworkBehaviour.UnregisterInstance<T>()
NetworkBehaviour.CanLog(LoggingType)
NetworkBehaviour.OnStartServerCalled
NetworkBehaviour.OnStartClientCalled
NetworkBehaviour.WritePayload(NetworkConnection, Writer)
NetworkBehaviour.ReadPayload(NetworkConnection, Reader)
NetworkBehaviour.OnStartNetwork()
NetworkBehaviour.OnStopNetwork()
NetworkBehaviour.OnStartServer()
NetworkBehaviour.OnStopServer()
NetworkBehaviour.OnOwnershipServer(NetworkConnection)
NetworkBehaviour.OnSpawnServer(NetworkConnection)
NetworkBehaviour.OnDespawnServer(NetworkConnection)
NetworkBehaviour.OnStopClient()
NetworkBehaviour.OnOwnershipClient(NetworkConnection)
MonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.destroyCancellationToken
MonoBehaviour.useGUILayout
MonoBehaviour.didStart
MonoBehaviour.didAwake
MonoBehaviour.runInEditMode
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Component.GetComponentIndex()
Component.CompareTag(TagHandle)
Component.transform
Component.transformHandle
Component.gameObject
Component.tag
Object.GetEntityId()
Object.MemberwiseClone()
Object.GetInstanceID()
Object.GetHashCode()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Scene)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.FindObjectsByType<T>()
Object.FindObjectsByType<T>(FindObjectsInactive)
Object.name
Object.hideFlags

Fields

AttackSeconds

Seconds an attack's lunge takes, out and back.

public const float AttackSeconds = 0.45

Field Value

float

DeathSeconds

Seconds the fall onto its side takes.

public const float DeathSeconds = 0.7

Field Value

float

Methods

OnStartCharacter()

Called after Character.OnStartClient. Use this for local client initialization.

public override void OnStartCharacter()

OnStartClient()

Builds the body on every client that spawns this animal.

public override void OnStartClient()

Remarks

OnStartCharacter() alone never ran for an NPC: only the OWNER's player character starts its behaviours (PlayerCharacter.TryInitializeLocalClient), so every animal arrived on clients with a nameplate and no body. OnStartClient runs for every spawned object, after its payload.

ResetDeath()

Resets the death animation state and restores default locomotion params. Called on resurrection or when death was mispredicted (reconcile correction). Resets Death trigger, clears Speed to 0, restores Grounded/Crouching defaults, and clears any lingering Attack/Cast/Roll/Jump/Block state.

public void ResetDeath()

ResetState(bool)

Resets this NetworkBehaviour so that it may be added to an object pool.

public override void ResetState(bool asServer)

Parameters

asServer bool

SetBlocking(bool)

Sets the blocking state.

public void SetBlocking(bool blocking)

Parameters

blocking bool

SetClimbing(bool, float)

Sets whether the character is climbing a ladder, rope ladder or rope, and how fast: rate is the climb's speed as a share of the stock climbing speed, positive up and negative down (zero holding still).

public void SetClimbing(bool climbing, float rate)

Parameters

climbing bool
rate float

SetCrouching(bool)

Sets whether the character is crouching.

public void SetCrouching(bool crouching)

Parameters

crouching bool

SetGrounded(bool)

Sets whether the character is on the ground.

public void SetGrounded(bool grounded)

Parameters

grounded bool

SetRootMotion(bool)

Enables or disables root motion on the Animator.

public void SetRootMotion(bool enabled)

Parameters

enabled bool

SetSpeed(float)

The movement's speed band (0 idle, 0.3 crouch-walk, 0.5 walk, 1 run, 1.5 sprint). An implementation may measure the body's real speed instead, as the game's does.

public void SetSpeed(float speed)

Parameters

speed float

SetSwimming(bool, float)

Sets whether the character is swimming, and how it lies in the water: pitch degrees, positive nose down (diving), negative nose up.

public void SetSwimming(bool swimming, float pitch)

Parameters

swimming bool
pitch float

TriggerAttack()

Triggers an attack animation.

public void TriggerAttack()

TriggerCast()

Triggers a spell cast animation.

public void TriggerCast()

TriggerDeath()

Triggers the death animation and suppresses all other animation state.

public void TriggerDeath()

TriggerJump()

Triggers a jump animation.

public void TriggerJump()

TriggerRoll()

Triggers a roll/dodge animation.

public void TriggerRoll()