Behaviours

Interface: IWieldableMotion

  • Purpose: Defines handlers and mixers for motion control of wieldable objects (hands and head).

  • Properties:

    • IShakeHandler ShakeHandler: Manages shaking effects.

    • IMotionDataHandler HandsDataHandler: Handles data for hand motions.

    • IMotionMixer HandsMotionMixer: Mixes various hand motions.

    • IMotionDataHandler HeadDataHandler: Handles data for head motions.

    • IMotionMixer HeadMotionMixer: Mixes various head motions.


Class: WieldableMotion

Properties:

  • Pivot Offset: Default pivot position of the weapon.

  • Position Offset: Default local position offset of the weapon after equip.

  • Rotation Offset: Default local rotation offset of the weapon after equip.

Class: WieldableAnimator

  • Purpose: Controls animations for a wieldable object.

  • Key Members:

    • _animator: The Unity Animator component.

    • _clips: Animation overrides.

    • Methods:

      • SetFloat, SetBool, SetInteger, SetTrigger, ResetTrigger: Controls animator parameters.

    • Lifecycle: Awake, OnEnable, and OnValidate.


Class: WieldableArmsAnimator

  • Purpose: Controls animations specifically for wieldable arms. (Mainly used by HQ FPS Weapons)

  • Key Members:

    • _armsPrefab: Prefab for wieldable arms.

    • _animator: Animator for arm motions.

    • Methods: Similar to WieldableAnimator.

    • Lifecycle: Awake, OnEnable, OnDisable, and OnValidate.


Class: WieldableCameraCurvesAnimator

  • Purpose: Animates the camera with rotation curves when wielding objects.

  • Key Members:

    • _forceMotion: Manages camera forces.

    • Methods:

      • PlayAnimation: Adds rotation curves to camera forces.

    • Lifecycle: OnEnable.


Class: WieldableCameraForcesAnimator

  • Purpose: Animates the camera by applying delayed forces when wielding objects.

  • Key Members:

    • _forceMotion: Manages camera forces.

    • Methods:

      • PlayAnimation: Applies delayed rotation forces to the camera.

    • Lifecycle: OnEnable.


Class: WieldableEffectsToggler

  • Purpose: Toggles various effects (light, audio, particle) when wielding objects.

  • Key Members:

    • _lightEffects, _audioEffects, _particles: Arrays of effects.

    • Methods:

      • EnableEffects: Activates effects.

      • DisableEffects: Deactivates effects.

      • ToggleEffects: Toggles effect states.

    • Lifecycle: Awake.


Class: WieldableFOV

  • Purpose: Controls Field of View (FOV) for both the camera and view model in wielding scenarios.

  • Key Members:

    • _viewModelFOV: FOV for the view model.

    • _fovHandler: Handles FOV transitions.

    • Methods:

      • SetViewModelFOV, SetCameraFOV: Adjusts the FOV over time.

    • Lifecycle: Awake.

Class: WieldableItemBehaviour

This abstract class serves as a base for all wieldable item behaviors. It ensures that a wieldable item is properly referenced when the object awakens.

  • WieldableItem: A property that holds a reference to the associated IWieldableItem.

  • Awake(): Finds the IWieldableItem in the parent hierarchy. If not found, logs an error.

  • OnItemChanged(IItem item): Virtual method triggered when the attached item changes. Intended to be overridden by derived classes.


Class: WieldableShakeAnimator

A specialized component responsible for handling shake animations for wieldable items, applying them to various body points (head, hands).

  • _shakeHandler: Private field for managing shake animations via the associated IShakeHandler.

  • PlayAnimation(AnimationData anim): Plays shake animations for the head and hands if they are marked as playable.

  • Awake(): Initializes the shake handler by retrieving it from the IWieldable's motion system.

  • AnimationData: A nested, serializable class that stores data for head and hands shake animations.

Last updated