The Escapists 2 Decompilation

T17Framework

The Escapists 2 - T17Framework system documentation

Overview

Team17's internal Unity framework providing base classes, UI widgets, event system, dialog/tooltip system, networking, customisation, and global game flow. All classes live in the global namespace unless otherwise noted.


Core Framework

T17MonoBehaviour.cs

Assembly-CSharp/T17MonoBehaviour.cs

Base class for all T17 MonoBehaviour-derived components.

Inherits: MonoBehaviour

Fields

VisibilityTypeNameDescription
privateboolm_InitialisedWhether component has been initialised

Methods

SignatureDescription
virtual void Init()Initialisation hook, sets m_Initialised = true
virtual void OnDestroy()Calls Deinit()
virtual void Deinit()Cleanup hook

T17NetworkBehaviour.cs

Assembly-CSharp/T17NetworkBehaviour.cs

Base class for networked MonoBehaviours.

Inherits: MonoBehaviour

Implements: IPunObservable, IPunCallbacks

Fields

VisibilityTypeNameDescription
protectedPhotonViewphotonViewAssociated PhotonView
protectedintm_OwnerIDOwner player ID

Methods

SignatureDescription
virtual void Awake()Caches PhotonView
virtual void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)Serialisation callback

T17BehaviourManager.cs

Assembly-CSharp/T17BehaviourManager.cs

Manages registration and lifecycle of T17Behaviour instances.

Methods (static)

SignatureDescription
static void Register(T17MonoBehaviour behaviour)Registers a behaviour
static void Unregister(T17MonoBehaviour behaviour)Unregisters a behaviour
static T GetBehaviour<T>()Returns first registered behaviour of type T

T17NetManager.cs

Assembly-CSharp/T17NetManager.cs

Core network manager wrapping Photon.

Inherits: T17MonoBehaviour

Fields / Properties

VisibilityTypeNameDescription
public staticT17NetManagerm_InstanceSingleton
publicboolIsConnectedWhether connected to Photon
publicboolIsInRoomWhether currently in a room
publicstringPlayerNameLocal player's name

Methods

SignatureDescription
void Connect()Connects to Photon cloud
void Disconnect()Disconnects from Photon
void CreateRoom(string name, RoomOptions options)Creates a room
void JoinRoom(string name)Joins a room by name
void JoinRandomRoom()Joins a random room
void LeaveRoom()Leaves current room
void LoadLevel(string levelName)Calls PhotonNetwork.LoadLevel

T17NetworkManager.cs

Assembly-CSharp/T17NetworkManager.cs

Higher-level network manager handling player spawning and game state sync.

Inherits: T17NetworkBehaviour

Fields / Properties

VisibilityTypeNameDescription
public staticT17NetworkManagerm_InstanceSingleton
publicGameObjectPlayerPrefabPlayer prefab for spawning

Methods

SignatureDescription
void SpawnPlayer(Vector3 position, Quaternion rotation)Instantiates player prefab over network
void OnPlayerJoined(PhotonPlayer player)Handles new player join
void OnPlayerLeft(PhotonPlayer player)Handles player disconnect
void OnLevelLoaded()Called when a new level is loaded

T17NetView.cs

Assembly-CSharp/T17NetView.cs

Manages networked object ownership and RPCs.

Fields

VisibilityTypeNameDescription
publicintViewIDPhoton view ID
publicPhotonViewphotonViewAssociated PhotonView

Methods

SignatureDescription
void RPC(string methodName, PhotonTargets targets, params object[] parameters)Sends RPC
void TransferOwnership(int playerID)Transfers view ownership
bool IsMine()Whether local player owns this view

T17NetConfig.cs

Assembly-CSharp/T17NetConfig.cs

Network configuration constants.

Fields (static)

VisibilityTypeNameDescription
public staticintMaxPlayersPerRoomMaximum players in a room
public staticstringAppIDPhoton application ID
public staticstringGameVersionGame version string for matchmaking

UI Widget System

All UI widgets are in Assembly-CSharp/ with the T17 prefix. They wrap/customise Unity's UI system (uGUI).

T17Button.cs

Wrapper for UnityEngine.UI.Button with T17 theming.

