ProgressionSlotContainer
An abstract class in Root.Township, the global namespace.
Base for a skill orb at a skill shrine that a player holds to buy or sell a skill slot (SkillOrbReplacer, BoughtSkillOrbReplacer). Only the target player can grab it; the server runs Operate.
- Listed in Global namespace: P
- Inherits or implements
NetworkEntityBehaviour,ISkillOrb - Derived types
BoughtSkillOrbReplacer,SkillOrbReplacer
Constructors
| Member | What it is |
|---|---|
protected ProgressionSlotContainer() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
| Member | What it is |
|---|---|
protected MethodSync syncOperate | Message a client sends when the hold completes. The server then destroys or drops the orb and calls Operate. |
14 private and internal fields
| Member | What it is |
|---|---|
private readonly int _MainTex | Shader property id for the icon texture. |
private PooledObject activeOperatingEffect | Effect shown while the orb is being held. |
private Coroutine heldDurationCheck | Coroutine that waits for the hold to finish. |
private MaterialPropertyBlock internalModelBlock | Property block for the inner model's icon. |
private Renderer internalModelRenderer | Inner model that shows the slot's icon. |
private bool isInteractable | True only on the target player's client. |
private int maxSerialization | Highest SkillStatus value. |
private TransformEvent operateConcludedEffect | Event run when the orb is used. |
private PooledObjectDefinition operatingEffect | Pooled effect shown while held. |
private Pickup pickup | The orb's pickup. |
private Renderer shellRenderer | The orb's outer shell. |
private TransformEvent spawnEvent | Event run on clients a frame after spawn. |
private MethodSync syncSetup | Sync for the slot and target player. |
private Player targetPlayer | The only player who can use this orb. |
Properties
| Member | What it is |
|---|---|
Transform InternalModelTransform { get; } | Transform of the icon model inside the orb. |
Pickup Pickup { get; } | The orb's Pickup. |
Renderer ShellRenderer { get; } | Renderer of the orb's outer shell. |
ProgressionSlot Slot { get; private set; } | The skill slot this orb buys or sells. |
protected abstract bool DestroyAfterOperate { get; } | Whether the orb is destroyed after operating, or just dropped. |
1 private and internal property
Methods
| Member | What it is |
|---|---|
override void Initialize() | Sets up the setup and operate messages and plays the spawn effect. |
override void InitializeAsServer(SpawnData spawnData) | Server: marks the pickup as not saved. |
virtual void InitializeSlot(ProgressionSlot slot, Player targetPlayer) | Sets the slot and target player, shows the slot icon, and on the server syncs the setup. |
override void OnConnected(Player player) | Server: sends a joining player the orb's setup. |
protected virtual void EndInteraction(Interactable arg1, Interactor arg2) | Stops the hold check and the operating effect when let go. |
protected virtual void FilterInteraction(Interactor interactor, Interactable interactable, ref bool result) | Blocks grabbing unless the local player is the orb's target player. |
protected abstract IEnumerator HeldDurationCheck(Interactor interactor) | Implemented by subclasses: runs while held and sends syncOperate once held long enough. |
protected abstract void Operate(PlayerProgressionManager targetManager) | Implemented by subclasses: buys or sells the slot for the target player. Server only. |
protected void ReleaseOperatingEffect() | Stops the effect played while holding. |
protected void RequestOperatingEffect() | Starts the effect played while holding, if not already playing. |
protected virtual void StartInteraction(Interactable interactable, Interactor interactor) | Starts the hold check when grabbed, if interactable. |
protected virtual void SyncSetup(IPlayer player, Stream stream) | Syncs the path, slot hash and target player id. Clients look up the slot and initialise. |
3 private and internal methods
| Member | What it is |
|---|---|
private void Awake() | Hooks the pickup's interaction filter and start and end events. |
private void SetupRenderer() | Client: shows the slot's icon on the inner model, or hides it if there is none. |
private void SyncOperate(IPlayer player, Stream stream) | Server: plays the done effect, drops or destroys the orb, and runs Operate. It does not check who sent it. |