AI Command Lab // Flight Simulator
101B: Serialization Limits
Initial AI Output (Fragile)
// AI-Generated Code: Valid C#, but Invisible in Unity
public class ItemStats {
public int weight;
public int cost;
}
public class Inventory : MonoBehaviour {
public ItemStats stats; // Audit Fail: Won't show up!
}
Initial AI Prompt
"You ask the AI: "Create a class to store Inventory Item stats and show it in the Inspector.""
Pilot Comm Link
Mission Objective: Direct the AI to use ReadValue to get the vector for 2D movement.
Optimized Protocol
// Corrected: Visible and Editable
[System.Serializable] // The Magic Tag
public class ItemStats {
public int weight;
public int cost;
}
public class Inventory : MonoBehaviour {
public ItemStats stats; // Audit Pass: Now shows a foldout!
}