Inherits: T17Selectable

Fields

VisibilityTypeNameDescription
publicUnityEngine.Events.UnityEventOnClickClick event

T17Text.cs

Wrapper for UnityEngine.UI.Text with T17 styling defaults.

Inherits: T17Selectable


T17Image.cs

Wrapper for UnityEngine.UI.Image with T17 theming.

Inherits: T17Selectable


T17RawImage.cs

Assembly-CSharp/T17RawImage.cs

Wrapper for UnityEngine.UI.RawImage with UV scrolling support.

Inherits: T17Selectable


T17Toggle.cs

Wrapper for UnityEngine.UI.Toggle.

Inherits: T17Selectable


T17Slider.cs

Wrapper for UnityEngine.UI.Slider.

Inherits: T17Selectable


T17Scrollbar.cs

Wrapper for UnityEngine.UI.Scrollbar.

Inherits: T17Selectable


T17ScrollView.cs

Wrapper for UnityEngine.UI.ScrollRect.

Inherits: T17Selectable


T17DropDown.cs

Wrapper for UnityEngine.UI.DropDown.

Inherits: T17Selectable


T17InputField.cs

Wrapper for UnityEngine.UI.InputField.

Inherits: T17Selectable


T17Selectable.cs

Base class for all T17 UI widgets.

Inherits: UnityEngine.UI.Selectable

Fields

VisibilityTypeNameDescription
publicColorNormalColorNormal state tint
publicColorHighlightedColorHighlighted state tint
publicColorPressedColorPressed state tint
publicColorDisabledColorDisabled state tint

T17TabPanel.cs

Tab panel container with navigation.


T17NavigableGrid.cs

Grid layout with keyboard/controller navigation.


T17MenuBody.cs

Base container for menu screens.


T17CounterObject.cs

Numeric counter display widget.


T17FavourObject.cs

Favourite/toggle indicator UI element.


T17HintObject.cs

Hint/tooltip popup indicator.


T17InfoObject.cs

Information icon/tooltip trigger.


T17TrackedUIElement.cs

UI element tracked by the analytics/reporting system.


T17StatsSlider.cs

Slider specialised for stat display.


T17UIAlphaFade.cs

Alpha fade animation component.


T17AspectRatioFitter.cs

Aspect ratio fitting component.


T17BlockKeyboardAutoFocus.cs

Prevents keyboard auto-focus on input fields.


T17ControlMapper.cs

Maps UI controls to Rewired input actions.


Event System

T17EventSystem.cs

Custom event system extending Unity's EventSystem.

Inherits: UnityEngine.EventSystems.EventSystem


T17EventSystemsManager.cs

Manages multiple T17EventSystem instances.

Inherits: T17MonoBehaviour


IT17EventHelper.cs

Interface for event helper classes.


Dialog & Tooltip System

T17DialogBox.cs

Assembly-CSharp/T17DialogBox.cs

Full-screen dialog box with title, message, and buttons.

Fields

VisibilityTypeNameDescription
publicT17TextTitleTextDialog title
publicT17TextMessageTextDialog message body
publicT17Button[]ButtonsDialog action buttons

Methods

SignatureDescription
void Show(string title, string message)Shows with default OK
void Show(string title, string message, string[] buttonLabels, System.Action<int> callback)Shows with custom buttons

T17DialogBoxManager.cs

Assembly-CSharp/T17DialogBoxManager.cs

Manages dialog box queue and display.

Inherits: T17MonoBehaviour

Fields

VisibilityTypeNameDescription
public staticT17DialogBoxManagerm_InstanceSingleton
publicT17DialogBoxDialogBoxPrefabPrefab for dialog instances

Methods

SignatureDescription
void QueueDialog(string title, string message, string[] buttonLabels, System.Action<int> callback)Queues a dialog
void ShowNext()Shows next dialog in queue

T17TooltipManager.cs

Assembly-CSharp/T17TooltipManager.cs

Manages tooltip display and positioning.

Inherits: T17MonoBehaviour

Fields

VisibilityTypeNameDescription
public staticT17TooltipManagerm_InstanceSingleton
publicT17ItemTooltipTooltipPrefabTooltip prefab

Methods

