Class WildlifeBody
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
-
ObjectComponentBehaviourMonoBehaviourNetworkBehaviourWildlifeBody
- Implements
- Inherited Members
-
NetworkBehaviour.IsSpawnedNetworkBehaviour.ComponentIndexNetworkBehaviour.NetworkObjectNetworkBehaviour.MAXIMUM_NETWORKBEHAVIOURSNetworkBehaviour.UNSET_NETWORKBEHAVIOUR_IDNetworkBehaviour.ToString()NetworkBehaviour.Reset()NetworkBehaviour.OnValidate()NetworkBehaviour.IsBehaviourReconcilingNetworkBehaviour.ClearReplicateCache()NetworkBehaviour.RequestReconcileSends()NetworkBehaviour.CreateReconcile()NetworkBehaviour.Reconcile_Reader_Remote<T>(PooledReader, ref T)NetworkBehaviour.ClearBuffedRpcs()NetworkBehaviour.IsClientOnlyNetworkBehaviour.IsServerOnlyNetworkBehaviour.IsHostNetworkBehaviour.IsClientNetworkBehaviour.IsServerNetworkBehaviour.IsDeinitializingNetworkBehaviour.NetworkManagerNetworkBehaviour.ServerManagerNetworkBehaviour.ClientManagerNetworkBehaviour.ObserverManagerNetworkBehaviour.TransportManagerNetworkBehaviour.TimeManagerNetworkBehaviour.SceneManagerNetworkBehaviour.PredictionManagerNetworkBehaviour.RollbackManagerNetworkBehaviour.NetworkObserverNetworkBehaviour.IsClientInitializedNetworkBehaviour.IsClientStartedNetworkBehaviour.IsClientOnlyInitializedNetworkBehaviour.IsClientOnlyStartedNetworkBehaviour.IsServerInitializedNetworkBehaviour.IsServerStartedNetworkBehaviour.IsServerOnlyInitializedNetworkBehaviour.IsServerOnlyStartedNetworkBehaviour.IsHostInitializedNetworkBehaviour.IsHostStartedNetworkBehaviour.IsOfflineNetworkBehaviour.IsNetworkedNetworkBehaviour.GetIsNetworked()NetworkBehaviour.IsManagerReconcilingNetworkBehaviour.ObserversNetworkBehaviour.IsOwnerNetworkBehaviour.IsControllerNetworkBehaviour.HasAuthorityNetworkBehaviour.OwnerNetworkBehaviour.OwnerIdNetworkBehaviour.ObjectIdNetworkBehaviour.LocalConnectionNetworkBehaviour.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.OnStartServerCalledNetworkBehaviour.OnStartClientCalledNetworkBehaviour.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.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.didStartMonoBehaviour.didAwakeMonoBehaviour.runInEditModeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.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.transformComponent.transformHandleComponent.gameObjectComponent.tagObject.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.nameObject.hideFlags
Fields
AttackSeconds
Seconds an attack's lunge takes, out and back.
public const float AttackSeconds = 0.45
Field Value
DeathSeconds
Seconds the fall onto its side takes.
public const float DeathSeconds = 0.7
Field Value
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
asServerbool
SetBlocking(bool)
Sets the blocking state.
public void SetBlocking(bool blocking)
Parameters
blockingbool
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
SetCrouching(bool)
Sets whether the character is crouching.
public void SetCrouching(bool crouching)
Parameters
crouchingbool
SetGrounded(bool)
Sets whether the character is on the ground.
public void SetGrounded(bool grounded)
Parameters
groundedbool
SetRootMotion(bool)
Enables or disables root motion on the Animator.
public void SetRootMotion(bool enabled)
Parameters
enabledbool
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
speedfloat
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
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()