A class in Root.Township, the global namespace.
The player's mouth as a liquid container. On the server, liquid poured in is drunk at once: it's emptied, its effects are applied and an event is synced to clients.
Constructors
| Member | What it is |
|---|
PlayerDrinkingMouth() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
6 private and internal fields
| Member | What it is |
|---|
private MethodSync callLiquidConsumed | Method sync used to send the drink message to clients. |
private ConsumptionManager consumer | The consumption manager that checks liquids and applies their effects. |
private ILiquidContainer container | The liquid container on this object. |
private float effectHandlingStrength | Serialized value that nothing in the class reads. |
private static Logger logger | NLog logger; logs each drink at info level. |
private AltaEvent onLiquidConsumed | Client: event run when the player drinks, such as a sound or effect. |
Methods
| Member | What it is |
|---|
override void Initialize() | Sets up the drink event sync and, on the server, listens for the content level going up. |
4 private and internal methods
| Member | What it is |
|---|
private void Awake() | Gets the liquid container and adds a filter that only lets in liquids the player can consume. |
private void HandleLiquidAdd(LiquidData liquidData, ref bool result) | Liquid filter that refuses liquids consumer can't consume. |
private void LiquidAmountChanged(ILiquidContainer container, int oldLevel, int newLevel) | Server: when liquid goes in, empties the container, applies its effects, adds ingredient pages and tells clients. |
private void SyncLiquidConsumedEvent(IPlayer player, Stream stream) | Client: runs onLiquidConsumed when the server sends the drink message. |
Used in
Members of other types that take, return or hold a PlayerDrinkingMouth: