Skip to main content

AddUnlockToPlayer

A class in Root.Township, Features.Gameplay.

Networked behaviour that gives a player a permanent PlayerUnlock, usually wired to an interaction. The unlock is saved with the object.

Constructors​

MemberWhat it is
AddUnlockToPlayer()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

1 private and internal field
MemberWhat it is
private PlayerUnlock playerUnlockBacking field for PlayerUnlock; also saved and loaded.

Properties​

MemberWhat it is
PlayerUnlock PlayerUnlock { get; }The unlock this object hands out.

Methods​

MemberWhat it is
void AddUnlock(Player player)Server: gives the player (or the interactable's last interactor) the permanent unlock. Does nothing if none is set.
void AddUnlock(Interactable interactable)Server: gives the player (or the interactable's last interactor) the permanent unlock. Does nothing if none is set.

Used in​

Members of other types that take, return or hold a AddUnlockToPlayer: