Skip to main content

DeviceLifecycle

An abstract class in Root.Township, the global namespace.

Base for the game's device lifecycles (VR, fly cam, auto cam): hooks for SDK start and stop and the Unity update loop, plus which platform player the device drives.

Constructors​

MemberWhat it is
protected DeviceLifecycle(IPlatformPlayer player, IPlatformDevice platformDevice)Creates a DeviceLifecycle from player and platformDevice.

Fields​

MemberWhat it is
protected IPlatformDevice platformDeviceThe platform device this lifecycle runs.

Properties​

MemberWhat it is
IPlatformPlayer Player { get; private set; }The platform player this device drives.

Methods​

MemberWhat it is
virtual void DisableSDK()Hook to shut the device's SDK down. Empty in the base class.
virtual void EnableSDK()Hook to start the device's SDK. Empty in the base class.
virtual void FixedUpdate()Per physics step hook. Empty in the base class.
virtual void LateUpdate()Late update hook. Empty in the base class.
void SetDevicePlayer(IPlatformPlayer newPlayer)Switches to a new platform player, disconnecting the old one if it differs.
virtual void Update()Per frame hook. Empty in the base class.
protected virtual void OnPlatformPlayerSet(IPlatformPlayer oldPlayer, IPlatformPlayer newPlayer)Called when the player changes. The base disables the old player's hand inputs.

Used in​

Members of other types that take, return or hold a DeviceLifecycle: