Skip to main content

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.

Constructors​

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

Fields​

MemberWhat it is
protected MethodSync syncOperateMessage a client sends when the hold completes. The server then destroys or drops the orb and calls Operate.
14 private and internal fields
MemberWhat it is
private readonly int _MainTexShader property id for the icon texture.
private PooledObject activeOperatingEffectEffect shown while the orb is being held.
private Coroutine heldDurationCheckCoroutine that waits for the hold to finish.
private MaterialPropertyBlock internalModelBlockProperty block for the inner model's icon.
private Renderer internalModelRendererInner model that shows the slot's icon.
private bool isInteractableTrue only on the target player's client.
private int maxSerializationHighest SkillStatus value.
private TransformEvent operateConcludedEffectEvent run when the orb is used.
private PooledObjectDefinition operatingEffectPooled effect shown while held.
private Pickup pickupThe orb's pickup.
private Renderer shellRendererThe orb's outer shell.
private TransformEvent spawnEventEvent run on clients a frame after spawn.
private MethodSync syncSetupSync for the slot and target player.
private Player targetPlayerThe only player who can use this orb.

Properties​

MemberWhat 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
MemberWhat it is
private Material ISkillOrb.ShellMaterial { get; }The shell renderer's shared material.

Methods​

MemberWhat 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
MemberWhat 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.