AI Command Lab // Flight Simulator
101A: The Inspector Audit
Initial AI Output (Fragile)
// AI-Generated Code: Exposed and Dangerous
public class PlayerJump : MonoBehaviour {
// Audit Fail: Other scripts can accidentally change this!
public float jumpForce = 10f;
}
Initial AI Prompt
"You ask the AI: "Make the player's jump force adjustable in the Inspector.""
Pilot Comm Link
Mission Objective: Use the Input System Package to handle player actions rather than the old Input Manager.
Optimized Protocol
// Corrected: Protected and Tunable
public class PlayerJump : MonoBehaviour {
// Audit Pass: Only this script can change it via code,
// but the Designer can tune it in Unity.
[SerializeField] private float jumpForce = 10f;
}