Scripting / Level & Utility
NotificationCenter
Displays in-game pop-up messages from any script. Call it statically — always pair with resolution = false; yield break; when signalling instruction failure.
MessageType Enum
| Value | Icon | Use case |
|---|---|---|
Message | Info | Neutral feedback — e.g. "Can't do that while carrying an object". |
Warning | Warning | Player-caused blockage — e.g. "The path is blocked", "Out of stamina". |
Error | Error | Execution failure — e.g. "A non-valid instruction was found". |
Static Methods
| Method | Description |
|---|---|
Notify(MessageType type, string message) | Spawns a pop-up notification with the appropriate icon. Safe to call from anywhere including inside coroutines. |
Usage in Instructions
protected override IEnumerator Tick(ExecutionContext ctx) { if (ctx.carryingObject) { NotificationCenter.Notify( NotificationCenter.MessageType.Message, "Can't do that while carrying an object"); resolution = false; yield break; } if (ctx.player.stamina.currentValue < 2) { NotificationCenter.Notify( NotificationCenter.MessageType.Warning, "Not enough stamina!"); resolution = false; yield break; } // … instruction logic }