IWieldable

The IWieldable interface defines the essential methods and properties for any wieldable object (e.g., weapons or tools) in the game.\

Example use in the asset: WieldableTool inherits from Wieldable, which in turn inherits from IWieldable. IWieldable and Wieldables are the base class for the whole Wieldable system

Properties

  • Character: The character currently wielding this object.

  • Motion: Controls movement-related behaviors for the wieldable.

  • Animator: Manages animations for the wieldable.

  • Audio: Handles audio playback for the wieldable.

  • IsGeometryVisible: Boolean flag to toggle the visibility of the wieldable's visual components.

Methods

  • SetCharacter(ICharacter character): Assigns a character to this wieldable.

  • Equip(): Starts the process to equip the wieldable.

  • Holster(float holsterSpeed): Starts the process to holster the wieldable at the specified speed.


NullWieldable Class

Namespace: PolymindGames.WieldableSystem

The NullWieldable class implements the IWieldable interface and serves as a default, "do-nothing" wieldable object. It returns null or default values for all properties and does nothing for methods, acting as a placeholder for when a valid wieldable is not available.

Properties

  • Character, Motion, Animator, Audio: All return null.

  • IsGeometryVisible: Always returns false.

  • gameObject, transform: Always return null.

Methods

  • SetCharacter(ICharacter character): Does nothing.

  • Equip(): Immediately ends the equipping process (no operation).

  • Holster(float holsterSpeed): Immediately ends the holstering process (no operation).

Last updated