IPossessor

Interface that marks a MonoBehaviour as having possession capabilities. Implementors expose a Possessor component that manages the lifecycle of possessing and releasing Possessable objects.

Definition

Namespace: Paragon.Townskeep.PossessionSystem Assembly: Townskeep.dll

public interface IPossessor : IComponent

Extends: IComponent

Remarks

IPossessor is the counterpart to IPossessable — together they form the two-sided contract for the Possession System. Any entity that can possess objects (e.g., a player character, an NPC) implements IPossessor to provide access to its Possessor component.

By extending IComponent, implementors inherit access to transform, gameObject, GetComponent<T>(), and other Unity component APIs — ensuring that possessors are always MonoBehaviour-backed.

The Possessor component uses this interface internally: during Awake() it calls GetComponent<IPossessor>() to discover its owner, and stores the reference as Owner for use during possession events.

Quick Lookup

Goal
How

Get the Possessor from an IPossessor

iPossessor.Possessor

Possess an object

iPossessor.Possessor.Possess(possessable)

Release an object

iPossessor.Possessor.Release(possessable)

Check if possessing

iPossessor.Possessor.IsPossessing(possessable)

Properties

Possessor

The Possessor component that manages this entity's possessions. Returns the concrete component instance, providing access to Possess(), Release(), TryGetPossession<T>(), and possession events.

Implementation Requirements

When implementing, you MUST:

  1. Have a Possessor component on the same GameObject

  2. Return it from the Possessor property

You SHOULD:

  • Cache the Possessor reference in Awake() via GetComponent<Possessor>()

  • Implement the property as a simple getter returning the cached field

Common Pitfalls

circle-exclamation

Examples

Implementing IPossessor

Using IPossessor to check possessions

See Also

  • Possessor — the component that manages possession state

  • IPossessable — the counterpart interface for objects that can be possessed

  • IComponent — base interface providing Unity component access

Last updated