SignatureDescription
void ShowTooltip(string text, Vector3 position)Shows tooltip at position
void HideTooltip()Hides current tooltip

T17ItemTooltip.cs

Assembly-CSharp/T17ItemTooltip.cs

Tooltip specialised for item display (name, description, stats).

Fields

VisibilityTypeNameDescription
publicT17TextItemNameItem name text
publicT17TextItemDescriptionItem description text
publicT17TextItemStatsItem stats text

Methods

SignatureDescription
void SetItemData(string name, string description, string stats)Populates tooltip content

Customisation System

Customisation.cs

Assembly-CSharp/Customisation.cs

Enum — describes customisable slots.

MemberDescription
BodyTypeCharacter body type
SkinColourSkin colour
HairHair style
HatHat/headwear
UpperFaceAccessoryUpper face (eyes, eyebrows)
LowerFaceAccessoryLower face (mouth, beard)
OutfitFull outfit

CustomisationManager.cs

Assembly-CSharp/CustomisationManager.cs

Central manager for loading, saving, and applying customisation.

Inherits: T17MonoBehaviour

Fields / Properties

VisibilityTypeNameDescription
public staticCustomisationManagerm_InstanceSingleton
publicboolIsLoadedWhether data has been loaded
publicCustomisationDataDataAll loaded customisation data

Methods

SignatureDescription
void LoadData()Loads customisation data from resources
void ApplyCustomisation(CharacterCustomisation charCustom, CustomisationSet set)Applies a full set to a character
bool IsUnlocked(CustomisationSlot slot, long id)Checks if item is unlocked

CustomisationData.cs

Assembly-CSharp/CustomisationData.cs

Container for customisation configuration, defining available options per slot.

Inherits: ScriptableObject

Fields

VisibilityTypeNameDescription
publicCustomisationConfig[]ConfigsOne config per slot
publicstring[]NameFiltersProfanity filter list

Methods

SignatureDescription
CustomisationConfig GetConfig(Customisation slot)Returns config for a given slot
bool IsNameValid(string name)Checks name against profanity filter

CustomisationConfig.cs

Assembly-CSharp/CustomisationConfig.cs

Configuration for a single customisation slot.

Fields

VisibilityTypeNameDescription
publicCustomisationSlotWhich slot this config belongs to
publicCustomisationSet[]SetsAvailable sets for this slot
publiclongDefaultIDDefault item ID
publicstringDefaultNameDefault name/label

CustomisationSet.cs

Assembly-CSharp/CustomisationSet.cs

A specific customisation option (e.g. "Short Hair", "Red Outfit").

Fields

VisibilityTypeNameDescription
publiclongIDUnique identifier
publicstringNameDisplay name
publicCustomisationCategorisedSetCategorisedSetOptional category assignment
publicCustomisationConstraintConstraintCompatibility constraint

CustomisationCategorisedSet.cs

Assembly-CSharp/CustomisationCategorisedSet.cs

Categorisation data for a set (groups items by sub-category).

Fields

VisibilityTypeNameDescription
publicstringCategoryNameCategory label

CustomisationConstraint.cs

Assembly-CSharp/CustomisationConstraint.cs

Defines compatibility constraints between customisation slots (e.g. certain hats conflict with certain hair).

Fields

VisibilityTypeNameDescription
publicCustomisationConflictingSlotSlot that conflicts
publiclong[]ConflictingIDsConflicting item IDs

Methods

SignatureDescription
bool IsConflict(CustomisationSet other)Checks if this set conflicts with another

CustomisationSerialiser.cs

Assembly-CSharp/CustomisationSerialiser.cs

Serialises/deserialises customisation data for save/network transport.

Methods

SignatureDescription
static string Serialise(CustomisationNetData data)Converts net data to JSON
static CustomisationNetData Deserialise(string json)Parses JSON to net data

CustomisationNetData.cs

Assembly-CSharp/CustomisationNetData.cs

Network-transportable customisation data.

Fields

VisibilityTypeNameDescription
publiclongBodyTypeBody type ID
publiclongSkinColourSkin colour ID
publiclongHairHair ID
publiclongHatHat ID
publiclongUpperFaceAccessoryUpper face ID
publiclongLowerFaceAccessoryLower face ID
publiclongOutfitOutfit ID

