Skip to main content

PlayerControllerPrefabs

A class in Root.Township, ATT.PlayerStates.

Global settings asset ("Player Controller Prefabs") holding the player controller prefabs for each platform and mode. Get it with GlobalSettings<PlayerControllerPrefabs>.Instance.

Constructors​

MemberWhat it is
PlayerControllerPrefabs()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

7 private and internal fields
MemberWhat it is
private AutoCamPlayer autoCamPlayerAuto cam controller prefab.
private CustomizationPlayerController customizationControllerBacking field for CustomizationController.
private FlyCamPlayer flyCamPlayerFly cam controller prefab.
private PlayerController locomotionLessControllerBacking field for LocomotionLessController.
private MainMenuPlayerController mainMenuControllerVR main menu controller prefab.
private PlayerController mainMenuControllerFlatFlat-screen main menu controller prefab.
private PlayerCharacter vrPlayerBacking field for VrPlayer.

Properties​

MemberWhat it is
CustomizationPlayerController CustomizationController { get; }Controller prefab used in the character customization room.
PlayerController LocomotionLessController { get; }Controller prefab with no locomotion.
PlayerCharacter VrPlayer { get; }The normal VR player character prefab. Used when respawning a player, for example after a micro tutorial.

Methods​

MemberWhat it is
PlayerController GetController(PlayerMode mode)Returns the in-game controller prefab for a player mode: fly cam, auto cam, or the VR player otherwise.
PlayerController GetMenuController(PlayerMode mode)Returns the main menu controller prefab: the flat one for fly and auto cam modes, the VR one otherwise.