BoughtSkillOrbReplacer
A class in Root.Township, the global namespace.
The orb for a skill a player already owns on the progression board. Pulling it away and holding it for timeToBreak seconds sells the skill back. Synced by the server.
- Listed in Global namespace: A to B
- Inherits or implements
ProgressionSlotContainer
Constructors
| Member | What it is |
|---|---|
BoughtSkillOrbReplacer() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
8 private and internal fields
| Member | What it is |
|---|---|
private BoughtSkillVisualizer boughtSkillVisualizer | The skill visualizer this orb is anchored to. Used for the locked effect and to block grabs while it is in use. |
private FixedJoint fixedJoint | Joint holding the orb to the visualizer's anchor body. Added on first anchor. |
private AnimationCurve hapticOverDuration | Haptic strength over the pull-out progress. |
private bool hasVisualizer | Whether an experience fill visualizer was given. |
private float minDistanceToBreak | Squared distance the hand must pull from the start point before progress counts. |
private MethodSyncStruct<bool> syncDependencyLock | Message used to send IsLockedByDependencies to clients. |
private float timeToBreak | Seconds the orb must be held pulled out before it operates. |
private ExperienceFillVisualizer visualizer | Fill visualizer showing the sell progress. |
Properties
Methods
| Member | What it is |
|---|---|
override void Initialize() | Sets up the dependency lock sync and the destroy effect. |
override void InitializeSlot(ProgressionSlot slot, Player targetPlayer) | Sets the slot and player, then checks the dependency lock. |
override void OnConnected(Player player) | Server: sends the dependency lock state to a joining player. |
void RepositionAndAnchor(BoughtSkillVisualizer boughtSkillVisualizer, ExperienceFillVisualizer visualizer) | Joins the orb to the board's anchor body with a fixed joint and links the sell visualizer. |
void UpdateDependencyLock(PlayerProgressionManager manager) | Server: rechecks whether the skill is locked by dependencies and syncs any change. |
protected override void EndInteraction(Interactable arg1, Interactor arg2) | Ends the sell progress visual when let go. |
protected override void FilterInteraction(Interactor interactor, Interactable interactable, ref bool result) | Blocks grabbing while locked by dependencies (playing a locked effect) or while the board is in use. |
protected override IEnumerator HeldDurationCheck(Interactor interactor) (iterator) | While held away from its spot, fills the sell progress with haptics. When full it sends the operate message and drops the orb. |
protected override void Operate(PlayerProgressionManager targetManager) | Sells the skill: locks the slot in the player's PlayerProgressionManager, which refunds part of the experience. |
2 private and internal methods
| Member | What it is |
|---|---|
private void SceneDestroy(NetworkEntity entity, bool isUnload) | Client: plays the orb destroy effect when the entity is destroyed other than by unload. |
private void SyncDependencyLock(IPlayer player, Stream stream, bool isLockedByDependencies) | Receives the dependency lock state from the server and stores it in IsLockedByDependencies. |
Used in
Members of other types that take, return or hold a BoughtSkillOrbReplacer: