Skip to main content

ControllerActionMode

A class in Root.Township, the global namespace.

One controller input mode (for example a held item's mode) with action mappings per player mode (Oculus, OpenVR, fly cam, auto cam) plus a shared all-platform mapping.

Constructors​

MemberWhat it is
ControllerActionMode()Creates a ControllerActionMode with default values.

Fields​

5 private and internal fields
MemberWhat it is
private PlatformActionMapping allPlatformsActionMappingMapping shared by every platform; each platform mapping links back to it.
private string modeNameDisplay name of the mode. Exposed as ModeName.
private Dictionary<PlayerMode, PlatformActionMapping> platformActionMappingsLazy lookup of mappings by player mode, behind PlatformActionMappings.
private List<PlatformActionMapping> platformActionMappingsListSerialized per-platform mappings for Oculus, OpenVR, Fly and AutoCam.
private ControllerModeType typeThe controller mode this is. Exposed as Type.

Properties​

MemberWhat it is
PlatformActionMapping AllPlatformsActionMapping { get; }Mapping that applies on every player mode.
string ModeName { get; set; }Name of the mode.
Dictionary<PlayerMode, PlatformActionMapping> PlatformActionMappings { get; }Mappings by player mode, built on first use.
ControllerModeType Type { get; }The ControllerModeType.

Methods​

MemberWhat it is
PlatformActionMapping GetMapping(PlayerMode platform)The mapping for a player mode, or null.
void SetupPlatformActionMappingsList()Links each platform mapping to this mode and to the all-platform mapping.
1 private and internal method
MemberWhat it is
private void InitializeDictionary()Builds platformActionMappings from the serialized list on first access.

Used in​

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