> For the complete documentation index, see [llms.txt](https://octanta-studio.gitbook.io/touch-effect-system-for-unity/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://octanta-studio.gitbook.io/touch-effect-system-for-unity/data/core-components.md).

# Core Components

Learning what is what.

## **Shaders**

<figure><img src="https://1414976141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnBd5BNyGKTZYEzDTuKCp%2Fuploads%2Fvm21RJpnDxNwKITz3X9g%2FShaderPlayer.png?alt=media&amp;token=f15d88b4-9095-4afb-8f90-98af456587fd" alt=""><figcaption></figcaption></figure>

Specialized shaders providing animated visual effects. Every shader in the toolkit follows the same structural layout, while producing a different visual result. The common principle is a playback cycle: the effect starts and ends transparent, with the animation running in between. That cycle is applied to a transparent image or flat mesh, which is then positioned in the scene - on a Canvas (UI) or in world coordinates (2D/3D).

All shader computations run on the GPU, which keeps effects lightweight and reduces the load on the CPU compared to particle-based VFX. Some shaders include a random seed, allowing the same effect to play out uniquely on every spawn - this is what makes the toolkit's effects procedural.

<figure><img src="https://1414976141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnBd5BNyGKTZYEzDTuKCp%2Fuploads%2FqsD1C1aRH9ypmc4gGsNY%2FVFX%20Toolkit.png?alt=media&amp;token=0a750093-a869-49d8-ac7d-668538f9b6f1" alt=""><figcaption></figcaption></figure>

The visual produced by a shader can be used either as a standalone animated effect, spawned on demand, or as visual feedback for touch, hold, swipe and other continious input. The toolkit includes a wide range of samples covering different use cases. The same shader effect works in any context, regardless of your project's render pipeline. Collection:

**Various Impacts (for spawn)**

* AimingSight, Cloud, ComicBurst, ComicImpactLayers, ComicPuff, DottedRing, Explosion, Fingerprint, Fireflies, FloralGrowth, FrostCute, GroundDebris, HealingAura, HealingPluses, IsometricMarker, LiquidMetal, MagicBloom, Puff, RadialSparks, RadialSunRays, RealisticFire, SeedFountain, Shatter - effects from the Autumn25ShaderOpportunities folder that unlock the full range of shader effects in different styles.
* ClockworkEcho, Constellation, ShadowManaRising, RadialSparks, FloralGrowthCute, FireAbsorbtion, CardAwakening - effects from the WorldEffects folder that show how shader effects can be used in world space: auras, ground decals, background object highlights, combat impacts.

**Blade parts (for continious input)**

* TouchPointBlur - soft glowing effect.
* TouchPointGradient - multi-color gradient transitions.

**Glow parts (for continious input)**

* TouchPointCore - tapering trail with soft fade.
* TouchPointGlow - layered glow with core and edge colors.

**Ink (for continious input)**

* TouchGlowInk - a monochrome effect with particles that taper as they progress.

**Expanding Rings (for OneTouch input)**

* TouchPointExpandingRing - an effect of a simple expanding ring.
* TouchPointRipple - an effect of soft expanding rings, like a touch on the surface of water.
* TouchPointSonarPulse - an effect of multiple expanding rings (wi-fi like).

**Patterns (for OneTouch input)**

* TouchPointForceFieldHex - an effect highlighting an invisible hex-based force field, consisting of a wave and a fade-out.
* TouchPointMatrixGrid - an effect highlighting an invisible matrix of squares, consisting of a wave and a fade-out.

**Shapes Dynamic (randomly shaped, for OneTouch input)**

* TouchPointBrokenGlass - an effect that imitates a crack in glass, with customizable numbers of rays and rings to achieve a "shattering" effect.
* TouchPointNeonBlob - an effect that imitates a blob.
* TouchPointNeonLightning - an effect that imitates a lightning strike at the touch point, with a customizable number of rays.

**Shapes Neon (for OneTouch input)**

* TouchPointNeonCircle - an effect in the shape of a ring with adjustable outer and inner glow.
* TouchPointNeonDiamond - an effect in the shape of a diamond with adjustable outer and inner glow.
* TouchPointNeonHexagon - an effect in the shape of a hexagon with adjustable outer and inner glow.
* TouchPointNeonSquare - an effect in the shape of a square with adjustable outer and inner glow.
* TouchPointNeonTriangle - an effect in the shape of a triangle with adjustable outer and inner glow.

**Shapes Rotating (for OneTouch input)**

* TouchPointRotatingSquare - an effect in the shape of a glowing square that scales up while rotating around its axis.
* TouchPointRotatingTriangle - an effect in the shape of a glowing triangle that scales up while rotating around its axis.

**Shapes Simple (for OneTouch input)**

* TouchPointCircle, TouchPointDiamond, TouchPointSquare, TouchPointTriangle, TouchPointPlus, TouchPointSparkle - geometric shapes with customizable core, glow, and ring layers.

Each shader supports customization. For OneTouch materials, there are additional properties:

* **HoldingForbidden** determines whether the particle fades immediately at the touch point or can be held in OneTouch mode until release. OneTouchHoldAge defines the animation progress point at which the effect can be held in OneTouch mode.

## ParticlePreviewPlayer

A component that plays a looping animation of a shader effect on a UI Canvas, without requiring input. It supports both shader-based and sprite-based rendering simultaneously - assign a Glow Material to play any shader from the toolkit, or add sparkle textures and a particle prefab for sprite-based effects.

Use it for standalone UI visuals: looping tutorial hints, pulsing buttons, reward teasers, or any effect that needs to run on its own without user interaction.

The effect starts playing automatically when the GameObject is spawned. Each cycle is assigned a fresh random \_RandomSeed, so looping playback produces slightly different sparkle positions and noise offsets every iteration. If Loop is off and Destroy On End is on, the GameObject is destroyed automatically after the single cycle completes.

<figure><img src="https://1414976141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnBd5BNyGKTZYEzDTuKCp%2Fuploads%2FJVY8Z8Za47mkPAMt3aW8%2Fpreviewer.png?alt=media&amp;token=53d36ba5-624b-4d65-8c2b-349f63881e5e" alt=""><figcaption></figcaption></figure>

**Universal Playback Settings:**

* Particle Lifetime (0.5–5.0 s) - duration a particle stays visible before fading.
* Playback Speed (0.1–3.0x) - animation speed multiplier.
* Pause Duration (0.1–2.0 s) - time between animation cycles.
* Loop - if on, the effect restarts after each pause. If off, plays once and stops until Play() is called.
* Destroy On End - visible only when Loop is off. If on, the GameObject is destroyed automatically after the single cycle completes. If off, the final frame stays on screen and the GameObject remains in the scene - destroy it manually when ready.

**Performance:**

* Blit Frame Rate - how often the shader material's \_TimeNow is refreshed: FPS\_24, FPS\_30, FPS\_60, or Unlimited (default). The shader itself runs on every render frame (Canvas draws the RawImage each frame) - this only controls how frequently the time value changes. Between updates the shader renders with the frozen time, which for fast-moving detail looks like stutter. Default Unlimited matches the smoothness of the rest of the scene and is correct for sparkles, streams, and flicker. FPS\_60 is a safe saving on high-refresh monitors. FPS\_30 / FPS\_24 are only for slow ambient shaders where the stutter is imperceptible. Sprite particles are not affected by this setting.

**Effect Material:**

* Raw Image - resolved automatically at runtime from the same GameObject (or a child if none is on the object itself). No manual assignment is needed and the field is hidden in the Inspector.
* Glow Material - the material created from an effect shader. Leave empty to disable the shader particle system.
* Shader Particle Size (120 px default) - size of the shader particle in pixels. Controls the RawImage's RectTransform size.

**Sprite Particles (SparkleSpawner Style):**

* Sparkle Textures - array of textures for sprite particle visual variety. Leave empty to disable the sprite particle system.
* Sparkle Colors - color palette for randomized particle appearance.
* Sparkle Particle Prefab - template GameObject for sprite particles. Must contain RawImage and RectTransform components.
* Sparkle Parent - container transform for organizing the sprite particle hierarchy.
* Dispersion Type (None / Radial / RadialSymmetric / Down / Left / Right / Up / Inward) - particle movement pattern.
* Rotation Type (None / Radial / Random) - particle rotation behavior.
* Pool Size (0–24) - number of sprite particles to pre-create.
* Min / Max Radius (40 / 80 px default) - spawn distance range from center.
* Sprite Particle Size (30 px default) - base size for sprite particles. Individual particles use 70–130% of this value.

**Debug:**

* Debug Log - enables or disables lifecycle logging. Disable in production builds.

**Play Mode Tools:**

The custom Inspector adds a few controls that appear only in Play Mode:

* Play / Stop - manually start or stop playback.
* ↻ (refresh) - a small square button that re-instantiates the runtime shader material from the current source Glow Material and restarts from frame 0. Use it to preview live shader edits without leaving Play Mode - change a value on the .mat asset, click ↻, and the change takes effect immediately. Only affects the shader particle system; sprite particles restart normally with the cycle.

## GlowMeshPlayer

{% columns %}
{% column width="50%" %}
A component that plays a shader effect on a flat mesh, positioned in 2D or 3D world space. It supports any shader from the toolkit: assign a Glow Material and it renders on the mesh surface, appearing volumetric from the camera's viewpoint.

Use it for standalone world-space VFX: impacts, explosions, auras, orbs, domes, ground patterns, projectiles, or any effect that needs to play at a specific position in the scene, with or without input.

Ready-to-use prefabs are included for both render pipelines: WorldEffects > URPVFXEffect for URP, and WorldEffects > TemplateVFXEffect for Built-in and HDRP. Each prefab contains a flat mesh with a preconfigured base material (URP/Unlit Transparent for URP, Unlit/Transparent for the others) - do not change it. Only the Glow Material needs to be assigned.

The effect starts playing automatically when the GameObject is spawned. Each cycle is assigned a fresh random \_RandomSeed, so looping playback produces slightly different sparkle positions and noise offsets every iteration.
{% endcolumn %}

{% column width="50%" %}

<figure><img src="https://1414976141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnBd5BNyGKTZYEzDTuKCp%2Fuploads%2FSn1eCoeaLAD7tmvSMJUi%2Fimage_2026-10-21_11-58-25.png?alt=media&amp;token=2217d160-6493-4a70-9970-3594fd049aa0" alt=""><figcaption></figcaption></figure>

<sub>*Plays the effect from the shader passing the cycle time from 0 to 1. It also supports effect randomization via \_RandomSeed*</sub>
{% endcolumn %}
{% endcolumns %}

**Settings:**

* Glow Material - the material created from an effect shader is assigned here. This is the only required reference.
* Target Renderer / Texture Property - resolved automatically at runtime. The renderer is taken from this GameObject (or a child if none is on the object itself); the texture property is set to \_BaseMap (URP) or \_MainTex (Built-in) based on the current render pipeline. No manual assignment is needed and neither field is visible in the Inspector.
* Resolution - RenderTexture side length: RES\_256, RES\_512 (default), or RES\_1024. Each step quadruples the per-blit GPU cost. See Performance below.
* Blit Frame Rate - caps how many times per second the shader is redrawn into the RenderTexture: FPS\_24, FPS\_30, FPS\_60, or Unlimited (default). The animation itself always advances at correct wall-clock speed - only the visual refresh rate is reduced. See Performance below.
* Lifetime - duration of one animation cycle.
* Pause Between Cycles - delay before the effect repeats in loop mode.
* Playback Speed - playback speed multiplier.
* Loop - switches between looping and one-shot playback.
* Destroy On End - visible only when Loop is off. If on, the GameObject is destroyed automatically after the final frame plays. If off, the last frame stays on screen and the GameObject remains in the scene - destroy it manually when ready. Has no effect while Loop is enabled.
* Debug Log - enables or disables logging.

**Performance:**

Resolution and Blit Frame Rate are the two performance knobs. They multiply: RES\_256 at FPS\_30 is 16× cheaper than RES\_1024 at FPS\_60. The shader is procedural and runs per pixel, so cost scales linearly with blit frequency and quadratically with resolution.

* Reduce Resolution first. The RenderTexture is upscaled and bilinearly filtered onto the mesh. Use RES\_256 for mobile and low-end targets, RES\_512 on desktop and console, RES\_1024 only for hero effects on capable hardware.
* Blit Frame Rate is a per-effect trade-off, not a universal optimization. It helps effects whose content changes slowly - pulses, ambient glows, fog, held frames. It hurts effects with fast-moving detail - sparkles, streams, rising sparks, fast flicker - which will stutter or flicker even though the throttle is working correctly. For sparkle/stream shaders keep the default Unlimited. For slow ambient glows on mobile, FPS\_30 cuts GPU cost by 2× at no visual cost.

**Play Mode Tools:**

The custom Inspector adds a few controls that appear only in Play Mode:

* Play / Stop - manually start or stop playback.
* ↻ (refresh) - a small square button that re-instantiates the runtime material from the current source Glow Material and restarts from frame 0. Use it to preview live shader edits without leaving Play Mode - change a value on the .mat asset, click ↻, and the change takes effect immediately.
* Display Material Health - a diagnostic block that verifies the target renderer's shader and texture property against the current render pipeline. When they are correct, it shows an info box and no action button. When they are wrong (for example, after switching from URP to Built-in), it shows a warning and an orange Fix button that repairs the material and the textureProperty field automatically. Calling Fix when everything is already correct is intentionally not offered - it would rewrite the shared display material and can break a running effect until scene restart.

## VfxController

A companion component for GlowMeshPlayer. Provides a public method to spawn a prefab with a GlowMeshPlayer attached at a given world position. It automatically destroys the spawned effect once its animation finishes, but only if the effect is not looping - looping effects stay in the scene until removed manually.

Spawned effects are parented to the Global VFX Holder transform, which keeps the scene hierarchy organized. Assign any transform; if left empty, effects spawn at the scene root.

```
[SerializeField] private VfxController vfxController;
[SerializeField] private GameObject strikeEffectPrefab; // Reference for the prefab

Vector3 targetPosition = Vector3.zero; // Set the target position
vfxController.SpawnUniversalVfxEffect(strikeEffectPrefab, targetPosition); // Spawn
```

## Touch Effect Prefab Wizard

An editor helper that creates a ready-to-use effect prefab from any shader in the toolkit, with the correct component already attached and the display material pre-configured for the current render pipeline. Available from **Assets → Create → Procedural VFX Toolkit → Effect Prefab...**

**How to use:**

1. Choose the target: UI (plays under a Canvas using ParticlePreviewPlayer) or World (a flat Quad in world space using GlowMeshPlayer).
2. Pick a shader from the toolkit, give the effect a name, and click Create Prefab. The wizard opens a save dialog pre-pointed at the suggested folder.
3. The prefab and its effect material ({Name}.prefab + {Name}\_Effect.mat) are created in Assets/OctantaStudio/TouchEffectSystem/Prefabs/{Name}/. Drag the prefab into the scene or a Canvas to use it - the effect starts playing automatically.

**What the wizard sets up:**

* UI VFX - RectTransform + RawImage + ParticlePreviewPlayer, 120×120 px. The effect material is assigned to both the RawImage and the component.
* World VFX - Quad + MeshRenderer + GlowMeshPlayer. The renderer uses the shared display material shipped under Prefabs/Sources/WorldMaterials/ (URP or Built-in, auto-detected). GlowMeshPlayer makes a per-instance copy at runtime and injects its RenderTexture there — the shared material is never modified.
* Defaults applied - one-shot playback (Loop off, Destroy On End on), lifetime 2 s, playback speed matching the target type. All are editable on the prefab after creation. The wizard also verifies the display material's shader reference and silently repairs it if it was lost (for example, after switching render pipelines), so prefabs always come out compatible with the active pipeline.

## **Input Controller**

A cross-platform input system with automatic configuration for desktops and mobile devices. Not intended for manual editing. Contains public field to set Input System. By default, the system is set up for the Old Input Manager. To fully switch, follow these steps:

* Open Edit → Project Settings → Player → Configuration, and set Active Input Handling to New/Old. For New one: install the Input System Unity package. For Old: delete this package. Check the EventSystem on the scene to see if it is set up correctly for the current input.
* Set inputSystemType to New/Old in the InputController component.

<figure><img src="https://1414976141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnBd5BNyGKTZYEzDTuKCp%2Fuploads%2Fe0PgXhlKkwRRYYxEqeB4%2FInputController.png?alt=media&amp;token=87fa6edb-1579-47dc-83f1-b8b55730aba9" alt=""><figcaption></figcaption></figure>

The Input Controller also contains fields for  **Sound Design** settings as well as the **Playback Conditions**, so that the effect appears not always, but only when certain conditions are met.

{% hint style="info" %}
These are included in the Input Controller because it is the single object that unites all parts of the effect, if there are multiple. Changes in the Input Controller affect the entire touch-effect.
{% endhint %}

* Mouse Input Type (LMB only / both) - mouse input on desktops that triggers a touch effect.
* Effect Enabled (True/False) - indicates whether the effect is active at all. By default, it is True. It can be enabled or disabled via public methods inside the associated TouchGlowUI or SparkleSpawner: EnableTouch() and DisableTouch().
* Operation Mode (Default / Manually Call) - indicates whether the effect will be triggered automatically when conditions are met, or if it requires a manual call from the associated TouchGlowUI or SparkleSpawner: ShowEffect().
* Check Target Type (Any Type / UI / 3D / 2D) - specifies the type of objects from which input will be read to trigger the visual effect.
* Check Condition (Any Target / ByGameObject / ByTag / ByLayer) - specifies the condition by which objects of the chosen type will be checked, from which input will be read to trigger the visual effect.
* Target Object To Click, Target Tags, Target Layers - these are additional references. For example, if you want to provide visual feedback when the user clicks UI buttons with the tag Success, you set Target Type = UI, Condition = By Tag, and add the tag name 'Success' to the Tags list.
* Sound Clips - a list of sounds, from which a random one is played when the OneTouch effect is triggered. See [TouchSounds.prefab](/touch-effect-system-for-unity/usage-guide/demo-and-ideas.md#one-touch-effects) > InputController.
* Max Simultaneous Sounds - specifies how many sounds from the list can be played simultaneously. If set to `1`, a single sound will play without overlapping until it finishes.
* Sound Clips Swipe Start & End - lists of sounds, from which random ones are played at the start and end of a swipe (Trail effect). See [TouchTrailFromSimpleSpriteSounds.prefab](/touch-effect-system-for-unity/usage-guide/demo-and-ideas.md#trail-effects) > InputController.
* Default Volume  (0-1) - controls the base volume of the sound effects.
* Random Stereo (True/False) - controls whether the sound plays randomly in the left/right channel.

The Input Controller can be configured so that touch reactions don’t fire on every touch, but only when called.

```
/// Manual call mode: Show OneTouch effect manually after input is detected
/// Better to call via EventTrigger > PointerEnter or Button > OnClick or AutomaticTutorialMaker > OnStepComplete
 public void ShowEffect()
 {
     if (inputController == null || !inputController.effectEnabled) return;
     inputController.ForceUpdateInputData();
     bool manualCallInputDetected = inputController.GetManualCallInput();

     if (!manualCallInputDetected) return;

     Vector2 manualCallInputPosition = inputController.GetManualCallInputPos();
     float manualCallInputTime = inputController.GetManualCallInputTime();

     // Process the cached input data with random text from list
     SpawnText(manualCallInputPosition);
 }

 // Manual call mode: Show text effect with specific text string
 // Better to call via EventTrigger > PointerEnter or Button > OnClick or AutomaticTutorialMaker > OnStepComplete
 public void ShowEffectWithTexts(string text)
 {
     if (inputController == null || !inputController.effectEnabled) return;
     inputController.ForceUpdateInputData();
     bool manualCallInputDetected = inputController.GetManualCallInput();

     if (!manualCallInputDetected) return;

     Vector2 manualCallInputPosition = inputController.GetManualCallInputPos();
     float manualCallInputTime = inputController.GetManualCallInputTime();

     // Save original values
     List<string> originalTextStrings = textStrings;
     TMP_FontAsset originalFontAsset = fontAssetDefault;

     // Process the cached input data with custom text
     SpawnText(manualCallInputPosition);

     // Restore original values
     textStrings = originalTextStrings;
     fontAssetDefault = originalFontAsset;
 }

// Temporary mode: Enable touch input processing
public void EnableTouch()
{
    if (inputController == null) return;
    inputController.effectEnabled = true;
}

// Temporary mode: Disable touch input processing
public void DisableTouch()
{
    if (inputController == null) return;
    inputController.effectEnabled = false;
}
```

## **TouchGlowUI (shader-based)**

{% hint style="info" %}
Shader effects are created using UI particles based on a shader material. In the text below, they will be referred to as points or particles.
{% endhint %}

Main system controller managing trail generation, platform optimization, pooling, and rendering. Handles automatic platform detection and applies appropriate performance settings. Not intended for manual editing. Contains important references for assignment:

* Target Canvas (UI canvas on the scene for positioning and scaling).
* Glow Material (material created from shader for visual particle effect).
* Input Controller.
* Point Prefab (template GameObject for trail UI points). Not intended for manual editing.
* Parent Object For Points (container transform for organizing trail hierarchy).

<figure><img src="https://1414976141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnBd5BNyGKTZYEzDTuKCp%2Fuploads%2FqqmTPhZqGhCJkAR9Syg2%2FTouchGlowUI.png?alt=media&amp;token=86227e46-5781-4b5f-9cbc-db1538159cdf" alt=""><figcaption></figcaption></figure>

Also contains public fields for settings.

**Universal Settings:**

* Glow Mode (Trail/OneTouch) - operating mode controlling particle behavior and pooling. When Max Points is manually set to 1, mode automatically switches to OneTouch.

| One-Touch                                                                                                                                                                                          | Trail                                                                              |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| Uses either 1 particle for single touch or 10 particles for multitouch support regardless of Max Points.                                                                                           | Uses configured Max Points value for continuous flowing effects (512 recommended). |
| Does not use Spacing.                                                                                                                                                                              | Uses the Base Trail Spacing value to position points.                              |
| Creates a single effect at the touch point and either follows the touch until it is released (if Glow Material has property Holding Forbidden = 0), or extinguishes the effect at the spawn point. | Creates a trailing particle effect that lasts until release.                       |

**Desktop Settings:**

* Desktop Max Points (512) - maximum trail points at once. Less points = better performance but shorter trails. More points = longer trails but higher GPU load. Set to 1 for single touch response without trail (OneTouch mode). If OneTouch mode is already enabled, it takes priority and will use 1-10 particles for single touch or multitouch response without trail, regardless of this setting.
* Desktop Glow Lifetime (2s) - how long each trail point stays visible before fading. Shorter time = fast blade-like effects. Longer time = slower fade.
* Desktop Point Size (120x120px) - dimensions of individual trail points in pixels.
* Desktop Base Trail Spacing (10px) - minimum pixel distance between trail points. System adds new point when finger moves this distance regardless of time. Smaller values = denser trails but more GPU load. Larger values = sparser trails with gaps during fast movement.
* Desktop Target FPS (60) - controls time-based point generation. System adds points every 1/60 seconds even when finger doesn't move. Higher FPS = more frequent point generation = denser trails. Lower FPS = less frequent generation = sparser trails during slow movement.
* Start/End Taper Points Desktop (64/64) - number of points used for smooth trail start and end tapering. Only active when Sharp Edges = true. Total taper points should be less than Max Points for proper function.

**Mobile Settings:**

* Mobile Max Points (512) - maximum concurrent points optimized for mobile GPU performance.
* Mobile Glow Lifetime (2s) - trail point lifetime adjusted for mobile battery efficiency.
* Mobile Base Trail Spacing (8px) - tighter spacing optimized for smaller mobile screens.
* Mobile Target FPS (60) - framerate target balancing smoothness with mobile performance.
* Mobile Point Size (150x150px) - point dimensions for mobile screen densities.
* Start/End Taper Points Mobile (32/32) - reduced taper complexity for mobile performance.

**Additional Settings:**

* Initialization Delay (0.1s) - configurable delay before system starts. Allows to control when trail system activates to avoid startup performance impact.
* Always Last Sibling (true) - keeps trail effects rendered above other UI elements. Logic is optimized to only update when new objects appear below in UI hierarchy, not constantly setting position. Incompatible with Dont Destroy On Load because the second function moves the object to a separate canvas without a hierarchy shared with other UI elements.
* Dont Destroy On Load (false) - preserves trail system across scene transitions. System copies parent canvas settings and creates canvas duplicate in DontDestroyOnLoad area for persistent effects between scenes. Recommended if there are no other overlapping elements on the canvas.
* Enable Multi Touch (true) - allows multiple simultaneous touch inputs with individual trail tracking. Creates separate trails for each finger on touch devices. Incompatible with Sharp Edges due to conflicting tapering logic.
* Sharp Edges (false) - enables tapered trail beginnings and endings for blade-like effects. Incompatible with multi-touch due to complex edge tapering logic. Requires configuring Start/End Taper Points values (> 0) to function properly. Automatically disabled in OneTouch mode.
* Size Multiplier (1) - changes the overall effect size while keeping the proportions between particle size and spacing.

**Editor Settings:**

* Enable Debug Logs (true) - detailed console output for development and troubleshooting. Automatically disabled in builds for performance.
* Force Mobile In Editor (false) - test mobile performance settings while in Unity Editor.

**Methods For Manual Call**

The component also contains Methods for Manual Call to enable/disable and show the effect on demand, rather than continuously. See [Input Controller](#input-controller).

```
// Manual call mode: Show OneTouch effect manually after input is detected
// Better to call via EventTrigger > PointerEnter or Button > OnClick or AutomaticTutorialMaker > OnStepComplete
public void ShowEffect()
{
    if (inputController == null || !inputController.effectEnabled) return;

    bool manualCallInputDetected = inputController.GetManualCallInput();

    if (!manualCallInputDetected) return;

    Vector2 manualCallInputPosition = inputController.GetManualCallInputPos();
    float manualCallInputTime = inputController.GetManualCallInputTime();

    // Process the cached input data
    AddPoint(manualCallInputPosition, manualCallInputTime, 0);

    PlaySound();
}

// Temporary mode: Enable touch input processing
public void EnableTouch()
{
    if (inputController == null) return;
    inputController.effectEnabled = true;
}

// Temporary mode: Disable touch input processing
public void DisableTouch()
{
    if (inputController == null) return;
    inputController.effectEnabled = false;
}
```

## SparkleSpawner (sprite-based)

Effect system creating sprite-based particle accent effects with customizable dispersion patterns. Handles automatic platform detection and applies appropriate performance settings. Not intended for manual editing. Contains important references for assignment:

* Target Canvas (UI canvas on the scene for positioning and scaling).
* Input Controller.
* Sparkle Particle Prefab (template GameObject for individual sparkles). Not intended for manual editing.
* Sparkle Parent (container transform for organizing sparkle hierarchy).
* Sparkle Textures (array of textures for visual variety).
* Sparkle Colors (color palette for randomized particle appearance).

Also contains public fields for additional settings.

<figure><img src="https://1414976141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnBd5BNyGKTZYEzDTuKCp%2Fuploads%2FO9z88cmR4kcSYi1ZxoOW%2FSpSp.png?alt=media&amp;token=87250872-cff1-4a95-8ae4-8925d8ac11be" alt=""><figcaption></figcaption></figure>

**Universal Settings:**

* Sparkle Mode (OneTouch/Trail) - operating mode for particle generation. When Max Points is manually set to 1, mode automatically switches to OneTouch.

| One-Touch                                                                                             | Trail                                                                |
| ----------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| Creates either 1 burst for single touch or 10 bursts for multitouch support regardless of Max Points. | Uses Min/Max Sparkle Points per Burst, Max Points (512 recommended). |
| Does not use Spacing.                                                                                 | Uses the Base Trail Spacing value to position points.                |
| Creates a single burst at the input point and extinguishes it there.                                  | Creates continuous bursts during movement.                           |

* Dispersion Type (None/Radial/RadialSymmetric/Down/Left/Right/Up/Inward) - particle movement pattern. None keeps particles stationary. Radial spreads from center outward. Directional moves particles in specific directions. Inward pulls particles toward center.
* Fade Animation Type (FadeAndScale/Fade/Scale) - visual fade-out animation style. FadeAndScale combines opacity and size changes. Fade only changes opacity. Scale only changes size.
* Rotation Type (None/Radial/Random) - a setting that determines the particle’s rotation. None - original rotation, Radial - directed from the center toward the radius rings, Random - random.

**Desktop Settings:**

* Desktop Max Points (512) - maximum concurrent sparkles for desktop performance.
* Desktop Sparkle Lifetime (1s) - how long individual sparkles remain visible before fading. Shorter time = quick flash effects. Longer time = lingering sparkles.
* Desktop Min/Max Point Size (20-40px) - size range for individual sparkles in pixels. System randomly selects size within this range for variety.
* Desktop Spacing (20px) - minimum pixel distance between sparkle bursts in Trail mode. Controls how densely sparkles spawn during movement.
* Desktop Min/Max Sparkle Points (8-16) - number of particles per burst. System randomly selects count within this range for natural variation.
* Desktop Min/Max Radius (80-120px) - spawn distance range from touch point. Creates ring-shaped spawn area around touch location. There is a visualization of the coverage area in the Scene window.

<figure><img src="https://1414976141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnBd5BNyGKTZYEzDTuKCp%2Fuploads%2F8bLfECKPRPoltysNv1IN%2Fgizmoz.png?alt=media&amp;token=2e7f8f3d-1da1-4b2b-a502-c583fa7c1333" alt=""><figcaption></figcaption></figure>

**Mobile Settings:**

* Mobile Max Points (512) - maximum concurrent sparkles optimized for mobile GPU performance.
* Mobile Sparkle Lifetime (1s) - particle lifetime adjusted for mobile battery efficiency.
* Mobile Min/Max Point Size (20-40px) - size range optimized for mobile screen densities.
* Mobile Spacing (10px) - tighter spacing optimized for smaller mobile screens and touch precision.
* Mobile Min/Max Sparkle Points (8-16) - particle count range balancing visual impact with mobile performance.
* Mobile Min/Max Radius (80-120px) - spawn radius range for mobile touch targets.

**Additional Settings:**

* Initialization Delay (0.1s) - configurable delay before system starts. Prevents startup performance impact and allows other systems to initialize first.
* Always Last Sibling (false) - keeps sparkle effects rendered above other UI elements when enabled. Disabled by default as sparkles are typically accent effects.
* Don't Destroy On Load (false) - preserves sparkle system across scene transitions. Creates persistent canvas copy in DontDestroyOnLoad area.
* Enable Multi Touch (false) - allows multiple simultaneous sparkle bursts. Creates separate burst patterns for each finger on touch devices.
* Size Multiplier (1) - global scale multiplier for sparkle size, spacing, and radius. Maintains proportions while scaling overall effect size.

**Editor Settings:**

* Enable Debug Logs (true) - detailed console output for development and troubleshooting. Shows spawn counts, performance metrics, and system state. Automatically disabled in builds.
* Force Mobile In Editor (false) - test mobile performance settings while in Unity Editor. Useful for optimizing mobile-specific parameters during development.

**Methods For Manual Call**

The component also contains Methods for Manual Call to enable/disable and show the effect on demand, rather than continuously. See [Input Controller](#input-controller).

```
// Better to call via EventTrigger > PointerEnter or Button > OnClick or AutomaticTutorialMaker > OnStepComplete
public void ShowEffect()
{
    if (inputController == null || !inputController.effectEnabled) return;

    bool manualCallInputDetected = inputController.GetManualCallInput();

    if (!manualCallInputDetected) return;

    Vector2 manualCallInputPosition = inputController.GetManualCallInputPos();
    float manualCallInputTime = inputController.GetManualCallInputTime();

    // Process the cached input data
    SpawnSparkles(manualCallInputPosition);

    PlaySound();
}

// Temporary mode: Enable touch input processing
public void EnableTouch()
{
    if (inputController == null) return;
    inputController.effectEnabled = true;
}

// Temporary mode: Disable touch input processing
public void DisableTouch()
{
    if (inputController == null) return;
    inputController.effectEnabled = false;
}
```

## TouchTextUI (TextMeshPro based)

Effect system creating text-based effects with customizable animation patterns. Handles automatic platform detection and applies appropriate performance settings. Not intended for manual editing. Contains important references for assignment:

* Target Canvas (UI canvas on the scene for positioning and scaling).
* Input Controller.
* Text Prefab (template GameObject). Not intended for manual editing.
* Text Parent (container transform for organizing texts hierarchy).
* Font Asset Default (font used in the text effect).
* Font Style Default (style used in the text effect).
* Main Sprite Asset (to insert sprites into text).
* Text Strings (text values randomly selected from a list).
* Text Colors (color palette for randomized particle appearance).

Also contains public fields for additional settings.

<figure><img src="https://1414976141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnBd5BNyGKTZYEzDTuKCp%2Fuploads%2FdYcNQWDJyYNNuKWYPjua%2Fburst.png?alt=media&amp;token=33c99eff-3a28-4a11-9582-d9d5303c3073" alt=""><figcaption></figcaption></figure>

**Universal Settings:**

* Appearance Animation (None/RadialRandom/RadialArc/Down/Left/Right/Up/ZoomIn/ZoomOut/Bounce). None keeps text stationary. Radial spreads from center outward. Directional moves text in specific directions. Zoom provides size changes during the appearance. Bounce defines a special trajectory. All these appearance types define the direction, while the text’s spawn point relative to the touch depends on the Min Move Distance value, and the disappearance point depends on the Max Move Distance. If they are equal, there is no movement - text animates in place.
* Dissapearing Animation Type (FadeAndScale/Fade/Scale) - visual fade-out animation style. FadeAndScale combines opacity and size changes. Fade only changes opacity. Scale only changes size.

**Desktop Settings:**

* Desktop Text Lifetime (1s) - how long individual text remain visible before dissapearing. Shorter time = quick effects.
* Desktop Min/Max Font Size (24-48) - size range for individual text. System randomly selects size within this range for variety.
* Desktop Min/Max Move Distance (30-100px) - distance from the touch point at which the text spawns and fades as a result of the appearance movement. There is a gizmo visualization of the trajectory & radius in the Scene window.

<figure><img src="https://1414976141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnBd5BNyGKTZYEzDTuKCp%2Fuploads%2Fnc6umq31sADDzLNlRhs0%2Fgizmo.png?alt=media&amp;token=40026187-c866-41de-9e47-6a7cd0b1be34" alt=""><figcaption></figcaption></figure>

**Mobile Settings:**

* Mobile Text Lifetime (1s) - text lifetime adjusted for mobile battery efficiency.
* Desktop Min/Max Font Size (24-48) - size range optimized for mobile screen densities.
* Desktop Min/Max Move Distance (30-100px) - spawn radius range for mobile touch targets.

**Additional Settings:**

* Initialization Delay (0.1s) - configurable delay before system starts. Prevents startup performance impact and allows other systems to initialize first.
* Don't Destroy On Load (false) - preserves sparkle system across scene transitions. Creates persistent canvas copy in DontDestroyOnLoad area.
* Size Multiplier (1) - global scale multiplier for sparkle size, spacing, and radius. Maintains proportions while scaling overall effect size.
* Always Last Sibling (false) - keeps sparkle effects rendered above other UI elements when enabled. Disabled by default as sparkles are typically accent effects.

**Editor Settings:**

* Enable Debug Logs (true) - detailed console output for development and troubleshooting. Shows spawn counts, performance metrics, and system state. Automatically disabled in builds.
* Force Mobile In Editor (false) - test mobile performance settings while in Unity Editor. Useful for optimizing mobile-specific parameters during development.

**Methods For Manual Call**

The component also contains Methods for Manual Call to enable/disable and show the effect on demand, rather than continuously. See [Input Controller](#input-controller). This also contains a method for receiving text from sources other than the built-in list.

## ReadOnlyAttribute

Utility attribute for creating read-only fields in Unity Inspector, used throughout the Procedural VFX Toolkit for preventing modification of already configured and initialized values.
