Hot State¶
Change a line and press Run again, without losing the score, the speed, or the count the script already reached. Play Mode stays running. Fields that are still in the code, with the same name and the same type, keep the value they had.
Hot State is off until you turn it on.
ZenCoder → Preferences → General → Hot State
Nothing is written into the scene. The values live only in this run.
1.2.0 · Shoshin
Introduced in the v1.2.0 release.
Keep the count¶
int coins;
float speed = 4f;
public void Update(float deltaTime)
{
coins++;
transform.position += Vector3.right * speed * deltaTime;
}
Turn Hot State on. Press Run and let coins climb. Change the movement line. Press Run again.
coins is still where it climbed. speed is still 4. Only the code you changed is new.
Start over when the field changes¶
Rename coins to score, or change it from int to float, and press Run. That value starts from the code again. A new name or a new type is a new field.
Stop ends the run¶
Press Stop. The remembered values are dropped. The next Run starts from the numbers written in the script: coins at 0, speed at 4.
Leaving Play Mode ends the run as well. Coming back starts from the code.
Stop and Run still clean up coroutines, listeners, and spawned objects. Hot State only preserves matching fields.