Skip to main content

Interface IPlayerSelectorService

A service responsible for accessing and managing the currently selected player entity in the scene.

public interface IPlayerSelectorService : IUnityGameService

Implements​

IUnityGameService

Properties​

gameObject​

The GameObject the service is attached to.

GameObject gameObject { get; }

Property Value​

GameObject

Methods​

GetPlayerTransform()​

Retrieves the transform of player controllable.

Transform GetPlayerTransform()

Returns​

Transform — The player's transform.

TryGetPlayerTransform(out Transform)​

Attempts to get the transform of player controllable.

bool TryGetPlayerTransform(out Transform transform)

Parameters​

NameTypeDescription
transformTransformThe player's transform if found.

Returns​

bool — True if the transform was successfully retrieved; otherwise, false.