CustomisationModifiedNetData.cs

Assembly-CSharp/CustomisationModifiedNetData.cs

Tracks which fields have been modified (for delta updates).

Fields

VisibilityTypeNameDescription
publicCustomisationNetDataDataThe net data
publicBitFieldModifiedFieldsBitfield tracking which slots changed

CustomisationCollectionNetData.cs

Assembly-CSharp/CustomisationCollectionNetData.cs

Collection of multiple customisation data entries (e.g. for NPCs).

Fields

VisibilityTypeNameDescription
publicCustomisationNetData[]EntriesArray of net data entries

CustomisationGeneratorTools.cs

Assembly-CSharp/CustomisationGeneratorTools.cs

Utility methods for procedurally generating customisation.

Methods (static)

SignatureDescription
static CustomisationNetData GenerateRandom(PRNG prng)Generates random customisation from a seeded PRNG
static CustomisationNetData GenerateRandom()Generates random customisation (no seed)

CharacterCustomisation.cs

Assembly-CSharp/CharacterCustomisation.cs

Component applied to character GameObjects. Holds and applies a customisation set.

Fields

VisibilityTypeNameDescription
publicCustomisationNetDataCurrentCustomisationCurrently applied customisation
publicRendererTargetRendererThe renderer to apply materials to

Methods

SignatureDescription
void ApplyCustomisation(CustomisationNetData data)Applies new customisation to renderer
void ApplyMaterial(Material material, Customisation slot)Applies material for a specific slot

PrisonCustomisationManager.cs

Assembly-CSharp/PrisonCustomisationManager.cs

Manages NPC customisation assignment within a prison.

Inherits: T17MonoBehaviour

Fields

VisibilityTypeNameDescription
public staticPrisonCustomisationManagerm_InstanceSingleton
publicintSeedSeed for deterministic customisation generation

Methods

SignatureDescription
void GenerateNPCCustomisation()Generates customisation for all NPCs
CustomisationNetData GetCustomisationForNPC(int npcID)Returns customisation for a specific NPC
void SerialiseToSave(SaveData data)Serialises NPC customisation for save
void DeserialiseFromSave(SaveData data)Restores NPC customisation from save

VisitorCustomisationManager.cs

Assembly-CSharp/VisitorCustomisationManager.cs

Manages visitor NPC customisation and gift data.

Inherits: T17MonoBehaviour

Fields

VisibilityTypeNameDescription
public staticVisitorCustomisationManagerm_InstanceSingleton

Methods

SignatureDescription
void GenerateVisitorCustomisation()Generates random customisation for visitors
CustomisationNetData GetVisitorCustomisation(int visitorID)Returns visitor's customisation
void SetVisitorCustomisation(int visitorID, CustomisationNetData data)Sets visitor's customisation

CustomisationDialogFrontendMenu.cs

Assembly-CSharp/CustomisationDialogFrontendMenu.cs

Frontend dialog for the customisation menu.

Inherits: T17DialogBox


CustomisationDialogTabMenu.cs

Assembly-CSharp/CustomisationDialogTabMenu.cs

Tabbed menu UI for selecting customisation categories.

Inherits: T17MenuBody


CustomisationFrontendMenu.cs

Assembly-CSharp/CustomisationFrontendMenu.cs

Main frontend customisation screen.

Inherits: T17MenuBody


CustomisationUnlockedHUD.cs

Assembly-CSharp/CustomisationUnlockedHUD.cs

HUD element displayed when new customisation item is unlocked.

Inherits: T17MonoBehaviour


CustomisationOptionsFE.cs

Assembly-CSharp/CustomisationOptionsFE.cs

Option items displayed in the customisation menu.

Inherits: BaseOptionItem


CustomisationToggleOption.cs

Assembly-CSharp/CustomisationToggleOption.cs

Toggle option for binary customisation choices (e.g. show hat).

Inherits: BaseOptionItem


CustomisationCharacterInfoFE.cs

Assembly-CSharp/CustomisationCharacterInfoFE.cs

Displays character info panel in customisation screen.

Inherits: T17MonoBehaviour


Global Game Flow

GlobalStart.cs

