Skip to main content

SkillShrineTestingArea

A class in Root.Township, the global namespace.

The practice area of a skill shrine. When a skill orb is opened it spawns that skill's practice objects, shows the border and moves a copy of the orb into place. Get it from SkillShrine.TestingArea.

Constructors​

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

Fields​

36 private and internal fields
MemberWhat it is
private readonly int _ProgressShader property ID for the border's fade progress.
private float accelerationAcceleration of the orb flying to its spot.
private ActionGlyphsPlacer actionGlyphPlacerShows action glyphs for the open skill.
private PooledObject activeOrbThe pooled orb effect shown at the training spot.
private float androidBorderYScaleDeclared but not used in this class.
private Coroutine areaAnimationThe running border fade coroutine.
private float borderFadeDurationSeconds the border takes to fade in or out.
private Material borderMaterialMaterial instance on the border renderer.
private Renderer borderRendererThe area's border renderer, made from the prefab on first use.
private Transform borderRendererParentParent for the border renderer.
private Renderer borderRendererPrefabPrefab for the area's border.
private bool isOpenWhether a skill's practice area is open.
private uint lastOpenedSlotHashSlot hash of the last opened orb; opening the same slot again only resets movable items.
private float maxDistanceForItemsSquaredSquared flat distance a movable practice item can stray before it respawns.
private float moveSpeedTop speed of the orb flying to its spot.
private PooledObjectDefinition objectFadeOutEffectEffect played when practice props fade out.
private Material objectFadeOutMaterialMaterial used when practice props fade out.
private TransformEvent onPracticedCurrentSkillEvent raised with this transform whenever the skill is practiced.
private SkillOrb openSkillOrbThe skill orb that opened the area.
private Coroutine orbAnimationThe running orb flight coroutine.
private PooledObjectDefinition orbEffectDefinitionPooled effect used for the orb at the training spot.
private Renderer practicedConfirmationRendererRing shown when a skill is practiced for the first time.
private Transform practicedConfirmationRendererParentParent for the confirmation ring.
private Renderer practicedConfirmationRendererPrefabPrefab for the confirmation ring.
private Coroutine scaleAnimationThe running confirmation ring coroutine.
private float scaleAnimationDurationSeconds the confirmation ring animation lasts.
private AnimationCurve scaleCurveOnPracticedVerticalCurve for the ring's vertical scale over the animation.
private float scaleLerpSpeedHow fast the orb scales to size as it nears its spot.
private SkillShrine shrineThe skill shrine this area belongs to.
private List<SkillShrineTestingArea.SpawnedEntity> spawnedEntitiesThe networked practice entities spawned on the server.
private List<PracticeAreaShrinkFader> spawnedStaticContentThe local static practice props.
private Transform spawnFolderParent and centre point for spawned practice content.
private MethodSync syncSkillMethod sync for the open state and skill orb.
private Transform trainingOrbPositionWhere the orb flies to; its scale sets the orb's final size.
private AltaEvent trainingOrbReachedPositionEvent raised when the orb reaches its spot.
private IUnityUpdateMethod updateHandle for the budgeted distance check.

Properties​

MemberWhat it is
bool IsTestingOrbInPlace { get; private set; }Client: true once the orb copy has reached TestingOrbTarget.
float MaxDistanceForItemsSquared { get; }Squared horizontal distance a movable practice object may wander before it's respawned.
PooledObjectDefinition ObjectFadeOutEffect { get; }Pooled effect played when practice content fades out.
Material ObjectFadeOutMaterial { get; }Material used to fade practice content out.
Transform SpawnFolder { get; }Parent transform for spawned practice content. Its position is the centre for the distance check.
Vector3 TestingOrbTarget { get; }World position the orb copy flies to.
AltaEvent TrainingOrbReachedPosition { get; }Event raised when the orb copy reaches its target.

Methods​

MemberWhat it is
void Disable()Closes the area: clears spawned content, fades the border out and, on the server, syncs the closed state.
override void Initialize()Sets up the network method that syncs which skill is open.
void InitialSync(Player player)Server: sends the open or closed state (and the open orb) to one player.
void Open(SkillOrb orb)Opens the area for a skill orb. The server spawns the skill's practice entities; reopening the same skill just respawns the movable ones.
void Practiced(bool isFirstTime)Client: plays the practiced animation, with the border scale effect on the first time only.
14 private and internal methods
MemberWhat it is
private IEnumerator AnimateArea(bool isFadingIn) (iterator)Client: fades the area border in or out over borderFadeDuration, making the border renderer on first use.
private IEnumerator AnimateOrb() (iterator)Client: flies a copy of the skill orb to the training orb spot, scaling it, then raises TrainingOrbReachedPosition. Gives up after 5 seconds.
private IEnumerator BorderScaleAnimation(bool needToReadjust) (iterator)Client: plays the practiced confirmation ring by scaling it along the curve.
private void Clear()Removes the spawned practice content (server entities and static props) and forgets the last opened slot.
private void ClearSpawned()Server: destroys the spawned practice entities and stops the distance check.
private void ClearStaticContent()Fades out and destroys the static practice props.
private void DrawCapsuleGizmos(float radius, Color color)Empty in this build.
private void OnDestroy()Stops the distance check and orb animation and releases the orb effect.
private void OnDrawGizmosSelected()Editor gizmo hook; draws nothing since DrawCapsuleGizmos is empty.
private void Open()Opens the area for a skill orb. The server spawns the skill's practice entities; reopening the same skill just respawns the movable ones.
private void SpawnEntities()Server: spawns the open skill's dynamic practice prefabs and starts the distance check if any can move.
private void SpawnStaticContent()Spawns the open skill's static practice prefabs locally, adding a shrink fader to each.
private void SyncSkill(IPlayer player, Stream stream)Syncs whether the area is open and which skill orb opened it; clients open or close to match.
private void UpdateDistances()Respawns movable practice items that have been moved too far from the area.

Used in​

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