IT201_Sprint2_Felobateer_Shenoda
New Features:
Feature 1 – Gravity Toggle
Input: Checkbox (Toggle UI element)
Process: When the toggle is checked or unchecked, the script loops through all spawned shapes in the scene and sets their Rigidbody.useGravity to true or false.
Output: Shapes immediately start falling with gravity or float in place, depending on toggle.
Feature 2 – Clear All Shapes Button
Input: Button click
Process: When the user clicks the Clear All Shapes button, the script finds all spawned shapes tagged with spawned tag and destroys them.
Output: All shapes are removed from the scene.
Feature 3 – Hold R to Rotate Shapes
Input: Holding the R key on the keyboard
Process: While the R key is held down, each shape rotates continuously using Time.deltaTime to ensure smooth rotation over time.
Output: All shapes spin as long as the key is pressed.
Feature 4 – Randomized Shape Colors
Input: Mouse click to spawn shape
Process: Each time a new shape is spawned, the script generates a random color and applies it to the shape’s material.
Output: Each spawned shape appears with a unique random color.
Feature 5 – Ground Color Dropdown
Input: Dropdown selection
Process: When the user picks a color from the dropdown menu, the script updates the material color of the
ground plane.
Output: The ground color changes to the selected color.
Difference from class project: The instructor project did not allow customizing ground color.
Feature 6 – Reset Size Button
Input: Button click
Process: When the user clicks the reset size button, the script resets the size slider to a default scale value so
future spawned shapes return to default size.
Output: The slider UI resets and new shapes spawn at the default size.
Difference from class project: The instructor project did not include a reset control for adjusting size
Old Features:
Feature 1: Display Mouse Position
Input: Mouse moving anywhere on the screen
Process: The script reads mouse X and Y coordinates
Output: Text updates live showing the mouse position on the screen
Feature 2: Spawn Shape on Button Click
Input: User clicks the “Drop Shape” button
Process: The script converts mouse screen position to world coordinates and spawns the selected 3D shape prefab at that position
Output: A 3D shape appears at the mouse location in the scene
Feature 3: Change Shape Type
Input: User selects shape type from dropdown menu
Process: The script changes which prefab is used when spawning new shapes
Output: New shapes spawned use the selected shape type (cube, sphere, or cylinder)
Feature 4: Change Shape Size
Input: User adjusts size slider
Process: The script changes the scale factor applied to newly spawned shapes
Output: New shapes spawn with the selected size
Feature 5: Destroy Shapes and Count
Input: User clicks on a spawned shape
Process: The shape detects the click, destroys itself, and increases count.
Output: The shape disappears, and the destroyed count on UI updates