EquipmentCustomizationRoom
A class in Root.Township, Alta.Customization.
Client: the room spawned for a player's equipment (dress-up) mode, with a dummy that shows their customization and copies their pose. EquipmentState links and unlinks it.
- Listed in Customization and screenshots
- Inherits or implements
MonoBehaviour
Constructors
| Member | What it is |
|---|---|
EquipmentCustomizationRoom() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
11 private and internal fields
| Member | What it is |
|---|---|
private Transform bodyTransform | Body transform of the dummy, passed to the rig poser. |
private Transform boundaryTransform | The room boundary. Its x scale times two is the distance the player can walk away. |
private TransformDeltaChangeChecker changeChecker | Watches the player's head and controllers and fires when all of them have stayed still long enough. |
private PlayerCustomizationHandler customizationHandler | Customization handler for the dummy, attached to the player's customization. |
private CharacterDummyPointer dummyPointer | Points to the character dummy used in the room. |
private BoneIdentifier head | Which bone of the dummy rig is the head. |
private PlayerCharacter linkedPlayerCharacter | The linked player's PlayerCharacter. Pose copying is only set up when the controller is one. |
private AltaCoroutine playerLeftBoundaryChecker | Running CheckIfOutsideBoundary coroutine. |
private AltaCoroutine poseCheckingDelay | Running DelayPoseChecking coroutine. |
private CharacterRigPoser poser | Copies the player character's pose onto the dummy rig. |
private EquipmentRoomAnimator roomAnimator | Plays the room's appear and disappear animations. |
Properties
| Member | What it is |
|---|---|
CharacterDummy Dummy { get; private set; } | The character dummy in the room, set by LinkToPlayer. |
Transform DummyHead { get; private set; } | The dummy's head bone, used to aim the camera flash. |
Player Player { get; private set; } | The player the room is linked to. |
1 private and internal property
| Member | What it is |
|---|---|
private EquipmentStateSettings Settings { get; set; } | The equipment state settings, loaded in Awake. |
Events
| Member | What it is |
|---|---|
event Action PlayerLeftBoundary | Raised when the player has stayed outside the room boundary for too long. |
Methods
| Member | What it is |
|---|---|
void LinkToPlayer(Player player) | Starts the room for a player: attaches their customization to the dummy, sets up pose copying and the boundary check, and plays the appear animation and sound. |
void Unlink() | Stops pose copying and the boundary check, destroys the customization handler and plays the disappear animation, which then destroys the room. |
7 private and internal methods
| Member | What it is |
|---|---|
private void AttemptToCopyPose() | When the player holds still, poses the dummy like them and, if set up, flashes the screen and plays the pose sound. |
private void Awake() | Loads the EquipmentStateSettings for the room. |
private IEnumerator CheckIfOutsideBoundary() (iterator) | Coroutine: while the player's feet are outside the boundary, ramps up controller haptics and raises PlayerLeftBoundary after the set time. |
private IEnumerator DelayPoseChecking() (iterator) | Coroutine: waits the settings' start delay, then starts watching the player's head and hands for a freeze. |
private void DestroyRoom() | Destroys the room object once its disappear animation ends. |
private bool IsValidDummyBone(Transform bone) | Bone filter for the poser: only bones whose names end in _jnt. |
private void SetupPoseCopying() | Creates the change checker on the player's head and controllers and the rig poser that copies their pose to the dummy. |
Used in
Members of other types that take, return or hold a EquipmentCustomizationRoom: