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.
- Listed in Global namespace: S
- Inherits or implements
NetworkEntityBehaviour - Nested types
SpawnedEntity
Constructors
| Member | What it is |
|---|---|
SkillShrineTestingArea() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
36 private and internal fields
| Member | What it is |
|---|---|
private readonly int _Progress | Shader property ID for the border's fade progress. |
private float acceleration | Acceleration of the orb flying to its spot. |
private ActionGlyphsPlacer actionGlyphPlacer | Shows action glyphs for the open skill. |
private PooledObject activeOrb | The pooled orb effect shown at the training spot. |
private float androidBorderYScale | Declared but not used in this class. |
private Coroutine areaAnimation | The running border fade coroutine. |
private float borderFadeDuration | Seconds the border takes to fade in or out. |
private Material borderMaterial | Material instance on the border renderer. |
private Renderer borderRenderer | The area's border renderer, made from the prefab on first use. |
private Transform borderRendererParent | Parent for the border renderer. |
private Renderer borderRendererPrefab | Prefab for the area's border. |
private bool isOpen | Whether a skill's practice area is open. |
private uint lastOpenedSlotHash | Slot hash of the last opened orb; opening the same slot again only resets movable items. |
private float maxDistanceForItemsSquared | Squared flat distance a movable practice item can stray before it respawns. |
private float moveSpeed | Top speed of the orb flying to its spot. |
private PooledObjectDefinition objectFadeOutEffect | Effect played when practice props fade out. |
private Material objectFadeOutMaterial | Material used when practice props fade out. |
private TransformEvent onPracticedCurrentSkill | Event raised with this transform whenever the skill is practiced. |
private SkillOrb openSkillOrb | The skill orb that opened the area. |
private Coroutine orbAnimation | The running orb flight coroutine. |
private PooledObjectDefinition orbEffectDefinition | Pooled effect used for the orb at the training spot. |
private Renderer practicedConfirmationRenderer | Ring shown when a skill is practiced for the first time. |
private Transform practicedConfirmationRendererParent | Parent for the confirmation ring. |
private Renderer practicedConfirmationRendererPrefab | Prefab for the confirmation ring. |
private Coroutine scaleAnimation | The running confirmation ring coroutine. |
private float scaleAnimationDuration | Seconds the confirmation ring animation lasts. |
private AnimationCurve scaleCurveOnPracticedVertical | Curve for the ring's vertical scale over the animation. |
private float scaleLerpSpeed | How fast the orb scales to size as it nears its spot. |
private SkillShrine shrine | The skill shrine this area belongs to. |
private List<SkillShrineTestingArea.SpawnedEntity> spawnedEntities | The networked practice entities spawned on the server. |
private List<PracticeAreaShrinkFader> spawnedStaticContent | The local static practice props. |
private Transform spawnFolder | Parent and centre point for spawned practice content. |
private MethodSync syncSkill | Method sync for the open state and skill orb. |
private Transform trainingOrbPosition | Where the orb flies to; its scale sets the orb's final size. |
private AltaEvent trainingOrbReachedPosition | Event raised when the orb reaches its spot. |
private IUnityUpdateMethod update | Handle for the budgeted distance check. |
Properties
| Member | What 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
| Member | What 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
| Member | What 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: