FlyCamHands
A class in Root.Township, the global namespace.
Controller extension on the fly cam's hands: sparks or explosions, invisibility toggle and mic mute shortcuts. Actions are synced so other players see them.
- Listed in Global namespace: E to H
- Inherits or implements
ControllerExtension - Nested types
Controls
Constructors
| Member | What it is |
|---|---|
FlyCamHands() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
6 private and internal fields
| Member | What it is |
|---|---|
private PooledObjectDefinition damageDefinition | Pooled object spawned for the explosion hit; its FixedImpactor is charged. |
private FlyCamPlayer flyCam | The owning FlyCamPlayer. |
private FlyCamInput flyCamInput | Fly cam input actions, read for the explosion modifier. |
private MODSMicMuteQuickAccessAction modMuteAction | Quick access action used for the mod mic mute. |
private PooledObjectDefinition sparkDefinition | Pooled FlintSpark spawned by the spark action. |
private MethodSyncStruct<FlyCamHands.Controls> syncInput | Method sync for the spark, invisibility and hit actions. |
Methods
| Member | What it is |
|---|---|
override void InitializeControllerExtension() | Sets up the input sync message (SyncE). |
override void OnConnectedToPlayer(Player player) | Sends the current visibility to a joining player. |
protected override void Awake() | Hooks the debug spark, debug invisibility, mute and mod mute actions and enables the fly cam input map. |
7 private and internal methods
| Member | What it is |
|---|---|
private void InvisibilityPressed(PlayerInput controller) | Toggles whether the fly cam's name shows (its visibility), shows a message and syncs it. |
private bool IsTriggeringExplosionInsteadOfSparks() | True when grab is held or the explosion modifier input is pressed. |
private void ModMuteMic(PlayerInput playerInput) | Runs the mod mic mute quick action from the left controller. |
private void MuteOwnMic(PlayerInput playerInput) | Toggles the local Vivox mic mute and shows the new state. |
private void ReceiveControls(IPlayer player, Stream stream, FlyCamHands.Controls input) | Sync handler: on read replays a spark, visibility change or hit, and the server relays it. Rejects messages from other players. |
private void Spark() | On the owner or server, spawns a forced flint spark; the server also simulates sparks so fires can light. |
private void SparkPressed(PlayerInput controller) | Spawns a damaging FixedImpactor in front if the explosion modifier is held, else sparks, then syncs which. |