39 [Header(
"Scene Controllers")]
107 canSwapper.OnVariantChanged += (_, v) => SetLabel(
variantLabel, $
"Brand: {v.variantName}");
110 backgroundController.OnPresetChanged += (_, p) => SetLabel(
backgroundLabel, $
"Scene: {p.presetName}");
120 void OnToggleAutoRotate()
123 RefreshRotationLabel();
127 void RefreshAllLabels()
129 SetLabel(
variantLabel, $
"Brand: {canSwapper?.CurrentVariantName}");
130 SetLabel(
backgroundLabel, $
"Scene: {backgroundController?.CurrentPresetName}");
131 RefreshRotationLabel();
135 void RefreshRotationLabel()
144 static void SetLabel(TextMeshProUGUI label,
string text)
146 if (label !=
null) label.text = text;
Cycles through BackgroundPreset entries by writing to MaterialPropertyBlocks.
Cycles through brand variants by replacing the full material array on the can renderer.
Spherical-coordinate camera that orbits around a target Transform.
bool IsAutoRotating
Returns true when auto-rotation is active.
void ToggleAutoRotate()
Flips the auto-rotation state.
Connects Unity UI buttons and TextMeshPro labels to the three scene controllers.
TextMeshProUGUI rotationLabel
Displays the current auto-rotation state, e.g. "Auto-Rotate: ON".
Button nextColorButton
Advances to the next can brand variant.
OrbitCamera orbitCamera
Reference to the orbital camera. Drives rotation toggle and reset.
Button prevColorButton
Steps back to the previous can brand variant.
Button nextBgButton
Cycles to the next studio background preset.
TextMeshProUGUI backgroundLabel
Displays the current background preset name, e.g. "Scene: Dark Studio".
TextMeshProUGUI variantLabel
Displays the current brand name, e.g. "Brand: Coca-Cola".
BackgroundController backgroundController
Reference to the background controller. Drives scene preset cycling.
Button autoRotateButton
Toggles OrbitCamera auto-rotation on/off.
CanMaterialSwapper canSwapper
Reference to the can material swapper. Drives brand cycling.
Button resetCameraButton
Resets the camera to its default framing.