GAME 1303 — Helper Scripts

Unity 6.x · New Input System · UI Toolkit

This is not a scripting course. These scripts are working, documented, and yours to
change. Your job is to read them, attach them, wire them up, and change their
values
— not to write systems from scratch.

Every script has a header comment explaining what it does, how to set it up, and
which value actually matters. Read the header before you attach the script.


Building the .unitypackage

  1. Open a new Unity 6.x project.
  2. Copy the Assets/GAME1303/ folder into it.
  3. Let Unity compile. Window → Package Manager → Input System must be installed,
    and Project Settings → Player → Active Input Handling set to Input System Package (New).
  4. Right-click Assets/GAME1303 → Export Package…
  5. Tick Include dependencies, name it HelperScripts.unitypackage.
  6. Upload to Canvas → Files → HelperScripts.

File manifest

Assets/GAME1303/
  Core/
    GameStateManager.cs    Playing / Paused / Won / Lost. The one source of truth.
    TriggerZone.cs         Any collider becomes an Inspector-wired event. Ex 3.
    Checkpoint.cs          Remembers where the player was. Ex 3.
  Movement/
    PlayerMove2D.cs        Side-scroll + top-down. Coyote time, jump buffer, dash. Ex 1, 2.
    PlayerMove3D.cs        CharacterController + VR locomotion modes. Ex 1, 8.
  Verbs/                   One per core mechanic — attach exactly one. Ex 2.
    Grabber.cs             Pick up, carry, throw.
    Shooter.cs             Fire a projectile.
    Projectile.cs          What Shooter fires. SET LIFETIME.
    Swapper.cs             Trade places with an object.
    Grappler.cs            Attach to an anchor and pull.
    Interactor.cs          Use the thing you're facing.
    Interactable.cs        Anything usable. Backbone of the Narrative track.
    DialogueTrigger.cs     A sequence of text beats, timed or input-advanced. Ex 6.
  Feedback/                Ex 4.
    SoundPlayer.cs         Named clips, called from anywhere. SoundPlayer.Play("jump")
    ScreenShake.cs         ScreenShake.Shake(amplitude, duration)
    HitFlash.cs            One frame of white. The cheapest juice there is.
  Progression/             Ex 9.
    Health.cs              Damage, invulnerability, death events.
    Score.cs               Score, combo, saved high score.
    Spawner.cs             Timed / wave spawning. rampRate IS your difficulty curve.
    ObjectPool.cs          Recycle instead of Instantiate/Destroy.
  UI/                      Ex 7. UI TOOLKIT, not uGUI Canvas.
    UIManager.cs           All five screens, driven by GameStateManager.
    GameUI.uxml            Title / HUD / Pause / Win / Lose in one document.
    GameUI.uss             Deliberately plain. Restyling it is the graded decision.
  Testing/
    PlaytestLogger.cs      Timestamped session log to disk. Ex 10 evidence.

22 files.


Which script do I need this week?

Week Exercise Scripts
1 First Playable PlayerMove2D or PlayerMove3D
3 The Verb one of the Verbs/ scripts
4 Rules & States GameStateManager, TriggerZone, Checkpoint
6 Juice It SoundPlayer, ScreenShake, HitFlash
7 Space & Pace TriggerZone, Checkpoint
9 Story in the World DialogueTrigger, Interactable, Interactor
10 Screen Flow UIManager + GameUI.uxml / .uss
12 Point of View (Cinemachine — no helper needed)
13 Curves & Locks Health, Score, Spawner, ObjectPool
14 Test & Iterate PlaytestLogger

Conventions used throughout

Input. Everything uses the New Input System. PlayerMove2D and the verb
scripts rely on Player Input with Behavior = Send Messages — an action named
Move calls OnMove(), an action named Dash calls OnDash(). The action name is
the wiring.
There is nothing else to connect.

Events. Public UnityEvent fields appear in the Inspector so you can wire
behaviour without code. C# event members exist alongside them for scripting.

Statics. SoundPlayer.Play(), ScreenShake.Shake(), Score.Add(), and
PlaytestLogger.Log() are callable from anywhere and safely do nothing if that
object isn't in the scene. You can add the audio later without breaking anything.

Gizmos. Ranges and trigger volumes draw in the Scene view. Trigger colliders are
invisible at runtime, so this is often the only way to see what you built.

Add Component menu. Everything lives under GAME 1303/ grouped by folder.


Required project setup

Setting Value
Input System package Installed via Package Manager
Active Input Handling Input System Package (New)
Player tag Your player GameObject must be tagged Player
Tags to create Grabbable, Swappable, Anchor, Enemy
Scene list Every scene you load must be in Build Profiles → Scene List

Rules for using this library

  1. Read the header comment before you attach the script.
  2. Modify freely. Changing a helper is encouraged and never penalized.
  3. Credit it. List which helpers you used in your Game Design Doc and build notes.
  4. If a helper fights your design, cut it. These are scaffolding for the common
    cases, not a required architecture.