Assembly-CSharp/GlobalStart.cs

Main game state machine controlling the entire lifecycle: Boot → Frontend → Level → Results → (loop).

Inherits: T17MonoBehaviour

Fields / Properties

VisibilityTypeNameDescription
public staticGlobalStartInstanceSingleton
public staticGlobalStartModeCurrentModeCurrent game mode (enum)

Enum: GlobalStartMode

MemberDescription
NoneUninitialised
BootBoot sequence running
FrontEndIn frontend menus
LoadingLevel loading
InGameIn a level
ResultsResults screen active

Methods

SignatureDescription
void SetMode(GlobalStartMode mode)Transitions to a new mode
bool IsMode(GlobalStartMode mode)Checks current mode
void RequestLevelLoad(string levelName)Queues a level load
void RequestFrontEnd()Returns to frontend

GlobalSave.cs

Assembly-CSharp/GlobalSave.cs

Persistent key-value save system backed by JSON.

Inherits: T17MonoBehaviour

Fields

VisibilityTypeNameDescription
public staticGlobalSavem_InstanceSingleton
privateDictionary<string, object>m_SaveDataIn-memory save dictionary

Methods

SignatureDescription
void Save()Writes m_SaveData to disk as JSON
void Load()Reads JSON from disk into m_SaveData
void SetInt(string key, int value)Stores int
int GetInt(string key, int defaultValue = 0)Reads int
void SetFloat(string key, float value)Stores float
float GetFloat(string key, float defaultValue = 0f)Reads float
void SetString(string key, string value)Stores string
string GetString(string key, string defaultValue = "")Reads string
void SetBool(string key, bool value)Stores bool
bool GetBool(string key, bool defaultValue = false)Reads bool
void SetIntArray(string key, int[] value)Stores int array
int[] GetIntArray(string key)Reads int array
bool HasKey(string key)Checks if key exists
void DeleteKey(string key)Removes key
void DeleteAll()Clears all save data

GlobalLoader.cs

Assembly-CSharp/GlobalLoader.cs

Manages scene loading with loading screen.

Inherits: T17MonoBehaviour

Fields

VisibilityTypeNameDescription
public staticGlobalLoaderm_InstanceSingleton
publicstringLoadingScreenSceneLoading screen scene name

Methods

SignatureDescription
void LoadScene(string sceneName)Loads scene via loading screen
void LoadSceneDirect(string sceneName)Loads scene directly (no loading screen)
float GetLoadingProgress()Returns 0–1 loading progress

GlobalHintManager.cs

Assembly-CSharp/GlobalHintManager.cs

Manages hint/tip display system.

Inherits: T17MonoBehaviour

Fields

VisibilityTypeNameDescription
public staticGlobalHintManagerm_InstanceSingleton

Methods

SignatureDescription
void ShowHint(string hintKey)Shows a hint by key
void HideHint()Hides current hint
bool IsHintActive()Whether a hint is currently displayed

GlobalVision.cs

Assembly-CSharp/GlobalVision.cs

Manages vision/visibility queries for characters.

Inherits: T17MonoBehaviour

Fields

VisibilityTypeNameDescription
public staticGlobalVisionm_InstanceSingleton

Methods

SignatureDescription
bool HasLineOfSight(Vector3 from, Vector3 to, LayerMask blockingLayers)Raycast check between two points
bool IsInViewCone(Vector3 observer, Vector3 target, Vector3 forward, float angle, float range)Cone-of-vision check

GlobalCombatConfig.cs

Assembly-CSharp/GlobalCombatConfig.cs

Global combat configuration constants.

Fields

VisibilityTypeNameDescription
publicfloatBaseDamageBase melee damage
publicfloatKnockoutDurationKO recovery time in seconds
publicfloatCombatRangeMax combat range
publicfloatAttackCooldownTime between attacks

Flow Infrastructure

BaseFlowBehaviour.cs

Assembly-CSharp/BaseFlowBehaviour.cs

Abstract base class for flow state machines.

Inherits: T17MonoBehaviour

Fields

VisibilityTypeNameDescription
protectedboolm_IsCompleteWhether flow has completed

Methods

SignatureDescription
abstract void Enter()Called when flow becomes active
abstract void Exit()Called when flow transitions away
virtual void Update()Called each frame while active
bool IsComplete()Returns completion state

BaseComponentSetup.cs

Assembly-CSharp/BaseComponentSetup.cs

Base class for level component setup routines.

Inherits: T17MonoBehaviour

Methods

SignatureDescription
abstract void Setup()Performs setup logic
abstract void TearDown()Reverses setup

BaseZoneSetup.cs

Assembly-CSharp/BaseZoneSetup.cs

Base class for zone-specific setup.

Inherits: BaseComponentSetup

Fields

VisibilityTypeNameDescription
publicstringZoneNameName of the zone being set up

PersistentScripts.cs

Assembly-CSharp/PersistentScripts.cs

Container for scripts that should persist across scene loads.

Inherits: T17MonoBehaviour

Methods

SignatureDescription
override void Init()Marks GameObject as DontDestroyOnLoad

Flow State Machines

BootFlow.cs

(Included in TelemetryAnalytics wiki — boot state machine.)

FrontEndFlow.cs

Assembly-CSharp/FrontEndFlow.cs

Frontend flow state machine.

Inherits: BaseFlowBehaviour


LevelFlow.cs

Assembly-CSharp/LevelFlow.cs

In-game level flow state machine.

Inherits: BaseFlowBehaviour


HUDMenuFlow.cs

Assembly-CSharp/HUDMenuFlow.cs

HUD menu flow state machine.

Inherits: BaseFlowBehaviour


InGameMenuFlow.cs

Assembly-CSharp/InGameMenuFlow.cs

In-game pause/menu flow state machine.

Inherits: BaseFlowBehaviour


ResultsFlow.cs

Assembly-CSharp/ResultsFlow.cs

Results screen flow state machine.

Inherits: BaseFlowBehaviour


LoadingFlow.cs

Assembly-CSharp/LoadingFlow.cs

Loading screen flow state machine.

Inherits: BaseFlowBehaviour

On this page

OverviewCore FrameworkT17MonoBehaviour.csT17NetworkBehaviour.csT17BehaviourManager.csT17NetManager.csT17NetworkManager.csT17NetView.csT17NetConfig.csUI Widget SystemT17Button.csT17Text.csT17Image.csT17RawImage.csT17Toggle.csT17Slider.csT17Scrollbar.csT17ScrollView.csT17DropDown.csT17InputField.csT17Selectable.csT17TabPanel.csT17NavigableGrid.csT17MenuBody.csT17CounterObject.csT17FavourObject.csT17HintObject.csT17InfoObject.csT17TrackedUIElement.csT17StatsSlider.csT17UIAlphaFade.csT17AspectRatioFitter.csT17BlockKeyboardAutoFocus.csT17ControlMapper.csEvent SystemT17EventSystem.csT17EventSystemsManager.csIT17EventHelper.csDialog & Tooltip SystemT17DialogBox.csT17DialogBoxManager.csT17TooltipManager.csT17ItemTooltip.csCustomisation SystemCustomisation.csCustomisationManager.csCustomisationData.csCustomisationConfig.csCustomisationSet.csCustomisationCategorisedSet.csCustomisationConstraint.csCustomisationSerialiser.csCustomisationNetData.csCustomisationModifiedNetData.csCustomisationCollectionNetData.csCustomisationGeneratorTools.csCharacterCustomisation.csPrisonCustomisationManager.csVisitorCustomisationManager.csCustomisationDialogFrontendMenu.csCustomisationDialogTabMenu.csCustomisationFrontendMenu.csCustomisationUnlockedHUD.csCustomisationOptionsFE.csCustomisationToggleOption.csCustomisationCharacterInfoFE.csGlobal Game FlowGlobalStart.csGlobalSave.csGlobalLoader.csGlobalHintManager.csGlobalVision.csGlobalCombatConfig.csFlow InfrastructureBaseFlowBehaviour.csBaseComponentSetup.csBaseZoneSetup.csPersistentScripts.csFlow State MachinesBootFlow.csFrontEndFlow.csLevelFlow.csHUDMenuFlow.csInGameMenuFlow.csResultsFlow.csLoadingFlow.cs