Tier 2 Series 102

102F: The Tooltip Protocol

Pilot Record
Student Profile
"A mysterious button labeled "X" is a lawsuit waiting to happen. In Unity, exposing a variable like thrust without explaining units (Newtons? Horsepower?) leads to bad tuning. A skilled Engineer audits for Contextual Documentation."

The Concept: [Tooltip] & [Range]

Code isn't just for the compiler; it's for the humans on your team.

* **[Tooltip("...")]:** Adds a hover-over popup in the Inspector explaining the variable.
* **[Range(min, max)]:** Turns a number field into a Slider, enforcing safe limits (e.g., 0% to 100%).
Red Flag Detected

The AI Trap: "The Mystery Value"

You ask the AI: "Add a variable for engine heat."

// AI-Generated Code: Ambiguous
public class Engine : MonoBehaviour {
    // Audit Fail: Is this degrees C? F? A percentage?
    // What happens if I set it to 5000?
    public float heatLevel; 
}

This is "Context Vacuum." A designer might set heat to 100 thinking it's a percentage, causing the engine to explode instantly.

Elite Telemetry

Research shows "Elite" teams achieve 15% faster lead times by keeping AI on a "very tight leash."

  • Small Batches Solving one problem at a time prevents logic drift.
  • Modular Design Localizing the "blast radius" of AI changes.
  • Tight Loops Rapid iteration with constant code review.

The Pilot's Correction

Corrective Protocol
public class Engine : MonoBehaviour {
    // Corrected: Self-documenting and safe
    [Tooltip("Engine Temp in Celsius. Overheats at 100.")]
    [Range(0f, 150f)] // Slider prevents accidental "5000" input
    public float heatLevel; 
}
Your Pilot Command
> Capstone Mission: Audit the AI output to ensure a high-performance, responsive UI layout.
Next Mission
The Inspector Exam