CRTTurnOnController Script Breakdown
Overview
TheCRTTurnOnControllerscript handles the interaction and display behavior of an in-game computer interface, particularly focusing on emotion-based animations, dialogues, and various UI elements.
Key Variables and Enums
Emotion: Enum representing various emotional states.
currentEmotion: Tracks the current emotion state.
dialogQueue: Queue to manage multiple dialogues.
waitingForInput: to check if input is awaited.
turnOnValue: Float to manage the "turn on" animation state.
baseVolume: Base volume for audio adjustments.
Emotion: Enum representing various emotional states.
currentEmotion: Tracks the current emotion state.
dialogQueue: Queue to manage multiple dialogues.
waitingForInput: to check if input is awaited.
turnOnValue: Float to manage the "turn on" animation state.
baseVolume: Base volume for audio adjustments.
Key Methods
GetPitchRangeForCurrentEmotion(): Returns pitch adjustments based oncurrentEmotion.
GetTypingSpeedForCurrentEmotion(): Returns typing speed adjustments based oncurrentEmotion.
TurnOn(): Activates the display object and starts the "turn on" sequence.
TurnOff(): the display object and stops related effects.
ShowDialog(DialogTemplate template): Manages dialog display.
ChangeEmotion(Emotion emotion): Changes the current emotion and triggers related animations.
PlayAnimation(Texture2D[] textures): to play animations based on the provided textures.
ShowNextSubtitle(): Manages subtitle display in sequence.
GetPitchRangeForCurrentEmotion(): Returns pitch adjustments based oncurrentEmotion.
GetTypingSpeedForCurrentEmotion(): Returns typing speed adjustments based oncurrentEmotion.
TurnOn(): Activates the display object and starts the "turn on" sequence.
TurnOff(): the display object and stops related effects.
ShowDialog(DialogTemplate template): Manages dialog display.
ChangeEmotion(Emotion emotion): Changes the current emotion and triggers related animations.
PlayAnimation(Texture2D[] textures): to play animations based on the provided textures.
ShowNextSubtitle(): Manages subtitle display in sequence.
Important Coroutine Methods
GlitchAtRandomIntervals(): Triggers glitch animations at random intervals.
PlayGlitchAnimation(): Plays a glitch animation sequence.
WaitAndChangeEmotion(float waitTime, Emotion newEmotion): Waits for a specified time before changing the emotion.
TurnOnEffect(): Manages the visual and auditory effects of turning on the display.
GlitchAtRandomIntervals(): Triggers glitch animations at random intervals.
PlayGlitchAnimation(): Plays a glitch animation sequence.
WaitAndChangeEmotion(float waitTime, Emotion newEmotion): Waits for a specified time before changing the emotion.
TurnOnEffect(): Manages the visual and auditory effects of turning on the display.
UI and Interaction Elements
Buttons, lights, text display, and materials are manipulated to reflect the game's state and reactions to player interactions.
Buttons, lights, text display, and materials are manipulated to reflect the game's state and reactions to player interactions.
Emotion-Based Dynamics
The script uses theEmotionenum extensively to modify audio-visual elements like pitch, typing speed, and textures to convey different emotional states.
The script uses theEmotionenum extensively to modify audio-visual elements like pitch, typing speed, and textures to convey different emotional states.
GameManager Script Breakdown
Overview
TheGameManagerscript is central to managing the game's state, including player stats, game progress, and handling various game events.
Key Variables and Enums
Skill,Popularity,Energy,GamerPoints: Player stats.
turnNumber,: Track game progress.
CurrentPosition: Enum for player's career position.
PIPs: Array tracking performance improvement plans.
PlayerName,PlayerNames: Player identification.
Skill,Popularity,Energy,GamerPoints: Player stats.
turnNumber,: Track game progress.
CurrentPosition: Enum for player's career position.
PIPs: Array tracking performance improvement plans.
PlayerName,PlayerNames: Player identification.
Key Methods
UpdatePlayerPosition(int diceResult, int energySold): Updates player's position on the board.
resetScene(): Resets the game scene to initial settings.
CheckForPromotionOrGameOver(): Checks conditions for promotion or game over scenarios.
ShowPromotionOrDemotionDialog(Position CurrentPosition, Position newPosition): Displays dialogues for promotion or demotion events.
UpdatePlayerPosition(int diceResult, int energySold): Updates player's position on the board.
resetScene(): Resets the game scene to initial settings.
CheckForPromotionOrGameOver(): Checks conditions for promotion or game over scenarios.
ShowPromotionOrDemotionDialog(Position CurrentPosition, Position newPosition): Displays dialogues for promotion or demotion events.
Important Coroutine Methods
ResetWaits(): Manages wait times for various game transitions.
ResetWaits(): Manages wait times for various game transitions.
Game State Management
Manages transitions between different game states, like game over, promotions, and scene resets.
Controls various game elements like lights, camera effects, and player piece.
Manages transitions between different game states, like game over, promotions, and scene resets.
Controls various game elements like lights, camera effects, and player piece.
Interaction with Other Scripts
Interacts withPlayerController,DiceRoller,TraitManager, and other scripts to manage the overall game flow.
Interacts withPlayerController,DiceRoller,TraitManager, and other scripts to manage the overall game flow.
Player Progression and Stat Management
Manages player's career progression and stat changes based on in-game events and decisions.
Manages player's career progression and stat changes based on in-game events and decisions.
Notes for Future Reference
Keep in mind the interaction betweenGameManagerand other scripts likeDiceRollerandPlayerController.
CRTTurnOnController's handling of emotions and dialogues can be critical for narrative elements.
Remember the core functionalities likeUpdatePlayerPositioninGameManagerfor game mechanics discussions.
Keep in mind the interaction betweenGameManagerand other scripts likeDiceRollerandPlayerController.
CRTTurnOnController's handling of emotions and dialogues can be critical for narrative elements.
Remember the core functionalities likeUpdatePlayerPositioninGameManagerfor game mechanics discussions.