docs.unity3d.com
    Show / Hide Table of Contents

    Struct KinematicCharacterStateSave

    A struct used to store the entire state of the core character components

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    ValueType.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: Unity.CharacterController
    Syntax
    [Serializable]
    public struct KinematicCharacterStateSave : IDisposable

    Fields

    SavedCharacterBody

    The character body component

    Declaration
    public KinematicCharacterBody SavedCharacterBody
    Field Value
    Type Description
    KinematicCharacterBody

    SavedCharacterHitsBuffer

    The character hits buffer

    Declaration
    [NativeDisableContainerSafetyRestriction]
    public NativeArray<KinematicCharacterHit> SavedCharacterHitsBuffer
    Field Value
    Type Description
    NativeArray<KinematicCharacterHit>

    SavedCharacterHitsBufferCount

    Count for the saved character hits buffer

    Declaration
    public int SavedCharacterHitsBufferCount
    Field Value
    Type Description
    Int32

    SavedCharacterProperties

    The character properties component

    Declaration
    public KinematicCharacterProperties SavedCharacterProperties
    Field Value
    Type Description
    KinematicCharacterProperties

    SavedDeferredImpulsesBuffer

    The deferred impulses buffer

    Declaration
    [NativeDisableContainerSafetyRestriction]
    public NativeArray<KinematicCharacterDeferredImpulse> SavedDeferredImpulsesBuffer
    Field Value
    Type Description
    NativeArray<KinematicCharacterDeferredImpulse>

    SavedDeferredImpulsesBufferCount

    Count for the saved deferred impulses buffer

    Declaration
    public int SavedDeferredImpulsesBufferCount
    Field Value
    Type Description
    Int32

    SavedPhysicsColliderMemory

    Saved physics collider data

    Declaration
    [NativeDisableContainerSafetyRestriction]
    public NativeArray<byte> SavedPhysicsColliderMemory
    Field Value
    Type Description
    NativeArray<Byte>

    SavedPhysicsColliderMemorySize

    Size of the saved physics collider, in bytes

    Declaration
    public int SavedPhysicsColliderMemorySize
    Field Value
    Type Description
    Int32

    SavedStatefulHitsBuffer

    The stateful character hits buffer

    Declaration
    [NativeDisableContainerSafetyRestriction]
    public NativeArray<StatefulKinematicCharacterHit> SavedStatefulHitsBuffer
    Field Value
    Type Description
    NativeArray<StatefulKinematicCharacterHit>

    SavedStatefulHitsBufferCount

    Count for the saved stateful character hits buffer

    Declaration
    public int SavedStatefulHitsBufferCount
    Field Value
    Type Description
    Int32

    SavedTransform

    The local transform of the character

    Declaration
    public LocalTransform SavedTransform
    Field Value
    Type Description
    LocalTransform

    SavedVelocityProjectionHits

    The velocity projection hits buffer

    Declaration
    [NativeDisableContainerSafetyRestriction]
    public NativeArray<KinematicVelocityProjectionHit> SavedVelocityProjectionHits
    Field Value
    Type Description
    NativeArray<KinematicVelocityProjectionHit>

    SavedVelocityProjectionHitsCount

    Count for the saved velocity projection hits buffer

    Declaration
    public int SavedVelocityProjectionHitsCount
    Field Value
    Type Description
    Int32

    Methods

    CheckReallocateArray<T>(ref NativeArray<T>, Int32, Allocator)

    Reallocates a native array only if it is not created or if it does not have the required specified capacity

    Declaration
    public static void CheckReallocateArray<T>(ref NativeArray<T> arr, int requiredCapacity, Allocator allocator)
        where T : struct
    Parameters
    Type Name Description
    NativeArray<T> arr

    The array to reallocate

    Int32 requiredCapacity

    The minimum required capacity that the array should have

    Allocator allocator

    The type of allocator to use

    Type Parameters
    Name Description
    T

    The type of elements stored in the array

    Dispose()

    Disposes all data arrays stored in the character state save

    Declaration
    public void Dispose()
    Implements
    IDisposable.Dispose()

    Restore(KinematicCharacterAspect)

    Restores the character state.

    Declaration
    public void Restore(KinematicCharacterAspect characterAspect)
    Parameters
    Type Name Description
    KinematicCharacterAspect characterAspect

    The character aspect that provides access to the components to restore the state to

    Save(KinematicCharacterAspect, Allocator)

    Saves the character state. Only reallocates data arrays if the current arrays are not allocated or don't have the required capacity

    Declaration
    public void Save(KinematicCharacterAspect characterAspect, Allocator allocator = Allocator.Temp)
    Parameters
    Type Name Description
    KinematicCharacterAspect characterAspect

    The character aspect that provides access to the components to save

    Allocator allocator

    The type of allocation that will be used to store arrays of data

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023