Skip to content

kids.kapish

unity

Technical reference for the kids.kapish Unity package -- the foundational library underpinning all Carrot Unity packages.

Package Identity

  • Package name: kids.kapish
  • Display name: Carrot
  • Version: 0.1.0
  • Minimum Unity: 2022.3
  • License: MIT
  • Dependencies: None (zero external package dependencies)

Assembly Structure

The package is split across four assembly definitions plus two precompiled plugin assemblies:

Carrot (Runtime)

  • Path: Runtime/Carrot.asmdef
  • Root namespace: Carrot
  • References: Carrot.Precompiled
  • Engine references: Yes
  • Platforms: All

This is the main runtime assembly. Contains all extension methods, helpers, types, collections, color utilities, tween system, morphable system, and base behaviours. This is what consuming packages reference.

Carrot.Editor (Editor)

  • Path: Editor/Carrot.Editor.asmdef
  • Root namespace: Carrot.Editor
  • References: Carrot, Carrot.Precompiled
  • Platforms: Editor only

Custom inspectors (CarrotBehaviourInspector, CarrotObjectInspector), property drawers (OptionalDrawer, OptionalGroupDrawer, TagsDrawer), serialization introspection (SerializedUnity*), editor asset utilities, tween baking tools, and background progress tracking.

Carrot.Precompiled (Plugin -- no engine)

  • Path: Runtime/Plugins/Carrot/Carrot.Precompiled.asmdef
  • Root namespace: Carrot
  • Engine references: No
  • References: None

Engine-independent code from the Carrot precompiled libraries. This assembly has noEngineReferences: true, making it suitable for pure C# types shared across Unity and non-Unity contexts (like IPrimitiveBag).

Carrot.Tests

  • Path: Tests/Carrot.Tests.asmdef
  • References: Carrot
  • Optional Unity References: TestAssemblies

Test assembly for the package.

Architecture

Base Types Pattern

All Carrot MonoBehaviours should inherit from CarrotBehaviour and all ScriptableObjects from CarrotObject. These base classes are currently empty but serve two purposes:

  1. They are the targets of custom [CustomEditor] inspectors that use the [Group] attribute system for automatic field grouping with foldouts.
  2. They provide a single point for future shared behaviour.

Inspector Grouping System

The [Group] attribute + CarrotBehaviourInspector/CarrotObjectInspector pair provides automatic inspector organization:

csharp
public class MyBehaviour : CarrotBehaviour
{
    [Group("Movement", groupOrder: 0, fieldOrder: 0)]
    [SerializeField] private float speed;

    [Group("Movement", groupOrder: 0, fieldOrder: 1)]
    [SerializeField] private float acceleration;

    [Group("Combat", groupOrder: 1)]
    [SerializeField] private int damage;
}

Fields are gathered by reflection, sorted by groupOrder then fieldOrder, and rendered in collapsible foldout groups. The foldout state persists via SessionState.

Color System

The color system provides:

  • Color spaces: ColorHSV, ColorXYZ, ColorYIQ with implicit conversions and full operator overloads
  • Color manipulation: Extension methods for hue/saturation/lightness/value modification, pastel generation, text contrast
  • Color schemes: Reflection-discovered ColorScheme hierarchy with built-in Crayons, FlatUI, LEGO, and Lospec palettes
  • Color sets: ColorSet ScriptableObject using RYB natural color wheel for analogous, complementary, triadic, and split-complementary relationships
  • Color matching: Perceptual distance calculations combining HSV, RGB, and grayscale metrics

The ColorTransformation class handles sRGB <-> XYZ conversions using the D65 illuminant matrices defined in Matrix3x3.

Tween System

The tween system is a ScriptableObject-based curve definition and evaluation framework:

  • TweenCurveAsset -- Persistent curve definitions saved as .asset files
  • TweenDefinition -- Combines a source (manual AnimationCurve, standard easing, mixed in/out, or reference to another asset) with optional overlays
  • TweenRuntime -- Pure evaluation: all 11 standard easing functions (Quad through Bounce) in In/Out/InOut modes, plus overlay processing
  • TweenOverlay -- Post-processing: Multiply, Add, ValuePow, TimeScale, TimeWarp, Overshoot
  • Caching -- TweenCurveAsset supports editor-time pre-baking and lazy runtime fill. Cache quality ranges from 16 to 512 samples. The TweenCurveBaker debounces bake requests during editing.
  • TweenCurve struct wraps either an inline definition or asset reference for use as a serialized field

Weighted Random Collections

RandomList<T> and RandomDictionary<TKey,TValue> extend standard collections with a clause-based weighted random selection system:

  • Add clauses with AddClause(Func<T, float/int/uint> getValue, Func<T, bool>? filter)
  • Each clause independently selects based on cumulative weight
  • RandomList auto-resets clause caches when the collection changes

Serialization Introspection

The SerializedUnity* classes provide a reflection-based model of Unity's serialization rules:

  • SerializedUnityType -- Enumerates all serializable fields on a type, resolves attributes, identifies required components
  • SerializedUnityField -- Captures field metadata: arrays, references, ranges, headers, tooltips, space, multiline
  • Recursive GetAllFieldsRecursive() for deep type inspection
  • Follows Unity serialization rules (public or [SerializeField], not static/const/readonly/compiler-generated/NonSerialized)

Platform Detection

  • SystemThemeDetector -- Reads OS light/dark theme on Windows (registry), macOS/iOS/WebGL (native plugins), Android (JNI)
  • Pipeline -- Auto-detects BuiltIn/URP/HDRP by inspecting GraphicsSettings.defaultRenderPipeline type name. Watches for changes in editor via EditorApplication.projectChanged and AssetPostprocessor.

Morphable System

Time-based material property interpolation:

  • Morph<T> manages source/target/time for a single material property
  • Concrete implementations: MorphColor, MorphFloat, MorphHorizontalBezier
  • Can run via ManagedUpdate() (manual tick) or Coroutine() (automatic)
  • Morpher<T> coordinates multiple morph properties

Object Pooling

Two pool types in Carrot.Pooling:

  • Pool<T> -- generic pool for plain C# objects (T : class, new()). Uses Stack<T> for zero-alloc pop/push, HashSet<T> for O(1) return validation (prevents double-return). Grows on demand with optional max capacity.
  • ComponentPool<T> -- prefab-based pool for Unity Components. Manages a hidden root GameObject for inactive items. Handles SetActive, SetParent, Instantiate, and editor-safe Destroy. Skips externally destroyed objects on acquire.
  • Quick-die: both pools support Return(item, dieTimeMs, onDying) where the callback receives linear progress 0→1. A hidden PoolTicker MonoBehaviour ticks dying items each frame and self-destructs when idle. Delegate registration is cached per pool instance (one alloc, ever).
  • IPoolable is optional: if T implements it, OnAcquire() and OnReturn() are called automatically. The type check is cached once at pool construction.

Texture Writing

Texture2DWriter provides a mutable pixel buffer with:

  • Dirty tracking (skips Apply() when unchanged)
  • Insert with ColorBlendMode.AlphaBlend or Overlay
  • Bounds checking on all pixel access
  • File I/O: Load from disk, Save to PNG/JPG/TGA/EXR

Key Design Decisions

  1. No external dependencies. The package.json has zero dependencies. Everything is self-contained or relies on precompiled Carrot libraries.

  2. Engine-free precompiled layer. Carrot.Precompiled has noEngineReferences: true, allowing shared types (like IPrimitiveBag) to exist independently of Unity.

  3. Extension method-heavy API. Most functionality is delivered as extensions on Unity types (Color, Bounds, Vector3, Texture2D, etc.) for discoverability and minimal coupling.

  4. Editor-safe patterns. Methods like Destroy() and EnsureComponent() handle the editor/play-mode split (DestroyImmediate vs Destroy, Undo.AddComponent in editor).

  5. Struct color types. ColorHSV, ColorXYZ, ColorYIQ are value types with implicit conversion operators, matching Unity's Color conventions.

  6. ScriptableObject curves. The tween system uses ScriptableObjects for reusable curves with pre-baked caching, avoiding runtime allocation.


Using kids.kapish

Practical guide to the kids.kapish package -- the core helpers library for all Carrot Unity packages.

Installation

Add kids.kapish as a dependency in your package's package.json or install it via the Unity Package Manager from the Carrot registry.

json
{
  "dependencies": {
    "kids.kapish": "0.1.0"
  }
}

Reference the Carrot assembly in your .asmdef:

json
{
  "references": ["Carrot"]
}

Base Behaviours

Inherit from CarrotBehaviour (MonoBehaviour) or CarrotObject (ScriptableObject) to get automatic grouped inspectors.

csharp
using Carrot.Attributes;
using Carrot.Behaviours;
using UnityEngine;

public class EnemyController : CarrotBehaviour
{
    [Group("Movement", groupOrder: 0, fieldOrder: 0)]
    [SerializeField] private float speed = 5f;

    [Group("Movement", groupOrder: 0, fieldOrder: 1)]
    [SerializeField] private float turnRate = 90f;

    [Group("Combat", groupOrder: 1, fieldOrder: 0)]
    [SerializeField] private int health = 100;

    [Group("Combat", groupOrder: 1, fieldOrder: 1)]
    [SerializeField] private float attackRange = 2f;
}

In the inspector, "Movement" and "Combat" appear as collapsible foldout groups, sorted by groupOrder.


Color Manipulation

Quick Modifications

csharp
using Carrot.Colors;
using UnityEngine;

Color baseColor = Color.red;

// Lightness variants
Color lighter = baseColor.GetLighter2();   // +0.15 lightness
Color darker = baseColor.GetDarker1();     // -0.075 lightness

// HSV tweaks
Color shifted = baseColor.ModifyHue(0.1f);          // shift hue by 10%
Color desaturated = baseColor.ModifySaturation(-0.3f); // reduce saturation

// Pastel version
Color pastel = baseColor.GetPastel();

// Contrast text color (black or white)
Color textColor = baseColor.GetTextColor();

Color Space Conversions

csharp
using Carrot.Colors;

// RGB -> HSV
ColorHSV hsv = myColor.ToHSV();
Debug.Log($"Hue: {hsv.h}, Sat: {hsv.s}, Val: {hsv.v}");

// RGB -> XYZ (CIE)
ColorXYZ xyz = myColor.ToXYZ();

// RGB -> YIQ (NTSC)
ColorYIQ yiq = myColor.ToYIQ();

// All color types implicitly convert back to Color
Color back = hsv;  // implicit

Parsing Colors from Strings

csharp
using Carrot.Colors;

Color fromHex = ColorKit.Parse("#FF5500");
Color fromRgb = ColorKit.Parse("rgb(255, 85, 0)");

if (ColorKit.TryParse(userInput, out Color parsed))
{
    renderer.material.color = parsed;
}

Color Matching

csharp
using Carrot.Colors;

Color[] palette = { Color.red, Color.blue, Color.green, Color.yellow };
Color closest = palette.Closest(targetColor);
Color closestToHue = palette.Closest(ColorHue.Orange);

Color Sets (RYB Wheel)

Create a ColorSet asset via Create > Carrot > ColorKit > Color Scheme and use it for harmonious palettes:

csharp
using Carrot.Colors;

[SerializeField] private ColorSet colorSet;

void ApplyColors()
{
    background.color = colorSet.Main;
    accent.color = colorSet.Complimentary;
    highlight.color = colorSet.TriadicLeft;
}

Vector & Bounds Extensions

Vector3

csharp
using Carrot;

// Struct-safe setters (remember: Vector3 is a value type!)
Vector3 pos = transform.position;
pos = pos.SetY(0);           // zero out Y
pos = pos.MoveX(5f);         // offset X by 5
pos = pos.Round(0.5f);       // snap to 0.5 grid

// Component extraction
Vector2 xz = pos.GetXZ();

// Multiplication per-axis
Vector3 scaled = pos.Multiply(2f, 1f, 0.5f);

Bounds

csharp
using Carrot;

Bounds bounds = renderer.bounds;

// Scale from one edge
bounds = bounds.ScaleFromXMin(0.5f);  // shrink to 50% from min-X

// Extend to infinity on an axis
bounds = bounds.ExtendAllY();

// Lerp within bounds
float xPos = bounds.LerpX(0.75f);

// Random point inside
Vector3 randomPoint = bounds.GetRandomPosition();

// Position a sprite inside bounds
Vector3 placed = bounds.PositionInside(spriteRenderer, 0.5f, 0.5f, 0f);

Optional Fields

Serialize values with a toggle for "enabled/disabled":

csharp
using Carrot.Types;
using UnityEngine;

public class MyComponent : CarrotBehaviour
{
    [SerializeField] private Optional<float> overrideSpeed;
    [SerializeField] private OptionalGroup<DamageConfig> damageOverride;

    void Update()
    {
        // Optional<T>
        if (overrideSpeed.TryGet(out float speed))
        {
            Move(speed);
        }

        // Or with fallback
        float actualSpeed = overrideSpeed.GetOr(defaultSpeed);

        // OptionalGroup<T>
        if (damageOverride.TryGet(out DamageConfig config))
        {
            ApplyDamage(config);
        }
    }
}

Both have custom property drawers showing a toggle + value in the inspector.


Tags System

Multi-type tag collection with case-insensitive keys:

csharp
using Carrot;

Tags tags = new Tags();

// Flags (presence-only)
tags.TryAdd("Flammable");
tags.TryAdd("Heavy");

// Typed values
tags.TryAdd("MaxHP", 100);
tags.TryAdd("Speed", 3.5f);
tags.TryAdd("Faction", "Empire");
tags.TryAdd("IsElite", true);

// Lookup
if (tags.HasFlag("Flammable"))
{
    ApplyFireDamage();
}

if (tags.TryGetFloat("Speed", out float speed))
{
    agent.speed = speed;
}

Tween Curves

Using a TweenCurve Field

csharp
using Carrot.Tween;
using Carrot.Tween.Caching;
using UnityEngine;

public class FadeController : CarrotBehaviour
{
    [SerializeField] private TweenCurve fadeCurve;

    void Update()
    {
        float t = GetNormalizedTime();

        // Direct evaluation
        float value = fadeCurve.Evaluate(t);

        // Cached evaluation (faster for hot paths)
        float cached = fadeCurve.EvaluateCached(t, TweenCacheQuality.High);

        canvasGroup.alpha = value;
    }
}

Inline Curves

csharp
using Carrot.Tween;

// Programmatic curves without assets
TweenCurve easeInOut = TweenCurve.EaseInOut(0f, 0f, 1f, 1f);
TweenCurve linear = TweenCurve.Linear(0f, 0f, 1f, 1f);
TweenCurve constant = TweenCurve.Constant(0f, 0.5f, 1f);

Standard Easing

csharp
using Carrot.Tween;
using Carrot.Tween.Easing;

float t = 0.5f;
float eased = TweenRuntime.Ease(EaseKind.Cubic, EaseMode.InOut, t);

TweenCurveAsset

Create via Create > Carrot > Tween Curve in the Project window. Configure in the inspector with source type, overlays, and caching quality. Use Tools > Carrot > Tween Curves menu for bulk baking and validation.


Coroutine Management

CoTask

csharp
using Carrot;
using System.Collections;

// Start a managed coroutine
CoTask task = CoTask.Start(MyCoroutine());

// Check state
if (task.IsRunning) { /* ... */ }
Debug.Log($"Elapsed: {task.TimeElapsed}s");

// Stop it
task.Stop();

// Await multiple tasks
CoTask a = CoTask.Start(TaskA());
CoTask b = CoTask.Start(TaskB());
yield return CoTask.Await(a, b);

// Schedule with delay
CoTask delayed = CoTask.Schedule(MyCoroutine(), delay: 2f);

CanvasGroup Fading

csharp
using Carrot;

// Coroutine-based fade
StartCoroutine(canvasGroup.CoShow(time: 0.5f));
StartCoroutine(canvasGroup.CoHide(time: 1f));
StartCoroutine(canvasGroup.CoTransition(targetOpacity: 0.5f, time: 0.3f));

Texture2DWriter

Mutable pixel buffer for compositing textures:

csharp
using Carrot.Images;
using UnityEngine;

// Create a blank canvas
Texture2DWriter writer = Texture2DWriter.Create(512, 512);
writer.Clear(Texture2DWriter.White);

// Set individual pixels
writer[10, 20] = new Color32(255, 0, 0, 255);

// Insert a texture with alpha blending
writer.Insert(overlayTexture, new Vector2Int(100, 100));

// Apply to a Texture2D and save
Texture2D result = writer.Apply();
writer.Save("output", format: Texture2DFormat.Png);

// Dispose when done
writer.Dispose();

Morphable Material Properties

Smoothly interpolate material properties over time:

csharp
using Carrot.Morphable;
using UnityEngine;

MorphColor colorMorph = Morph<Color>.Create<MorphColor>(material, "_Color", Color.white);
MorphFloat floatMorph = Morph<float>.Create<MorphFloat>(material, "_Dissolve", 0f);

// Start a transition
colorMorph.MorphTo(Color.red, time: 1.5f);

// Tick each frame
void Update()
{
    colorMorph.ManagedUpdate();
    floatMorph.ManagedUpdate();
}

// Or run as a coroutine
StartCoroutine(colorMorph.Coroutine());

GameObject & Component Helpers

csharp
using Carrot;

// Safe destroy (handles editor vs play mode)
gameObject.Destroy();
component.Destroy();

// Get-or-add component
MeshRenderer renderer = gameObject.RequireComponent<MeshRenderer>();

// Find-or-create child
GameObject child = transform.RequireChild("Effects", typeof(ParticleSystem));

// Check for destroyed objects (Unity's null override)
if (gameObject.IsDestroyed()) { /* handle */ }

// Destroy all children
gameObject.DestroyChildren();

Hierarchy Ensure Pattern

csharp
using Carrot.Hierarchy;

// Find or create a child with a specific component
MeshFilter filter = transform.EnsureChild<MeshFilter>(
    "Visual",
    create: true,
    localPosition: Vector3.zero,
    configure: mf => mf.sharedMesh = myMesh
);

// Cached field pattern
[SerializeField] private Transform effectsRoot;

void OnEnable()
{
    transform.EnsureChild(ref effectsRoot, "Effects", create: true);
}

Singleton Pattern

csharp
using Carrot;

public class AudioManager : MonoSingleton<AudioManager>
{
    public void PlaySFX(AudioClip clip) { /* ... */ }
}

// Access from anywhere
AudioManager.Instance.PlaySFX(clip);

Thread-safe, auto-creates if missing, DontDestroyOnLoad, rejects duplicates.


TinyGuid

Compact 22-character GUID encoding:

csharp
using Carrot;

TinyGuid id = TinyGuid.NewGuid();
string compact = id.Value;     // e.g. "aBcDeFgHiJkLmNoPqRsT_-"
Guid full = id.Guid;           // standard System.Guid

// Implicit conversions
string s = id;
Guid g = id;
TinyGuid fromString = "aBcDeFgHiJkLmNoPqRsT_-";

Platform & Rendering Detection

csharp
using Carrot.Platform;
using Carrot.Rendering;

// OS theme
SystemTheme theme = SystemThemeDetector.Get();
if (theme == SystemTheme.Dark) { ApplyDarkMode(); }

// Render pipeline
if (Pipeline.Current == UnityRenderPipeline.URP)
{
    SetupURPMaterials();
}

var unsub = Pipeline.Changed.Add(change =>
{
    Debug.Log($"Pipeline changed: {change.Previous} -> {change.Current}");
});
// call unsub() later to unsubscribe, or Pipeline.Changed.Remove(handler)

Add kids.kapish.signals to your asmdef references if using Pipeline.Changed from your own code.


Aspect Ratio

csharp
using Carrot.Types;

AspectRatio screen = AspectRatio.GetScreen();
Debug.Log($"Screen: {screen}");  // e.g. "16:9"

AspectRatio custom = AspectRatio.FromResolution(1920, 1080);
if (custom.IsCloseTo(AspectRatio.Standard_16_9))
{
    // Standard widescreen
}

// Fit a rect to a target aspect ratio
Rect fitted = containerRect.FitInside(AspectRatio.Standard_4_3);

Weighted Random Selection

csharp
using Carrot.Collections;

RandomList<string> loot = new RandomList<string>();
loot.Add("Common Sword");
loot.Add("Rare Shield");
loot.Add("Epic Staff");

// Add a weight clause based on item rarity
var clause = loot.AddClause(item => item.StartsWith("Common") ? 10f : item.StartsWith("Rare") ? 3f : 1f);

// Get a weighted random item
string drop = clause.Get();

Logging

csharp
using Carrot;

// Conditional logging (only in debug builds)
Info.Log("Player spawned");
Info.Log("AI", "Path recalculated");
Info.LogWarning("Low memory");
Info.LogError("Save failed");

// Carrot Logger bridge
var logger = UnityLogs.Get();
logger.HandleLog(new LogLine(LoggerLevel.Info, "Hello"));

// Write to file
UnityLogs.WriteLogToFile(diagnosticData, "Diagnostics");

Random Helpers

csharp
using Carrot;

bool coinFlip = Random2.Bool;
float randomAngle = Random2.Degrees;     // 0-360
float plusOrMinus = Random2.Sign;         // 1 or -1

float value = 5f.RandomSign();           // 5 or -5
float range = new Vector2(1f, 10f).RandomRange();

Object Pooling

Pool<T> -- Plain C# Objects

csharp
using Carrot.Pooling;

// Create a pool with 50 pre-warmed instances
var pool = new Pool<Bullet>(initialCapacity: 50);

// Acquire and return
Bullet bullet = pool.Acquire();
// ... use bullet ...
pool.Return(bullet);

// Safe acquire with capacity limit
var limitedPool = new Pool<Bullet>(initialCapacity: 10, maxCapacity: 100);

if (limitedPool.TryAcquire(out Bullet b))
{
    // got one
}

ComponentPool<T> -- Prefab Instances

csharp
using Carrot.Pooling;
using UnityEngine;

[SerializeField] private ParticleController prefab;

private ComponentPool<ParticleController> pool;

void Awake()
{
    pool = new ComponentPool<ParticleController>(prefab, initialCapacity: 20);
}

void SpawnEffect()
{
    // Spawn at a world position
    var fx = pool.Acquire(transform.position, transform.rotation);

    // Or spawn as a child of a UI container
    var slot = pool.Acquire(inventoryGrid.transform);
}

void DespawnEffect(ParticleController fx)
{
    pool.Return(fx);
}

void OnDestroy()
{
    pool.Dispose();
}

Quick-Die (Fade/Scale Out Before Recycling)

csharp
// Return with a 300ms die sequence -- item stays active while dying
pool.Return(fx, 300f, (item, progress) =>
{
    // progress goes 0 -> 1 linearly over 300ms
    item.transform.localScale = Vector3.Lerp(Vector3.one, Vector3.zero, progress);
});

// Or fade out
pool.Return(fx, 500f, (item, progress) =>
{
    Color c = item.Renderer.color;
    c.a = 1f - progress;
    item.Renderer.color = c;
});

PoolSource<T> -- Inspector-Configured Pools

For pools that live on a GameObject with inspector configuration, subclass PoolSource<T>:

csharp
using Carrot.Pooling;

// One line -- that's it. Prefab, capacity, max all show in the inspector.
public class BulletPool : PoolSource<Bullet> { }

Then reference it from other components:

csharp
[SerializeField] private BulletPool bulletPool;

void Fire()
{
    Bullet b = bulletPool.Pool.Acquire(muzzle.position, muzzle.rotation);
}

IPoolable -- Automatic Reset Hooks

csharp
using Carrot.Pooling;
using UnityEngine;

public class Enemy : MonoBehaviour, IPoolable
{
    public int Health;

    public void OnAcquire()
    {
        Health = 100;
        // reset state for reuse
    }

    public void OnReturn()
    {
        // cleanup before going back to pool
    }
}

Package Contents

kids.kapish.atoms

Package Info

FieldValue
Namekids.kapish.atoms
Display NameCarrot Atoms
Version0.1.0
Unity2022.3+
LicenseMIT
NamespaceCarrot.Atoms
AssemblyCarrot.Atoms
Dependencieskids.kapish 0.1.0

Source Files

Runtime

FileTypeDescription
Runtime/IAtom.csInterfaceIAtom -- contract for all atom instances. Defines position, scale, rotation, sprite, color, mesh, bounds helpers, and managed lifecycle methods.
Runtime/Atom.csClassAtom -- default IAtom implementation. Manages transform matrix, sprite/mesh assignment, material property blocks, color tinting, axis flipping, and bounds queries. Provides static default shader/material initialisation.
Runtime/AtomSystem.csClassAtomSystem / AtomSystem<T> -- manages a collection of atoms and renders them each frame. Automatically uses Graphics.DrawMeshInstanced when the hardware and material support GPU instancing; falls back to per-atom Graphics.DrawMesh. Groups atoms by cached hash for efficient batching (max 1023 per draw call).
Runtime/AtomSingle.csStatic ClassAtomSingle -- static helper for one-shot immediate-mode rendering of a single sprite without needing a full AtomSystem. Multiple overloads for render mode, material, and color.
Runtime/AtomicCache.csStatic ClassAtomicCache -- hash cache for sprites and meshes. Produces composite hashes used by AtomSystem to group identical atoms into GPU-instanced batches.
Runtime/AtomDefaultRenderMode.csEnumAtomDefaultRenderMode -- Opaque, OpaqueEmissive, Transparent, DepthOnly. Controls which default shader/material an atom system uses.
Runtime/Carrot.Atoms.asmdefAssembly DefinitionAssembly definition referencing the base Carrot assembly.

kids.kapish.textures

Package Info

FieldValue
Namekids.kapish.textures
Display NameCarrot.Textures
Version0.1.0
Unity6000.0+
LicenseMIT
NamespaceCarrot.Textures
AssemblyCarrot.Textures (runtime), Carrot.Textures.Editor (editor)
Dependencieskids.kapish 0.1.0

Source Files

Runtime

FileTypeDescription
Runtime/TextureExtensions.csStatic ClassTextureExtensions -- extension methods for Texture2D. MakeReadable() returns the texture as-is if already CPU-readable; otherwise blits to a RenderTexture, reads back pixels, and returns a new readable copy.
Runtime/TextureBlitUtility.csStatic ClassTextureBlitUtility -- shared GPU blit helpers. LoadShaderMaterial(shaderName) finds and wraps a shader in a temporary material. CreateTempRT / CreateTempRTHdr create pooled temporary RenderTexture instances (LDR or HDR). ReleaseTempRT returns them to the pool. Readback(rt) reads a RenderTexture into a CPU-accessible Texture2D. WritePng(tex, path) encodes to PNG and writes to disk, creating directories as needed.
Runtime/TextureSlicingCpu.csStatic ClassTextureSlicingCpu -- CPU-readback slice extraction from Texture2DArray and other texture types. ExtractSliceCpu(texture, sliceIndex) extracts a single slice as a readable Texture2D. ExtractSlicesCpu(texture, sliceCount) yields all slices lazily, reusing a single RenderTexture and material. Falls through to MakeReadable() for plain Texture2D inputs. Uses the Hidden/Textures/CopySlice shader.
Runtime/TextureSlicingGpu.csStatic ClassTextureSlicingGpu -- GPU-only slice extraction. ExtractSliceGpu(texture, sliceIndex) returns a RenderTexture containing the extracted slice (no CPU readback). ExtractSlicesGpu(texture, sliceCount) yields RenderTexture results for all slices. Uses the Hidden/Textures/CopySlice shader.

Runtime / Shaders

FileTypeDescription
Runtime/Shaders/CopySlice.shaderShaderHidden/Textures/CopySlice -- samples a Texture2DArray at a given _Slice index and outputs the result. Used internally by TextureSlicingCpu and TextureSlicingGpu.

Assembly

FileTypeDescription
Runtime/Carrot.Textures.asmdefAssembly DefinitionRuntime assembly referencing Carrot.
Editor/Carrot.Textures.Editor.asmdefAssembly DefinitionEditor-only assembly referencing Carrot.

kids.kapish.automat

Namespace: Carrot.Automat

Runtime

Core

Automat - static entry point; Read() returns an AutomatReadBuilder

AutomatTextureType - enum: Texture2D, Texture2DArray, Texture3D

Read

AutomatReadBuilder - fluent builder for loading textures into the pipeline. Add() / Add2D() / Add2DArray() / Add2DSet() / Add3D() / TryAdd(). Call ToProcess() to advance to the processing stage.

AutomatReadSource - wraps a loaded texture with metadata (size, format, sRGB, mipmap count, slice count, compressed flag). Provides lazy CPU and GPU slice caches. GetSliceCpu(int) / GetSliceGpu(int) / Dispose().

Process

AutomatProcessBuilder - collects AutomatProcessSource instances keyed by name. Add() / Sources.

AutomatProcessSource - per-slice view of a read source. Exposes lazy Cpu and Gpu accessors plus all texture metadata (size, format, dimensions, sRGB, mipmap count).

AutomatProcessSourceCpu - CPU-side pixel data. Color32[] (SDR) and Vector4[] (HDR). HDR data is either native (from float-format textures) or simulated from SDR. Exposes HdrMode (Native / Simulated).

AutomatProcessSourceGpu - GPU-side data as a named RenderTexture. Release() to clean up.

AutomatProcessHdrMode - enum: Native, Simulated

Shaders

Hidden/Automat/AtlasBlit - blits a source texture into a sub-rect of an atlas render texture

Hidden/Automat/ChannelPack - packs four source textures into RGBA channels via per-channel dot-product masks

Hidden/Automat/ChannelSplit - extracts a single channel from a source via dot-product mask, outputs as grayscale

Editor

Entry Point

AutomatEditor - extension methods for AutomatReadBuilder to load by asset path (Add2D(path), Add2DArray(path), Add2DSet(paths), Add3D(path)). Import() returns an AutomatEditorImportBuilder. Menu items: Carrot/Automat/Process All, Carrot/Automat/Process Selected, Assets/Automat/Process.

Import

AutomatEditorImportBuilder - fluent builder that loads textures by asset path with required import settings. Add2D() / Add2DArray() / Add2DSet() / Add3D(). ToRead() auto-applies import settings if they diverge, then returns an AutomatReadBuilder. ToProcess() chains through to AutomatProcessBuilder.

AutomatEditorImportSource - wraps a texture asset with its path, GUID, TextureImporter, current and required import settings, and a Tags collection.

AutomatEditorImportSourceBuilder - fluent tag/flag builder for import sources. AddFlag() / AddTag() / RemoveTag() / ModifyTags().

Import Settings

IAutomatEditorImportSettingsTexture - base interface for all texture import settings. Optional<T> fields for aniso, compression, filter mode, max size, mipmaps, NPOT, readable, sRGB, streaming, crunch, wrap modes. ApplyTo(AssetImporter) / AreAppliedTo() extension methods.

IAutomatEditorImportSettingsTexture2D - extends base with Type, AlphaSource, AlphaIsTransparency, ResizeAlgorithm, MipPreserveCoverage, AlphaTestReference, MipFadeStartEnd.

IAutomatEditorImportSettingsTexture2DArray / IAutomatEditorImportSettingsTexture3D - extend base with WrapW.

AutomatEditorImportSettingsTexture / AutomatEditorImportSettingsTexture2D / AutomatEditorImportSettingsTexture2DArray / AutomatEditorImportSettingsTexture3D - concrete implementations. FromImporter(TextureImporter) factory method to snapshot current importer state.

AutomatEditorImportProfileTexture - ScriptableObject base for import profiles (serialisable Optional<T> fields).

AutomatEditorImportProfileTexture2D / AutomatEditorImportProfileTexture2DArray / AutomatEditorImportProfileTexture3D - concrete profile assets. Create via Assets > Create > Automat > Import > Texture2D/2DArray/3D Profile.

Operations

AutomatChannelPackOperation - GPU blit operation: packs separate source textures into one multi-channel output (e.g. Occlusion + Roughness + Metallic into ORM). Uses Hidden/Automat/ChannelPack shader.

AutomatChannelSplitOperation - GPU blit operation: splits a multi-channel texture into individual grayscale outputs (e.g. ORM into separate Occlusion, Roughness, Metallic files). Uses Hidden/Automat/ChannelSplit shader.

AutomatAtlasOperation - packs multiple textures into a single atlas using RectPacker. Blits each source into its packed position, writes PNG and JSON metadata (pixel rects, UV rects, fill ratio).

AutomatImportProfileOperation - applies an import profile ScriptableObject to a texture asset and reimports.

AutomatBlitUtility - output path resolution ({name}, {suffix} patterns) and channel name/index to Vector4 mask mapping.

Pipeline

AutomatPipeline - orchestrator: resolves rules, checks dirty state, dispatches to operations. ProcessAll() / ProcessSelected() / ProcessAsset(path) / ProcessDirectory(path). Re-entrant guard via IsProcessing.

AutomatAssetPostprocessor - AssetPostprocessor that watches for texture and .automat file changes. Triggers ProcessAsset for matching textures; triggers ProcessAll when a .automat file changes.

AutomatDirtyCheck - timestamp-based dirty checking. An output is dirty if it doesn't exist or is older than its source(s).

Rules

AutomatRuleFile - JSON-deserialised .automat file containing a list of AutomatRule entries.

AutomatRule - a single rule: Name, Pattern (glob), Operation (enum), Output (path pattern), Profile, and optional ChannelSplit / ChannelPack / Atlas config blocks.

AutomatRuleOperation - enum: ChannelSplit, ChannelPack, Atlas, ImportProfile

AutomatRuleChannelSplit - config: Outputs dictionary mapping suffix to source channel indices (0=R, 1=G, 2=B, 3=A).

AutomatRuleChannelPack - config: Channels dictionary mapping target channel to source suffix. Optional SourceChannel default and per-channel override via suffix:channel syntax.

AutomatRuleAtlas - config: MaxSize, Padding, PackingMethod, SortStrategy, MetadataOutput, RewriteUvs, MeshPattern.

AutomatRuleResolver - walks directory tree root-to-leaf collecting .automat files (like .editorconfig). Leaf rules take priority. Resolve(path) / FindMatchingRule(path) / FindAllAutomatFiles().

AutomatGlobMatcher - converts glob patterns (*, ?, **) to regex. IsMatch(pattern, fileName) / IsPathMatch(pattern, path).

Assembly Definitions

AssemblyPlatformReferences
Carrot.AutomatAllCarrot, Carrot.Textures
Carrot.Automat.EditorEditorCarrot, Carrot.Precompiled, Carrot.Editor, Carrot.Automat, Carrot.Textures, Carrot.Textures.Editor, Unity.Nuget.Newtonsoft-Json

kids.kapish.meshes

Package Info

FieldValue
Namekids.kapish.meshes
Display NameCarrot Meshes
Version0.1.0
Unity2022.3+
LicenseMIT
NamespaceCarrot.Meshes, Carrot.Meshes.Builders
AssemblyCarrot.Meshes
Dependencieskids.kapish 0.1.0, kids.kapish.maths 0.1.0

Source Files

Runtime / Builders

FileTypeDescription
Runtime/Builders/MeshBuilder.csClassMeshBuilder -- accumulates vertices, triangles, colors, and UVs to produce a Unity Mesh. Supports per-vertex colors, up to 4 UV channels, auto-switches to 32-bit indices above 65535 vertices. Designed for 2D mesh construction (Z=0 default). Methods: AddVertex, AddVertices, SetColor, SetUV0-SetUV3, AddTriangle, AddTriangles, AddQuad, Build, Clear.
Runtime/Builders/BezierMeshBuilder.csClassBezierMeshBuilder -- builds Unity meshes from Bezier geometry. Tessellates BezierLoop shapes into polygons, triangulates via ear-clipping, and feeds into an internal MeshBuilder. Methods: AddFilledLoop (uniform or per-vertex color via callback), AddFilledMultiLoop, AddFilledShapes, AddFilledPolygon, AddPreTriangulated, Build, Clear.
Runtime/Builders/StrokeBuilder.csClassStrokeBuilder -- builds triangle-strip meshes from polylines with per-vertex variable width. Used for rendering strokes, outlines, and tapered lines as GPU meshes. Features mitered joins with spike clamping at acute angles. Methods: AddStroke (open, uniform or variable width), AddClosedStroke (closed outline), AddBezierStroke (from BezierStrip), AddBezierOutline (from BezierLoop), Build, Clear.

Runtime / Shaders

FileTypeDescription
Runtime/MeshShaders.csStatic ClassMeshShaders -- provides access to shared mesh rendering shaders. Lazy-loads Carrot/UnlitVertexColor shader. Factory method CreateUnlitVertexColorMaterial().
Runtime/Shaders/UnlitVertexColor.shaderShaderCarrot/UnlitVertexColor -- URP-compatible unlit shader with per-vertex color, alpha blending, back-face culling off, Z-write off, and optional stencil support. Two passes: Universal2D and SRPDefaultUnlit fallback. Properties: _Color tint, _StencilRef, _StencilComp, _StencilPass. Falls back to Sprites/Default.

Assembly

FileTypeDescription
Runtime/Carrot.Meshes.asmdefAssembly DefinitionAssembly definition referencing Carrot, Carrot.Geometry, and Carrot.Precompiled.

kids.kapish.maths

Package Info

FieldValue
Namekids.kapish.maths
Display NameCarrot Maths
Version0.1.0
Unity2022.3+
LicenseMIT
NamespaceCarrot.Geometry
AssemblyCarrot.Geometry
Dependencieskids.kapish 0.1.0

Source Files

Runtime / Geometry

FileTypeDescription
Runtime/Geometry/Bezier.csClassBezier -- 2D Bezier curve (linear, quadratic, or cubic) using Unity Vector2. Factory methods Linear(), Quadratic(), Cubic(). Supports evaluation (Solve, Derivative, GetDirection), De Casteljau subdivision, both uniform and adaptive tessellation, arc length approximation, bounds computation, and equality. Immutable after construction; tessellated points are cached.
Runtime/Geometry/BezierFactory.csClassBezierFactory -- fluent builder for constructing Bezier paths curve-by-curve. Methods AddLinear, AddQuadratic, AddCubic, Add. Builds into BezierLoop or BezierStrip.
Runtime/Geometry/BezierLoop.csClassBezierLoop -- closed loop of connected Bezier curves. Implements IReadOnlyList<Bezier>. Auto-closes the loop if endpoints don't match. Provides ExtractPolygon() for tessellated vertex extraction, winding number point-in-loop test (Contains), perimeter calculation, bounding rect, and winding direction detection. Constructable from a list of curves or from points with a specified BezierType.
Runtime/Geometry/BezierMultiLoop.csClassBezierMultiLoop -- multiple Bezier loops (outers + holes) forming a compound shape. Implements IReadOnlyList<BezierLoop>. Uses combined winding number for point containment across all loops.
Runtime/Geometry/BezierStrip.csClassBezierStrip -- open strip of connected Bezier curves. Implements IReadOnlyList<Bezier>. Provides ExtractPolyline() for tessellated vertex extraction, arc length calculation, and bounding rect. Constructable from curves or from points with a specified BezierType.
Runtime/Geometry/BezierTessellationSettings.csStruct + EnumBezierTessellationSettings -- controls tessellation strategy. BezierSubdivisionMode.LinearSteps for uniform subdivision; BezierSubdivisionMode.AdaptiveError for curvature-aware recursive midpoint subdivision. Includes convenience factories Linear(steps) and Adaptive(maxError, maxDepth). Default: adaptive with 0.5 world-unit flatness tolerance.
Runtime/Geometry/BezierType.csEnumBezierType -- Linear, Quadratic, Cubic.
Runtime/Geometry/PolygonUtils.csStatic ClassPolygonUtils -- static utilities for polygon operations. SignedArea (shoelace formula), GetWindingDirection, Contains (ray-casting even-odd point-in-polygon), ComputeBounds, Centroid, Perimeter. Accepts both ReadOnlySpan<Vector2> and IReadOnlyList<Vector2>.
Runtime/Geometry/WindingDirection.csEnumWindingDirection -- Clockwise, CounterClockwise.

Runtime / Triangulation

FileTypeDescription
Runtime/Triangulation/EarClipTriangulator.csStatic ClassEarClipTriangulator -- ear-clipping polygon triangulation for simple polygons. Returns triangle indices into the input vertex list. Auto-detects and handles both CW and CCW winding. Also provides TriangulateToTriangles() returning vertex triples, SignedArea(), Cross(), and PointInTriangle() helpers.
Runtime/Triangulation/TriangulationExtensions.csStatic ClassTriangulationExtensions -- extension methods for triangulating BezierLoop and BezierMultiLoop. Tessellates curves to polygons and runs ear-clip triangulation. BezierMultiLoop triangulation fills outer loops and skips holes.

Runtime / Interop

FileTypeDescription
Runtime/Interop/MathsInterop.csStatic ClassMathsInterop -- extension methods for converting between Carrot.Maths DLL types (Point2f, Vector2f, Vector3f, Bounds2f) and Unity native types (Vector2, Vector3, Rect). Includes bulk array conversions ToVector2Array() and ToPoint2fArray().

Assembly

FileTypeDescription
Runtime/Carrot.Geometry.asmdefAssembly DefinitionAssembly definition referencing Carrot.Precompiled.

kids.kapish.input

Package Info

FieldValue
Namekids.kapish.input
Display NameCarrot.Input
Version0.1.0
Unity6000.0+
LicenseMIT
NamespaceCarrot.Input
AssemblyCarrot.Input (runtime), Carrot.Input.Editors (editor)
Dependencieskids.kapish 0.1.0, kids.kapish.signals 0.1.0, Unity.InputSystem

Source Files

Runtime

FileTypeDescription
Runtime/CarrotInput.csStatic ClassCarrotInput -- signal-first input context stack. Maintains a global context stack and per-player stacks. Provides Context() for disposable scoped context activation, CurrentContext(playerId) for resolving the effective context, and signals ContextActivated (Signal<string>), ContextDeactivated (Signal<string>), CurrentContextChanged (Signal<ContextChange>). Includes a ContextScope struct implementing IDisposable for using-block patterns.
Runtime/ContextChange.csreadonly structContextChange -- payload for CarrotInput.CurrentContextChanged. Fields: PlayerIndex (int, -1 for global), ContextName (string?).
Runtime/CarrotInputScheme.csEnumCarrotInputScheme -- KeyboardMouse, Gamepad, Touch. Identifies the broad input scheme category.
Runtime/CarrotInputDeviceManager.csMonoBehaviourCarrotInputDeviceManager -- singleton that tracks the current input device per player and globally. Listens to InputSystem.onDeviceChange and InputUser.onChange to auto-detect device switches. Classifies gamepads by brand/model (Xbox, PlayStation, Nintendo, Steam) with capability flags. Dispatches PlayerDeviceChanged (Signal<PlayerDeviceChange>) and GlobalDeviceChanged (Signal<CarrotInputDevice>). Caches devices by composite key to avoid duplicate allocations.
Runtime/Devices/PlayerDeviceChange.csreadonly structPlayerDeviceChange -- payload for CarrotInputDeviceManager.PlayerDeviceChanged. Fields: PlayerIndex (int), Device (CarrotInputDevice).
Runtime/Adapters/CarrotInputAdapterBase.csAbstract MonoBehaviourCarrotInputAdapterBase -- base class for input adapters. On enable, enables/disables configured Input System action maps, optionally locks/hides the cursor, and activates a context via CarrotInput. Reverses all changes on disable.
Runtime/Devices/CarrotInputDevice.csClassCarrotInputDevice -- immutable device descriptor holding Scheme, Brand, Model, Glyphs, Capabilities, Name, VendorId, and ProductId.
Runtime/Devices/CarrotDeviceCapabilities.csFlags EnumCarrotDeviceCapabilities -- None, Rumble, Gyro, Touchpad, BackButtons, AnalogTriggers. Bitwise flags describing hardware capabilities.
Runtime/Devices/CarrotGamepadBrand.csEnumCarrotGamepadBrand -- Unknown, Xbox, PlayStation, Nintendo, Steam, Generic.
Runtime/Devices/CarrotGamepadModel.csEnumCarrotGamepadModel -- Unknown, Xbox360, XboxOne, XboxSeries, DualShock4, DualSense, SwitchPro, JoyConPair, SteamDeck, SteamController, Generic.
Runtime/UI/CarrotGlyphSet.csEnumCarrotGlyphSet -- KeyboardMouse, Xbox, PlayStation, Nintendo, Steam, Touch, Generic. Used to select the correct button glyph sprites for the current device.
Runtime/Carrot.Input.asmdefAssembly DefinitionRuntime assembly referencing Carrot and Unity.InputSystem.

Editor

FileTypeDescription
Editor/Carrot.Input.Editor.asmdefAssembly DefinitionEditor-only assembly referencing Carrot and Carrot.Input.

kids.kapish.data.morsels

Package Info

FieldValue
Namekids.kapish.data.morsels
Display NameCarrot.Data.Morsels
Version0.1.0
Unity6000.0+
LicenseMIT
NamespaceCarrot.Data.Morsels
AssemblyCarrot.Data.Morsels
Dependencieskids.kapish 0.1.0

Source Files

Runtime/Core

FileTypeDescription
Runtime/Core/IMorsel.csInterfaceIMorsel -- contract for all morsel entities. Defines a uint MorselId property for auto-incremented identity.
Runtime/Core/IMorsel{TKey}.csInterfaceIMorsel<TKey> -- generic contract for keyed morsel entities. Defines a TKey MorselKey property for custom key types.
Runtime/Core/IHasName.csInterfaceIHasName -- mix-in interface for morsels that carry a display name.
Runtime/Core/Morsel.csAbstract ClassMorsel -- base class implementing IMorsel. Holds MorselId (internally settable) for auto-incremented identity.
Runtime/Core/Morsel{TKey}.csAbstract ClassMorsel<TKey> -- generic base class implementing IMorsel<TKey>. Holds MorselKey (internally settable) for custom-keyed identity.

Runtime/Repos

FileTypeDescription
Runtime/Repos/MorselRepo{T}.csClassMorselRepo<T> -- typed repository for uint-keyed morsels. Auto-increments IDs on Create(). Supports Add, Set, Delete, AddRange, enumeration, and weighted random selection via GetClause. Backed by RandomDictionary<uint, T>.
Runtime/Repos/MorselRepo{TKey,TMorsel}.csClassMorselRepo<TKey, TMorsel> -- typed repository for custom-keyed morsels. Create(key) registers with an explicit key. Same CRUD surface as the uint variant but keyed by TKey.
Runtime/Repos/MorselKeyAlreadyRegisteredException.csExceptionMorselKeyAlreadyRegisteredException<T> -- thrown when a morsel with a duplicate key is added to a repository. Exposes the conflicting Key.

Runtime/IO

FileTypeDescription
Runtime/IO/MorselBinaryWriter.csClassMorselBinaryWriter -- big-endian binary writer that accumulates bytes into a List<byte>. Methods for all primitive types: WriteBool, WriteByte, WriteBytes (byte array or hex string), WriteChar, WriteShort, WriteUShort, WriteInt, WriteUInt, WriteFloat, WriteLong, WriteULong, WriteString (length-prefixed or fixed-length), WriteAddress, WriteVersion. Implements IDisposable / IAsyncDisposable.
Runtime/IO/MorselBinaryStreamWriter.csClassMorselBinaryStreamWriter -- extends MorselBinaryWriter. On dispose, flushes the accumulated byte buffer to a Stream via BinaryWriter.
Runtime/IO/MorselBinaryChunkWriter.csClassMorselBinaryChunkWriter -- extends MorselBinaryWriter. Writes into a parent writer as a chunk with a standard header (chunk ID, version, next-address) on dispose.
Runtime/IO/MorselBinaryArrayWriter.csClassMorselBinaryArrayWriter -- writes an array section into a parent MorselBinaryWriter. AddItem() returns a sub-writer per element. On dispose, writes count + skip-address + concatenated item bytes.
Runtime/IO/MorselBinaryReader.csClassMorselBinaryReader -- big-endian binary reader over a byte[]. Sequential reads for all primitive types: ReadBool, ReadByte, ReadBytes, ReadChar, ReadShort, ReadUShort, ReadInt, ReadUInt, ReadFloat, ReadLong, ReadULong, ReadString (length-prefixed or fixed-length), ReadAddress, ReadVersion. Exposes Position, Length, HasRemaining, and Seek.
Runtime/IO/MorselBinaryStreamReader.csClassMorselBinaryStreamReader -- extends MorselBinaryReader. Reads all bytes from a Stream (optimised path for MemoryStream) and passes them to the base reader.
Runtime/IO/MorselBinaryChunkReader.csStatic Class + StructMorselBinaryChunkReader -- static methods to read and skip chunk headers. MorselChunkHeader readonly struct holds Type (ushort), Version, and Next (address).
Runtime/IO/MorselBinaryArrayReader.csStatic ClassMorselBinaryArrayReader -- static ReadArray<T> reads count + skip-address then deserialises each item via a delegate. SkipArray jumps past the entire array section.

kids.kapish.entityreact

Package Info

FieldValue
Namekids.kapish.entityreact
Display NameCarrot EntityReact
Version0.1.0
Unity2022.3+
LicenseMIT
NamespaceCarrot.EntityReact
AssemblyCarrot.EntityReact
Dependencieskids.kapish 0.1.0, kids.kapish.signals 0.1.0

Source Files

Runtime

FileTypeDescription
Runtime/Entity.csScriptableObjectEntity -- data-driven entity asset created via Create > Carrot > EntityReact > Entity. Holds EntityProperties, a list of EntityTags, and a list of EntityActions. Manages a set of registered Views and broadcasts property changes to them via SendMessage. Handles deferred view registration/deregistration during broadcast to avoid collection modification.
Runtime/EntityProperties.csClassEntityProperties -- typed key-value property bag (case-insensitive keys). Stores runtime values as LateCastObject instances cloned from serialized defaults on ManagedEnable. Set<T> writes a value and triggers Entity.SendMessage. Get<T>, TryGet<T>, Has, Is<T>, GetPropertyType for reads. Implements IEnumerable<KeyValuePair<string, LateCastObject>>. Also defines EntityProperty -- a serializable key-value pair for inspector defaults.
Runtime/EntityTag.csAbstract ClassEntityTag -- a named property set attachable to an Entity. Extends EntityProperties so tag properties participate in the same change notification system. Subclasses provide DefaultValues which are applied on enable (without triggering broadcasts).
Runtime/EntityAction.csClassEntityAction -- a named, triggerable action on an entity. Holds a Name, optional Icon sprite, execution count, and an Executed signal (Signal<EntityAction>). Execute() dispatches the signal to subscribers. Create factory for runtime construction.
Runtime/LateCastObject.csClass + Enum + ExtensionsLateCastObject -- type-tagged wrapper storing heterogeneous property values. LateCastObjectType enum discriminates: String, Float, Int, Bool, Color, Gradient, Vector2/3/4, Vector2Int/3Int, Sprite, AudioClip, AnimationCurve, Object. Clone deep-copies Gradient and AnimationCurve. ToLateCastObjectType extension infers the type from a value.

Runtime/Views

FileTypeDescription
Runtime/Views/View.csMonoBehaviourView -- reactive view base class. On Start, registers with its Entity to receive property changes. ReceiveMessage dispatches changes via reflection (property set + method invoke). Resolves entity from direct reference or falls back to ViewFallback. Provides ManagedEnable, ManagedDisable, ManagedStart virtual hooks.
Runtime/Views/ViewFallback.csMonoBehaviourViewFallback -- attach to a GameObject to provide a shared entity reference for sibling View components that don't have an explicit entity assigned.
Runtime/Views/ViewReflection.csStatic ClassViewReflection -- cached reflection dispatch. SetProperty<T> sets a matching property on the view by name. InvokeMethod<T> calls {Key}_Changed(T oldValue, T newValue) on the view. Lookups cached per (Type, string, Type) / (Type, string) tuple to avoid repeated reflection.

kids.kapish.addressables

Carrot.Addressables (Runtime)

Interfaces

TypeKindDescription
IAddressableIdInterfaceContract for anything that can resolve to an Addressables key string. All loader methods accept this.

Address types

TypeKindDescription
AssetAddressReadonly structBasic addressable ID wrapping a raw string key. Supports segment-based construction and implicit string conversion.
ContentAddressReadonly structStructured address for content-platform assets. Renders to content/{contentType}/{schema}/{name}. Implicitly converts to AssetAddress and string.
AssetFamilyReadonly structDescribes a family of addressable assets sharing a label. Provides LoadAllAsync<T>() and DownloadDependenciesAsync() for bulk operations.

Handles

TypeKindDescription
AssetHandle<T>Sealed classDisposable wrapper around AsyncOperationHandle<T>. Releases the Addressables handle on dispose. Use with using for scoped lifetime.
TextHandleReadonly structCarries extracted string content after the underlying TextAsset has already been released.

Loader

TypeKindDescription
AssetLoaderStatic classAwaitable-based loading helpers. Methods: LoadAsync<T>, LoadTextAsync, InstantiateAsync, ExistsAsync. All accept IAddressableId.

Carrot.Addressables.Editor

No public types defined yet. Assembly scaffold is in place for future editor tooling.


kids.kapish.audio

Scannable reference of every public type exported by the kids.kapish.audio package.


Core (Carrot.Audio)

TypeKindDescription
AudioManagerclassCentral singleton (MonoSingleton<AudioManager>) managing all audio playback. Owns the source pool, group settings, and master volume. Access via AudioManager.Instance.
AudioEventScriptableObjectDefines a playable sound: clip references (direct or Addressable), randomisation, pitch/volume variance, cooldowns, looping, and spatial blend. Create via Create > Carrot > Audio > Audio Event.
AudioGroupenumMixing group categories: SFX, Music, Ambient, UI, Voice.
AudioGroupSettingsclassPer-group serializable settings: Volume (0-1), Muted, EffectiveVolume.
AudioHandlereadonly structLightweight handle returned from Play calls. Properties: IsValid, IsPlaying. Methods: Stop(), FadeOut(timeMs).
AudioSourcePoolinternal classWraps ComponentPool<AudioSource> for pooled source management. Acquire(), Acquire(position), Return(source).

Music (Carrot.Audio)

TypeKindDescription
MusicPlayerclassManages music playback with dual-source crossfading. Properties: IsPlaying, IsPaused. Methods: PlayAsync(AudioEvent, fadeMs), PlayAsync(AssetAddress, fadeMs), Stop(fadeOutMs), Pause(), Resume().

AudioManager API

MemberSignatureDescription
Instancestatic AudioManagerSingleton accessor (inherited from MonoSingleton<T>)
MasterVolumefloat { get; set; }Global volume multiplier (0-1)
MusicMusicPlayerLazy-created music player instance
PlayAudioHandle Play(AudioEvent)Play a 2D sound from an AudioEvent
PlayAudioHandle Play(AudioEvent, Vector3)Play a 3D positional sound from an AudioEvent
IsPlayingbool IsPlaying(uint handleId)Check if a sound is still active
Stopvoid Stop(uint handleId)Immediately stop a sound by handle ID
FadeOutvoid FadeOut(uint handleId, float timeMs)Fade a sound to silence over the given duration
GetGroupVolumefloat GetGroupVolume(AudioGroup)Get the raw volume for a group
SetGroupVolumevoid SetGroupVolume(AudioGroup, float)Set the raw volume for a group
SetGroupMutedvoid SetGroupMuted(AudioGroup, bool)Mute or unmute a group
GetEffectiveVolumefloat GetEffectiveVolume(AudioGroup)Group volume * master volume (0 if muted)

AudioEvent API

MemberSignatureDescription
GroupAudioGroupWhich mixing group this event belongs to
LoopboolWhether the sound should loop
SpatialBlendOptional<float>Override spatial blend (if unset, defaults to 1 for 3D, 0 for 2D)
HasDirectClipsboolTrue if direct AudioClip references are assigned
HasAddressableClipsboolTrue if Addressable keys are assigned
GetVolume()floatBase volume with random variance applied
GetPitch()floatBase pitch with random variance applied
CanPlay()boolFalse if still within cooldown window
MarkPlayed()voidRecord the play timestamp for cooldown tracking
GetDirectClip()AudioClipPick a clip (random or sequential) from direct references
GetAddressableClip()AssetAddressPick an Addressable key (random or sequential)

AudioHandle API

MemberSignatureDescription
IsValidboolTrue if the handle was created by a manager
IsPlayingboolTrue if the sound is still active
Stop()voidImmediately stop the sound
FadeOut(timeMs)voidFade to silence over the given duration in milliseconds

MusicPlayer API

MemberSignatureDescription
IsPlayingboolTrue if a music track is currently playing
IsPausedboolTrue if music is paused
PlayAsync(AudioEvent, fadeMs)AwaitableCrossfade to a new track from an AudioEvent (default 1000ms fade)
PlayAsync(AssetAddress, fadeMs)AwaitableCrossfade to a new track from an Addressable address
Stop(fadeOutMs)voidStop music with optional fade out (default 1000ms)
Pause()voidPause the current track
Resume()voidResume the paused track

kids.kapish.audio.fmod

Scannable reference of every public type exported by the kids.kapish.audio.fmod package.


Current Types (Carrot.Audio.Fmod)

TypeKindDescription
FmodAudioBackendstatic classPlaceholder entry point for the FMOD backend. Currently empty -- marks the integration point.

Planned Types

These types are outlined in the FmodAudioBackend TODO and will be implemented when a project requires FMOD integration:

TypeKindDescription
FmodAudioManagerclassReplaces or wraps AudioManager with FMOD dispatch. Central runtime entry point for playing events, managing buses, and loading banks.
FmodEventRefstruct/classMaps AudioEvent to FMOD event paths or GUIDs. Serializable reference to an FMOD Studio event.
FmodBankLoaderclassLoads and unloads FMOD banks, potentially integrated with Addressables for async streaming.
FmodMusicPlayerclassFMOD-native music playback with crossfade, stinger support, and adaptive music transitions. Implements the MusicPlayer interface from kids.kapish.audio.

kids.kapish.cameras

Namespace: Carrot.Cameras

Runtime

Core

TypeKindDescription
CameraDirectorMonoSingleton<CameraDirector>Manages the active rig and transitions between rigs. SetRig() / SetRigAsync(). Signals: RigChanged (Signal<RigChange>), TransitionStarted, TransitionCompleted.
RigChangereadonly structPayload for CameraDirector.RigChangedPrevious and Current (CameraRig).
CameraRigabstract CarrotBehaviourBase for all camera rigs. Owns Stack and Projection. Subclasses implement UpdateRig().
CameraStackMonoBehaviourOrdered list of CameraLayers, each backed by a Camera. Additive FOV via SetAdditiveFov(owner, delta) / ClearAdditiveFov(owner). Render-to-texture via SetRenderTarget() / ClearRenderTarget().
CameraLayerclass (serialisable)Single camera config: Name, Depth, ClearFlags, BackgroundColor, CullingMask, TargetTexture, AudioListener.
CameraProjectionstruct (serialisable)Perspective or orthographic projection. Static factories: Perspective(fov), Orthographic(size), Isometric(size). Lerp(a, b, t) for blending. ApplyTo(Camera).
CameraProjectionKindenumPerspective, Orthographic
CameraTransitionclass (serialisable)Transition config: Mode, DurationMs, Ease, EaseMode. IsCut property. Static factories: Cut(), Smooth(durationMs).
CameraTransitionModeenumCut, Lerp, Ease
CameraEffectsSlotclass (serialisable)Pipeline-agnostic post-processing holder. ProfileName, Enabled, VolumeComponent (set at runtime).

Rigs

Namespace: Carrot.Cameras.Rigs

TypeDescription
FollowRigThird-person follow camera. Target, Offset, followSpeed, lookSpeed. Collision avoidance via SphereCast with configurable collisionMask and collisionRadius.
FixedRigStatic camera at a fixed world position. Optional LookTarget with smoothed rotation tracking.
IsometricRigOrthographic isometric/top-down camera. Configurable Angle (10-89), Rotation (0-360), Zoom with range limits and smooth zoom. Sets projection to CameraProjection.Isometric.
OrbitRigOrbit camera around a target. RotateInput(h, v) and ZoomInput(delta) for input. Pitch limits, distance range, collision avoidance.

Editor

AssemblyPlatformReferences
Carrot.CamerasAllCarrot, Carrot.Precompiled, Carrot.Signals
Carrot.Cameras.EditorEditorCarrot, Carrot.Cameras, Carrot.Editor

kids.kapish.content

Domain-only first pass. Interfaces, content schema definitions, registry/hub primitives. No cloud, no editor UI, no codegen. See kids.kapish.content.providers for the live-service layer.

Carrot.Content.Assets

Identity primitives every content-compatible type implements or uses.

  • IAsset -- minimal shape all content types implement. Carries AssetId Id, AssetSource Source, AssetAvailability Availability. Schema identity and version are a type-level fact, resolved via ContentSchemaRegistry — not carried on the instance.
  • AssetId -- stable, namespaced identifier (@kapish/ember, @dev/magic_cheese). Parses into scope + local id. Struct, value-equality.
  • AssetRef<T> -- typed reference to an asset by id. Resolves via registry at read time.
  • AssetSource -- enum: Local (hand-authored SO), Remote (cloud-pushed), Generated (codegen output from a portal schema).
  • AssetAvailability -- enum: Always (visible immediately), Locked (present but not yet unlocked), Unlocked (was locked, now available). Orthogonal to Source.

Carrot.Content.Registry

Typed registries per asset domain, populated by providers.

  • IAssetRegistry<T> -- query surface for a single asset domain. TryGet, GetAll, Query, Register, Unregister, change signals.
  • AssetRegistry<T> -- default dictionary-backed implementation.
  • IAssetProvider -- contribution surface. Providers populate registries on startup, push updates at runtime.

Carrot.Content.Hub

The central orchestrator and entitlement interface.

  • ContentHub -- holds registries by type, holds registered providers, surfaces Unlock(assetId), IsUnlocked(assetId), and the ContentUnlocked signal. Singleton access with explicit reset for tests.
  • IEntitlementProvider -- Owns(assetId) query for marketplace/paid-content gating. Stub in this package; real impl lives in providers.
  • NoOpEntitlementProvider -- default, always-owns implementation. Used when no real entitlement provider is registered.

Carrot.Content.Local

The default provider — scans project for SO assets implementing IAsset and registers them. Zero-config for Unity-only games.

  • LocalAssetProvider -- walks Resources/loaded SOs, registers them with the appropriate registry based on runtime type.

Carrot.Content.Schemas

Content schema descriptors and the type-level registry.

  • ContentSchemaRegistry -- static, cached lookup from Type to the descriptors that type declares. GetDescriptors(type), TryGetDescriptor(type, schemaId, out), ImplementsSchema, GetVersion, GetPrimary. The single source of truth for "which schemas does this type carry?".
  • ContentSchemaDescriptor -- runtime model for a schema: id, version, visibility, roles, field list, validation rules, display metadata.
  • ContentSchemaFieldInfo -- per-field shape: name, CLR type, attributes, child descriptor (for composition).
  • ContentSchemaVisibility -- enum: Local, Project, Organization, Global.
  • ContentSchemaRoles -- flags: IDlcPackage, IUnlockable, IStoreListing, None.

Carrot.Content.Schemas.Attributes

Code-first content schema authoring.

  • [ContentSchema(id, version)] -- declares a class as implementing a content schema. AllowMultiple = true — one class can compose multiple schemas.
  • [ContentSchemaField] -- marks a field/property as part of the schema. Optional SchemaId partitions fields across multiple schemas on the same class; null applies to all. Prefix convention for multi-schema: Item_Name, Lootable_Rarity.
  • [ContentSchemaRequired] / [ContentSchemaRange(min, max)] -- validation markers. Prefixed to avoid clashing with System.ComponentModel.DataAnnotations.RequiredAttribute and UnityEngine.RangeAttribute.
  • [LocalisedString] -- field is a localised string (hooks into kids.kapish.localisation).
  • [AssetReference] -- field is an AssetRef<T> to another asset. Usually auto-detected on fields typed as AssetRef<T>, but explicit works too.
  • [ContentSchemaSubObject] -- inline composition: field is itself a schema-described structure. Auto-detected when the field's type carries [ContentSchema].
  • [ContentSchemaReference(id)] -- reference composition: field references another schema by id (reusable child schemas).
  • [ContentSchemaArray] -- field is an array/list of schema-described items. Auto-detected on T[] and List<T>.
  • [ContentSchemaRoles(...)] -- declares the schema's roles at class level.

Carrot.Content.Schemas.Validation

Validation primitives applied at edit time, load time, and portal-ingest time.

  • IValidator -- runs a check against a field or whole descriptor, returns ValidationResult.
  • ValidationResult -- success/failure with message list.

Carrot.Content.Schemas.Reflection

Build ContentSchemaDescriptor instances from attributed types without hand-authoring.

  • ReflectionContentSchemaBuilder -- walks a [ContentSchema]-attributed type, returns one descriptor per declared schema. Fields are partitioned by [ContentSchemaField].SchemaId when the class declares multiple schemas. Preferred entry point for callers is ContentSchemaRegistry.

kids.kapish.environment

Runtime (Carrot.Environment)

  • EnvironmentManager — the scene's environment stack façade and bake owner.
    • References: TerrainManagers (Vista), PathManagers, LowPolyEnvironment, Ocean, Sky, PostProcess (a UnityEngine.Rendering.Volume).
    • Bake All (BakeAll(), also a context-menu item): flatten → rebuild paths → drop. Drives Vista's ForceGenerate, gating PathFlattenNode.ApplyDrop across the two terrain passes and calling PathManager.RebuildAll() in between.
    • static Current — the active environment, for gameplay systems to read the stack from.
    • Editor-time only; gated on VISTA_UNITY_SPLINE && !VISTA_EXCLUDE_PRO.

Editor (Carrot.Environment.Editor)

  • EnvironmentManagerEditor — adds the prominent Bake All button and disables it while a bake is running.

Dependencies

  • kids.kapish.splines.pathsPathManager (the paths rebuilt mid-bake).
  • kids.kapish.splines.vistaPathFlattenNode (the ApplyDrop gate) and the VISTA_UNITY_SPLINE define.
  • Pinwheel Vista (Pinwheel.Vista.Runtime) — VistaManager.
  • Unity.RenderPipelines.Core.RuntimeVolume.

kids.kapish.localisation

Carrot.Localisation (Runtime)

Manager

TypeKindDescription
LocalisationMonoSingletonCentral manager. Registers locales, switches current language, resolves keys. Exposes LocaleChanged, LocaleRegistered, LocaleUnregistered signals. Access via Localisation.Instance.

Locale data

TypeKindDescription
LocaleDataScriptableObjectOne locale's full data — strings, audio keys, sprite keys, texture keys, optional LocaleFontSet, direction, display names. Arrays are cached to dictionaries on enable/validate for O(1) lookup.
LocaleFontSetScriptableObjectOptional per-locale fonts — TMP_FontAsset and legacy Font. Components opt into font swapping via applyFontFromLocale.
LocaleStringEntrySerializable structInspector row: Key + Value (TextArea).
LocaleAssetEntrySerializable structInspector row: Key + AddressableKey (used for audio/sprite/texture tables).
TextDirectionEnumLeftToRight, RightToLeft.

Manifest

TypeKindDescription
LocaleManifestSerializable classRoot JSON manifest wrapping an array of entries.
LocaleManifestEntrySerializable classcode, displayName, displayNameNative, dataAddressableKey, version, textDirection.

Loaders

TypeKindDescription
ILocaleLoaderInterfacePluggable source of LocaleData[]. Awaitable<LocaleData[]> LoadLocalesAsync(CancellationToken).
BuiltInLocaleLoaderClassReturns a fixed array of LocaleData assets shipped with the build.
AddressableLocaleLoaderClassLoads LocaleData assets from a list of addressable keys.
ManifestLocaleLoaderClassLoads a JSON manifest via addressables, then downloads each referenced locale. Primary path for CDN-driven locale extension.

Serializable references

TypeKindDescription
LocalisedStringSerializable structKey + fallback string. Implicit string conversion — drop in anywhere a string is expected.
LocalisedAudioKeySerializable structKey + fallback addressable key. ResolveAddressableKey(), ToAssetAddress(), LoadAsync() returning AssetHandle<AudioClip>.
LocalisedSpriteKeySerializable structAs above, but resolves to AssetHandle<Sprite>.
LocalisedTextureKeySerializable structAs above, but resolves to AssetHandle<Texture2D>.

UI Components

TypeKindDescription
LocalisedTextMonoBehaviourBinds LocalisedString to a TMP_Text. Optionally applies LocaleFontSet.TmpFont.
LocalisedTextUGuiMonoBehaviourBinds LocalisedString to a legacy UGUI Text. Optionally applies LocaleFontSet.LegacyFont.
LocalisedImageMonoBehaviourBinds LocalisedSpriteKey to a UGUI Image. Manages AssetHandle<Sprite> lifetime.
LocalisedRawImageMonoBehaviourBinds LocalisedTextureKey to a UGUI RawImage. Manages AssetHandle<Texture2D> lifetime.

Carrot.Localisation.Editor

TypeKindDescription
LocaleDataEditorCustom inspectorSummary panel (code/direction/key counts), key search filter over the strings list, "Rebuild Caches" button.
LocalisedStringDrawerProperty drawerRenders LocalisedString as Key + Fallback side-by-side.
LocalisationMenuStatic menu itemsTools > Carrot > Localisation > Find Missing Keys (cross-locale coverage report) and Validate Locales (duplicate codes, missing DisplayName).

kids.kapish.logging

Precompiled (Carrot.Logging.dll)

Namespace: Carrot.Logging

TypeKindDescription
ILogInterfacePrimary logging interface. Exposes level-specific ILogModule properties (Debug, Info, Warn, Error, Fatal, Verbose) and GetModule(LogLevel).
ILogModuleInterfaceA logging module for a single level. Enabled flag, Level property, and Write() overloads for message, exception, or both.
ILogSinkInterfaceSink contract. Implement Emit(LogLevel, string, Exception?) to add custom log destinations.
ICanLogInterfaceMixin interface for types that own a logger. Exposes ILog Log.
ICanLogExtensionsStatic classExtension methods on ICanLog: LogInfo(), LogDebug(), LogWarning(), LogError(), LogAt(). Support optional module prefix and indent level.
LogClassPrimary logger implementation. Created via Log.Configure() fluent chain. Each level module is enabled/disabled based on the configured minimum level.
LogConfigurationClassFluent builder. SendTo(ILogSink) adds sinks, MinimumLevel(LogLevel) sets the floor, CreateLogger() builds the ILog.
LogModuleClassConcrete ILogModule. Dispatches messages to all registered sinks when enabled.
LogLevelEnumVerbose, Debug, Information, Warning, Error, Fatal. Values match Serilog convention.

Runtime (Unity source)

Namespace: Carrot.Logging / Carrot.Logging.Sinks

TypeKindDescription
UnityConsoleSinkClassILogSink that routes messages to UnityEngine.Debug. Maps Verbose/Debug/Information to Debug.Log, Warning to Debug.LogWarning, Error/Fatal to Debug.LogError/Debug.LogException. Supports colour-coded level tags and optional timestamps.
LogConfigurationExtensionsStatic classExtension methods on LogConfiguration: SendToUnityConsole(bool includeLevel, bool includeTimestamp) and UnityConsole() (one-liner shortcut).

Assembly Definitions

AssemblyPlatformReferences
Carrot.Logging.PrecompiledAllNone (no engine references)
Carrot.LoggingAllCarrot.Precompiled, Carrot.Logging.Precompiled

kids.kapish.persistence

Package Info

FieldValue
Namekids.kapish.persistence
Display NameCarrot.Persistence
Version0.1.0
Unity6000.0+
LicenseMIT
NamespaceCarrot.Persistence
AssemblyCarrot.Persistence
Editor AssemblyCarrot.Persistence.Editor
Dependencieskids.kapish 0.1.0, kids.kapish.signals 0.1.0

Source Files

Runtime -- Orchestration

FileTypeDescription
Runtime/PersistentState.csMonoSingletonPersistentState -- top-level save/load manager. Manages save slots, auto-save (configurable interval, uses Time.unscaledDeltaTime), pluggable providers (primary + backup), save version, and lifecycle signals (SaveStarted, SaveCompleted, LoadStarted, LoadCompleted — all parameterless Signal). Writes file header with CARROT\0\0 magic, version, JSON metadata, then section chunks. On load, detects version mismatch and runs migration pipeline before reading sections. Unknown sections are skipped via chunk next-address.

Runtime -- Slots

FileTypeDescription
Runtime/SaveSlot.csClassSaveSlot -- a named save slot. Holds SaveSlotMetadata and a dictionary of registered ISaveSection instances keyed by name. Register(section) / Unregister(name) manage the section registry. GetSection(name) retrieves by name; GetSectionById(ushort) retrieves by numeric ID (used during load).
Runtime/SaveSlotMetadata.csSerializable ClassSaveSlotMetadata -- slot metadata serialized as JSON in the save file header. Fields: SlotName, DisplayName, SaveVersion (stored as string, exposed as Version), CreatedUtc / ModifiedUtc (stored as ISO 8601 strings, exposed as DateTime), PlayTimeSeconds.

Runtime -- Providers

FileTypeDescription
Runtime/ISaveProvider.csInterfaceISaveProvider -- pluggable storage backend. Methods: Exists(slotName), Load(slotName) returns byte[], Save(slotName, data), Delete(slotName), ListSlots() returns slot name array.
Runtime/LocalFileSaveProvider.csClassLocalFileSaveProvider -- default provider. Writes .sav files to Application.persistentDataPath/{subdirectory}/ (default subdirectory: saves). Auto-creates directories on save. ListSlots() returns filenames without extension.

Runtime -- Sections

FileTypeDescription
Runtime/ISaveSection.csInterfaceISaveSection -- extension point for any system that participates in save/load. Properties: SectionName (string), SectionId (ushort), SectionVersion (Version). Methods: Write(SaveBinaryWriter), Read(SaveBinaryReader, Version).
Runtime/JsonSaveSection{T}.csGeneric ClassJsonSaveSection<T> -- simple JSON-based save section for settings and small state objects. Uses JsonUtility.ToJson / FromJson<T>. Wraps a T Data property. Constraint: T : class, new().

Runtime -- Binary IO

FileTypeDescription
Runtime/SaveBinaryWriter.csClassSaveBinaryWriter -- big-endian binary writer accumulating bytes into a List<byte>. Methods: WriteBool, WriteByte, WriteBytes, WriteShort, WriteUShort, WriteInt, WriteUInt, WriteLong, WriteFloat, WriteString (length-prefixed UTF-16), WriteVersion, WriteAddress. Internal: WriteChunkHeader (returns next-address position for patching), PatchAddress. Implements IDisposable.
Runtime/SaveBinaryReader.csClassSaveBinaryReader -- big-endian binary reader over a byte[]. Methods: ReadBool, ReadByte, ReadBytes, ReadShort, ReadUShort, ReadInt, ReadUInt, ReadLong, ReadFloat, ReadString (length-prefixed UTF-16), ReadVersion, ReadAddress. Exposes Position, Length, HasRemaining, Seek. Internal: ReadChunkHeader, SkipChunk. Also defines internal SaveChunkHeader readonly struct (SectionId, Version, Next).

Runtime -- Migration

FileTypeDescription
Runtime/SaveMigration.csClassSaveMigration -- version migration pipeline. Register(from, to, migrate) adds a migration step (kept sorted by from version). NeedsMigration(from, to) checks if any steps apply. Migrate(data, from, to) runs steps in sequence, passing data through each Action<SaveBinaryReader, SaveBinaryWriter>. Logs each step and warns if the chain is incomplete.

kids.kapish.scenes

Scannable reference of every public type exported by the kids.kapish.scenes package.


Core (Carrot.Scenes)

TypeKindDescription
SceneDirectorclass (MonoSingleton)Central scene manager. Handles async loading, scene groups, loading screens, fade transitions, and addressable scenes. Access via SceneDirector.Instance.
SceneGroupScriptableObjectNamed collection of SceneRef entries that load/unload as a unit. Configurable active scene index and per-group transition override. Create via Create > Carrot > Scenes > Scene Group.
SceneRefstructFlexible scene reference -- either a build scene name or an addressable key. Factory methods: FromBuild(name), FromAddressable(key).
SceneRefKindenumBuildScene, Addressable
SceneTransitionclassTransition configuration: loading scene, fade in/out toggles, fade duration (0--2000 ms), minimum transition duration.
SceneLoadProgressclassTracks progress across multiple concurrent scene load/unload operations. Exposes Progress (0--1), TotalScenes, LoadedScenes, CurrentSceneName, IsComplete.
ILoadingScreeninterfaceContract for loading screen MonoBehaviours. Methods: Show(), Hide(), UpdateProgress(SceneLoadProgress).

SceneDirector Members

Properties

MemberTypeDescription
InstanceSceneDirectorSingleton accessor (inherited from MonoSingleton<T>)
CurrentGroupSceneGroupThe currently loaded scene group, or null if none
IsTransitioningbooltrue while a group transition is in progress

Signals

SignalPayloadDescription
GroupLoadStartedSignal<SceneGroup>Dispatched when a group transition begins
GroupLoadCompletedSignal<SceneGroup>Dispatched when a group transition finishes
ProgressChangedSignal<SceneLoadProgress>Dispatched on every progress update during a group transition

Methods

MethodReturnsDescription
LoadGroupAsync(SceneGroup, SceneTransition?, CancellationToken)AwaitableFull group transition: fade out, show loading screen, unload previous group, load new group, set active scene, enforce minimum duration, hide loading screen, fade in
LoadSceneAsync(SceneRef, LoadSceneMode, CancellationToken)AwaitableLoad a single scene (build or addressable) outside of the group system
UnloadSceneAsync(string, CancellationToken)AwaitableUnload a single build scene by name
LoadAddressableSceneAsync(IAddressableId, LoadSceneMode, CancellationToken)AwaitableLoad an addressable scene directly by address
IsSceneLoaded(string)boolCheck if a scene is currently loaded by name

SceneGroup Members

MemberTypeDescription
GroupNamestringDisplay name of the group
ScenesReadOnlySpan<SceneRef>The scenes in this group
SceneCountintNumber of scenes in the group
ActiveSceneIndexintIndex of the scene set as active for lighting (negative to skip)
TransitionSceneTransitionPer-group transition override (can be null to use the director's default)
GetScene(int)SceneRefGet a scene reference by index

SceneRef Members

MemberTypeDescription
KindSceneRefKindWhether this is a build scene or addressable scene
SceneNamestringBuild scene name (when Kind == BuildScene)
AddressableKeystringAddressable key (when Kind == Addressable)
IsValidboolWhether the reference has a non-empty name/key
DisplayNamestringHuman-readable name (scene name or addressable key)
FromBuild(string)SceneRefCreate a build scene reference
FromAddressable(string)SceneRefCreate an addressable scene reference
ToAssetAddress()AssetAddressConvert to an AssetAddress for the addressables system

SceneTransition Members

MemberTypeDescription
LoadingSceneSceneRefScene containing an ILoadingScreen MonoBehaviour
HasLoadingSceneboolWhether a valid loading scene is configured
FadeOutboolWhether to fade to black before loading (default: true)
FadeInboolWhether to fade from black after loading (default: true)
FadeDurationMsfloatDuration of each fade in milliseconds (0--2000, default: 300)
MinimumDurationMsfloatMinimum total transition time in milliseconds (ensures loading screens are visible long enough)

SceneLoadProgress Members

MemberTypeDescription
TotalScenesintTotal number of scene operations (unloads + loads)
LoadedScenesintNumber of completed operations
CurrentSceneNamestringName of the scene currently being loaded/unloaded
ProgressfloatOverall progress from 0 to 1, including current operation's sub-progress
IsCompleteboolWhether all operations have finished
ProgressChangedSignal<SceneLoadProgress>Dispatched on every progress update

kids.kapish.signals

Runtime (Carrot.Signals)

Namespace: Carrot.Signals

Pure C# core

TypeKindDescription
SignalClassNon-generic signal for events with no payload. Add, Once, Remove, Dispatch, Clear, ListenerCount. Dispatch-safe add/remove.
Signal<T>ClassTyped event signal. Subscribe with Add(Action<T>), fire with Dispatch(T). Same surface as Signal with a typed payload.

ScriptableObject signals

TypeKindMenuDescription
SignalAssetScriptableObjectCarrot/Signals/SignalWraps a non-generic Signal. Exposes Dispatch(), Signal, ListenerCount. Clears handlers on OnDisable.
SignalAsset<T>Abstract ScriptableObject--Base class for typed signal assets. Wraps a Signal<T>.
SignalAssetIntScriptableObjectCarrot/Signals/Signal (int)Concrete SignalAsset<int>.
SignalAssetFloatScriptableObjectCarrot/Signals/Signal (float)Concrete SignalAsset<float>.
SignalAssetStringScriptableObjectCarrot/Signals/Signal (string)Concrete SignalAsset<string>.
SignalAssetBoolScriptableObjectCarrot/Signals/Signal (bool)Concrete SignalAsset<bool>.
SignalAssetGameObjectScriptableObjectCarrot/Signals/Signal (GameObject)Concrete SignalAsset<GameObject>.
SignalAssetVector2ScriptableObjectCarrot/Signals/Signal (Vector2)Concrete SignalAsset<Vector2>.
SignalAssetVector3ScriptableObjectCarrot/Signals/Signal (Vector3)Concrete SignalAsset<Vector3>.

MonoBehaviour bridges

TypeKindMenuDescription
SignalEmitterMonoBehaviourCarrot/Signals/Signal EmitterDispatches an assigned SignalAsset via the Dispatch() method. Callable from UnityEvent wiring.
SignalListenerMonoBehaviourCarrot/Signals/Signal ListenerSubscribes to a SignalAsset on OnEnable, invokes a UnityEvent response. Unsubscribes on OnDisable.
SignalListener<T>Abstract MonoBehaviour--Base class for typed listeners. Invokes UnityEvent<T> with the dispatched payload.
SignalListenerIntMonoBehaviourCarrot/Signals/Signal Listener (int)Concrete SignalListener<int>.
SignalListenerFloatMonoBehaviourCarrot/Signals/Signal Listener (float)Concrete SignalListener<float>.
SignalListenerStringMonoBehaviourCarrot/Signals/Signal Listener (string)Concrete SignalListener<string>.
SignalListenerBoolMonoBehaviourCarrot/Signals/Signal Listener (bool)Concrete SignalListener<bool>.
SignalListenerGameObjectMonoBehaviourCarrot/Signals/Signal Listener (GameObject)Concrete SignalListener<GameObject>.
SignalListenerVector2MonoBehaviourCarrot/Signals/Signal Listener (Vector2)Concrete SignalListener<Vector2>.
SignalListenerVector3MonoBehaviourCarrot/Signals/Signal Listener (Vector3)Concrete SignalListener<Vector3>.

Editor (Carrot.Signals.Editor)

Namespace: Carrot.Signals.Editor

TypeTargetDescription
SignalAssetEditorSignalAssetListener count display + Dispatch button (Play mode only).
SignalAssetIntEditorSignalAssetIntListener count + int test value field + Dispatch button.
SignalAssetFloatEditorSignalAssetFloatListener count + float test value field + Dispatch button.
SignalAssetStringEditorSignalAssetStringListener count + string test value field + Dispatch button.
SignalAssetBoolEditorSignalAssetBoolListener count + bool toggle + Dispatch button.
SignalAssetGameObjectEditorSignalAssetGameObjectListener count + GameObject object field + Dispatch button.
SignalAssetVector2EditorSignalAssetVector2Listener count + Vector2 field + Dispatch button.
SignalAssetVector3EditorSignalAssetVector3Listener count + Vector3 field + Dispatch button.

API Surface

Signal

MemberSignatureDescription
AddAction Add(Action handler)Subscribe a handler. Returns an unsubscribe Action.
OnceAction Once(Action handler)Subscribe a handler that fires once then auto-removes. Returns an unsubscribe Action.
Removevoid Remove(Action handler)Unsubscribe a specific handler.
Dispatchvoid Dispatch()Fire the signal, invoking all handlers.
Clearvoid Clear()Remove all handlers (regular, once, and pending).
ListenerCountint (property)Current number of subscribed handlers.

Signal<T>

MemberSignatureDescription
AddAction Add(Action<T> handler)Subscribe a handler. Returns an unsubscribe Action.
OnceAction Once(Action<T> handler)Subscribe a handler that fires once then auto-removes. Returns an unsubscribe Action.
Removevoid Remove(Action<T> handler)Unsubscribe a specific handler.
Dispatchvoid Dispatch(T value)Fire the signal, invoking all handlers with the given value.
Clearvoid Clear()Remove all handlers (regular, once, and pending).
ListenerCountint (property)Current number of subscribed handlers.

SignalAsset

MemberSignatureDescription
SignalSignal (property)Underlying pure-C# signal. Use .Add(handler) to subscribe.
Dispatchvoid Dispatch()Fire the underlying signal.
ListenerCountint (property)Forwarded from the underlying Signal.
OnDisableprotected virtual voidClears all handlers.

SignalAsset<T>

MemberSignatureDescription
SignalSignal<T> (property)Underlying pure-C# signal.
Dispatchvoid Dispatch(T value)Fire the underlying signal with value.
ListenerCountint (property)Forwarded from the underlying Signal<T>.
OnDisableprotected virtual voidClears all handlers.

SignalEmitter

MemberSignatureDescription
SignalSignalAsset (property)Assigned asset to dispatch.
Dispatchvoid Dispatch()Dispatches the assigned signal (no-op if null). Callable from UnityEvent wiring.

SignalListener / SignalListener<T>

MemberSignatureDescription
SignalSignalAsset / SignalAsset<T> (property)Asset to subscribe to. Setter reconnects if currently enabled.
ResponseUnityEvent / UnityEvent<T> (property)Event invoked on dispatch.
OnEnableprivate voidSubscribes to Signal.
OnDisableprivate voidUnsubscribes from Signal.

Assembly Definitions

AssemblyPlatformReferencesEngine References
Carrot.SignalsAllNoneYes (noEngineReferences: false)
Carrot.Signals.EditorEditorCarrot.SignalsYes

kids.kapish.splines

Namespace: Carrot.Splines

Runtime

TypeKindDescription
StripCalculatorstatic classStrip[] ComputeAll(SplineContainer, StripSettings, ITerrainSampler = null) and Strip Compute(...). Samples splines into ribbons; defaults to a RaycastTerrainSampler when conforming and none is given.
Stripsealed classOne spline's ribbon. StripSample[] Samples, float TotalArcLength, int SplineIndex, int SampleCount, bool IsEmpty, static Empty.
StripSamplestructPer-sample data: ArcLength, HalfWidth, FalloffY, position/tangent, Slope, Camber.
StripSampleFlagsenum : bytePer-sample flags.
StripSettingssealed class (serialisable)Width, SampleSpacing, MiterLimit, ConformToTerrain, SurfaceOffset, RaycastDistance, EnableEndFalloff, FalloffDistance, FalloffDepth.

Dependencies

DependencyKind
kids.kapish.terrainsruntime — ITerrainSampler / RaycastTerrainSampler for terrain conforming
com.unity.splinesruntime — SplineContainer sampling

See also

kids.kapish.splines.paths — authoring components, Scene-view preview, and mesh generation on top of this core.


kids.kapish.splines.meshes

Namespace: Carrot.Splines.Meshes

Runtime — Carrot.Splines.Meshes

TypeKindDescription
StripProfilePointstructOne cross-section point: Across (0 = Left edge, 1 = Right edge; outside [0,1] extends past), Up (metres along the frame up), U (texture U across).
StripProfileabstract class (serialisable)The cross-section extruded along a strip. GetCrossSection(List<StripProfilePoint>); Closed (outline/tube vs open ribbon). Subclass per primitive (e.g. WallProfile).
StripMeshBuilderstatic classList<Mesh> Build(Strip, StripProfile, float segmentLength, bool capEnds, Matrix4x4 worldToLocal, float chunkLength, bool flipFaces = false). Resample → place → stitch → cap, split into chunks (caps on true ends only, seams butt). Outward-aligned winding; flat per-face normals (unwelded, explicit); convex-section caps (fan).

Dependencies

DependencyKind
kids.kapish.splinesruntime — Strip / StripSample geometry
kids.kapish.meshesruntime — MeshBuilder assembly

kids.kapish.splines.paths

Namespaces: Carrot.Splines.Paths, Carrot.Splines.Paths.Editor

Runtime — Carrot.Splines.Paths

TypeKindDescription
SplineGeometrySourcePathMonoBehaviour : SplineStripSourceThe path source — one per container. Declares Kind = Path, owns StripSettings + the strip geometry (GetStrips()), draws the preview (DrawAllSplines, DrawCenter/DrawEdges/DrawRibbon/… colours). The consumers below [RequireComponent] it and read its strips. Menu: Carrot/Splines/Path Source.
PathMeshStripMonoBehaviour, IBakeable (requires source)Bakes path meshes from the source's strip. Material, MeshSettings, OutputRoot (default Assets/App/Generated), Rebuild(), TearDown(), BakedChunks, TotalVertexCount, TotalTriangleCount. Menu: Carrot/Splines/Path Mesh Strip.
SplineManagerMonoBehaviourKind-agnostic group manager: collects child SplineGeometrySources + IBakeable consumers, draws previews (ShowAllPreviews), reports SourceCount/CountOfKind/BakeableCount, RefreshCache(), RebuildAll(), TearDownAll(). (Lives here for now; moves to base splines with the connection graph.) Menu: Carrot/Splines/Spline Manager.
PathMeshBuilderstatic classList<Mesh> Build(Strip, PathMeshSettings, Matrix4x4 worldToLocal) and an overload without the matrix. Sweeps the settings' PathProfile along the strip; assembles via kids.kapish.meshes' MeshBuilder.
PathMeshSettingssealed class (serialisable)Profile ([SerializeReference] PathProfile), TargetSegmentLength, WidthSubdivisions, DiagonalPattern, EnableEdgeSkirt, SkirtWidth, SkirtDepth, ChunkLength.
DiagonalPatternenumTriangulation diagonal pattern for the strip mesh.
PathProfilePointstructOne cross-section point: Across (0 = Left edge, 1 = Right edge; outside [0,1] extends past the edges), Up (metres along the frame up), U (texture coord across).
PathProfileabstract class (serialisable)Defines the cross-section swept along the path. GetCrossSection(List<PathProfilePoint>), ordered Left→Right. Subclass for new shapes.
FlatPathProfilePathProfileEven flat strip across the full width — the default; reproduces the original path exactly.
CrownPathProfilePathProfileCambered: raised centre (CrownHeight) falling to the edges. Worked example of a non-flat profile.

Object mode (tile cage-deformed templates along the path)

TypeKindDescription
PathObjectStripMonoBehaviour, IBakeable (requires source)Tiles template prefabs along the source's strip and cage-deforms each tile to follow the path's curve (boardwalks, fences, kerbs, sleepers…). ObjectSettings, OutputRoot (default Assets/App/Generated), Rebuild(), TearDown(), BakedMeshes, TotalVertexCount, TotalTriangleCount. Bakes one mesh per material; editor-time. Menu: Carrot/Splines/Path Object Strip.
PathObjectSettingssealed class (serialisable)Templates, Seed, TileLength (0 = template's own length), CompressToFit, StretchToWidth.
PathObjectTemplatestruct (serialisable)Source (prefab, authored +Z forward / X across / Y up), Weight (rare = low weight), Scale.
PathObjectMeshBuilderstatic classList<PathObjectMesh> Build(Strip, PathObjectSettings, Matrix4x4 worldToLocal). Tiles + cage-deforms each template through the strip frame (Z → arc span, X → across, Y → up), seeded + deterministic, grouped by material.
PathObjectMeshstructOne baked, deformed mesh + its Material.

Editor — Carrot.Splines.Paths.Editor

TypeKindDescription
PathManagerEditorEditorCustom inspector for SplineManager (bulk rebuild / tear-down).
PathMeshStripEditorEditorCustom inspector for PathMeshStrip (rebuild + mesh save).
PathObjectStripEditorEditorCustom inspector for PathObjectStrip (baked stats + rebuild / tear-down).

Dependencies

DependencyKind
kids.kapish.splinesruntime — Strip / StripCalculator strip generation
kids.kapish.terrainsruntime — terrain conforming via ITerrainSampler
com.unity.splinesruntime — SplineContainer

kids.kapish.splines.vista

Namespaces: Carrot.Splines.Vista, Carrot.Splines.Vista.Editor

Runtime — Carrot.Splines.Vista

TypeKindDescription
PathVistaLinkMonoBehaviour [ExecuteInEditMode] [RequireComponent(SplineContainer)]Registers three Vista spline evaluators from one SplineContainer{id}--thin, {id}--path, {id}--wide — at thinWidth / pathWidth / pathWidth + 2·edgeWidth. smoothness, alignHorizontal. conformToTerrain (default on) + terrainLayers + raycastDistance: raycasts each centre-line sample down to the terrain and sets the whole cross-section to that height (level/equiheight ribbon hugging the terrain) — this is what lets Path Flatten level the path. Ribbon layout matches Vista's stock UnitySplineEvaluator (centre α 1, edge α 0; 4 tris/segment). Menu: Carrot/Splines/Vista/Path Vista Link. VISTA_UNITY_SPLINE && !VISTA_EXCLUDE_PRO.
PathFlattenNodeVista graph node (ImageNodeBase)Game/Path Flatten. Inputs Height, Falloff Detail, Decamber Mask; single splineId (reads {id}--wide). Conforms terrain to the (level) ribbon via Vista Ramp + Drop clearance, then blends original→flattened by decamber (0–1) × the Decamber Mask. rampCurve shapes the across-path blend. Shaders: Hidden/Vista/Graph/Ramp, …/PathFlatten, …/PathDecamber.
PathFlattenSimpleNodeVista graph node (ImageNodeBase)Game/Path Flatten (Simple). The original Ramp + Drop flatten (no decamber/mask). Kept for the cases where the plain version is enough.

Resources

AssetDescription
Resources/Carrot/Shaders/PathFlatten.shaderShader "Hidden/Carrot/Terrain/PathFlatten"out = height − mask·drop.
Resources/Carrot/Shaders/PathDecamber.shaderShader "Hidden/Carrot/Terrain/PathDecamber"out = lerp(height, flat, saturate(amount·mask)).

Editor — Carrot.Splines.Vista.Editor

TypeKindDescription
VistaUnitySplineDefinestatic [InitializeOnLoad]Ensures VISTA_UNITY_SPLINE is in the active build target's scripting define symbols. Compiles only under the VISTA define (defineConstraints), so it acts only in a Vista project. Add-only / idempotent — never rewrites if already set.

Dependencies

DependencyKind
kids.kapish.splinesfamily / intent — the Vista arm of the Carrot splines
com.unity.splinesfunctional precondition — guarantees Unity Splines is present before VISTA_UNITY_SPLINE is set

Vista itself is detected via the VISTA define (set by Vista's own installer); it is an Asset Store import, not a UPM dependency.


kids.kapish.splines.walls

Namespaces: Carrot.Splines.Walls, Carrot.Splines.Walls.Editor

Runtime — Carrot.Splines.Walls

TypeKindDescription
WallProfileabstract class : StripProfile (serialisable)Closed wall cross-section. Height, ColliderHeight.
SolidWallProfileWallProfilePlain rectangular wall (the default).
HedgeProfileWallProfileRectangular body with chamfered top corners. TopChamfer.
FenceProfileWallProfileThin body with a pointed top cap. CapHeight.
SplineGeometrySourceWallMonoBehaviour : SplineStripSourceThe wall source — one per container, Kind = Wall. Owns StripSettings (defaults: Width = thickness, ConformToTerrain on, Upright = 1 so it stands vertical, base mounted). The consumer below requires it. Menu: Carrot/Splines/Wall Source.
WallColliderModeenumNone / Box (AABB-ish boxes) / ConvexHull (a convex-hull mesh per section, follows curves).
WallMeshStripMonoBehaviour, IBakeable (requires SplineGeometrySourceWall)Bakes the swept wall mesh (chunked) + per-section colliders from the source's strip. Profile, Material, SegmentLength, ChunkLength, CapEnds, FlipFaces, ColliderMode, ColliderSegmentLength, OutputRoot, Rebuild(), TearDown(), BakedMeshes, TotalVertexCount. Menu: Carrot/Splines/Wall Mesh Strip.

Editor — Carrot.Splines.Walls.Editor

TypeKindDescription
WallMeshStripEditorEditorBaked stats + rebuild / tear-down.

Dependencies

DependencyKind
kids.kapishruntime — IBakeable
kids.kapish.splinesruntime — Strip / StripCalculator / StripSettings
kids.kapish.splines.meshesruntime — StripProfile / StripMeshBuilder
com.unity.splinesruntime — SplineContainer

kids.kapish.statemachines

Scannable reference of every public type exported by the kids.kapish.statemachines package.


Unity Runtime (Carrot.StateMachines)

TypeKindDescription
StateMachineHostMonoBehaviourOwns and runs a StateMachine<IStateNode, StateEdge>. Handles Unity lifecycle (Update ticks), Awaitable-based async transitions, and bridges between the netstandard engine and Unity. Dispatches StateChanged (Signal<StateChange>) after every transition.
StateChangereadonly structPayload for StateMachineHost.StateChangedFrom and To state IDs (both string).
StateMachineLoaderstatic classLoads state machine templates from Addressables, deserializes them, and builds runnable machines. Can load directly or into a host.
StateMachineTemplateAssetScriptableObjectWraps raw JSON for a StateMachineTemplate. JSON-library-agnostic -- deserialization is handled by the consumer. CreateAssetMenu: Carrot/State Machine Template.
IStateNodeAwaitableinterfaceUnity-native async state node using Awaitable. Zero-alloc, PlayerLoop-integrated. Extends IStateNode with OnEnterAsync and OnExitAsync.

Editor (Carrot.StateMachines.Editor)

TypeKindDescription
StateMachineTemplateAssetEditorCustomEditorInspector for StateMachineTemplateAsset. Shows Schema ID field, JSON text area, and a Validate JSON button.

Precompiled Core (Carrot.StateMachines -- from DLL)

State Machine

TypeKindDescription
StateMachine<TNode, TEdge>sealed classRuntime state machine instance. Generic over node and edge types. Manages state graph, transitions, ticking, guard evaluation, and re-entrancy protection.
StateMachineBuildersealed classFluent builder for code-first state machines using callback-based StateNode/StateEdge.
StateMachineBuilder<TNode, TEdge>sealed classFluent builder for state machines with custom node/edge types.
StateMachineFactorystatic classBuilds a StateMachine<IStateNode, StateEdge> from a StateMachineTemplate using a handler registry. Resolves composite guards (all/any/not).

Nodes (Carrot.StateMachines.Nodes)

TypeKindDescription
IStateNodeinterfaceContract for state nodes: Id, OnEnter, OnExit, OnTick.
IStateNodeAsyncinterfaceExtends IStateNode with Task-based OnEnterAsync/OnExitAsync.
IStateNodeHandlerinterfaceFactory that creates an IStateNode from template params. Registered in the handler registry by node type string.
StateNodeclassCallback-based state node for code-first machines. Accepts Action delegates for enter, exit, and tick.

Edges (Carrot.StateMachines.Edges)

TypeKindDescription
IStateEdgeinterfaceContract for state edges: Id, From, To, Trigger, EvaluateGuard.
StateEdgeclassDefault edge implementation with optional IStateGuard. Auto-generates an ID from from->to:trigger.
IStateGuardinterfaceGuard condition: Evaluate() returns true if the transition is allowed.
IStateGuardHandlerinterfaceFactory that creates an IStateGuard from template params. Registered by guard type string.
StateGuardsealed classFunc<bool>-based guard for code-first machines.
StateGuardAllsealed classComposite guard -- all children must pass.
StateGuardAnysealed classComposite guard -- any child must pass.
StateGuardNotsealed classComposite guard -- negates a single child.

Templates (Carrot.StateMachines.Templates)

TypeKindDescription
StateMachineTemplatesealed classSerializable template describing a state machine's structure. String-based, JSON-friendly wire format between authoring tools and the runtime.
StateMachineTemplateNodesealed classA node within a template. Id, Type, Params, and namespaced Meta dictionary.
StateMachineTemplateEdgesealed classAn edge within a template. Id, From, To, Trigger, optional Guard, and namespaced Meta.
StateMachineTemplateGuardsealed classA guard within a template edge. Supports composites via Children (for all/any/not).
StateMachineHandlerRegistrysealed classMaps node and guard type strings to their handler factories. Fluent RegisterNodeHandler/RegisterGuardHandler with both interface and delegate overloads.

kids.kapish.terrains

Namespace: Carrot.Terrains

Runtime

TypeKindDescription
ITerrainSamplerinterfaceSurface query abstraction. bool TrySampleSurface(Vector3 referencePosition, out Vector3 surfacePoint, out Vector3 surfaceNormal).
RaycastTerrainSamplersealed class : ITerrainSamplerDownward Physics.Raycast sampler. Fields: LayerMask LayerMask, float RaycastDistance. Constructor (LayerMask, float raycastDistance) (raycast distance is clamped to a sensible minimum).

Dependencies

None beyond the Unity engine.


kids.kapish.terrains.urp

Runtime / Shaders

AssetShader nameDescription
TerrainVertexColor.shadergraphCarrot/Terrain/Vertex ColorURP Lit Shader Graph. Vertex colour → Power(2.2) (sRGB correction) → multiplied by a tint Color property → BaseColor. Metallic and Smoothness exposed as float properties. No subgraphs or custom functions — stock URP nodes only.

Dependencies

DependencyKind
com.unity.render-pipelines.universalruntime — URP target for the Shader Graph

kids.kapish.terrains.vista

Namespaces: Carrot.Terrains.Vista, Carrot.Terrains.Vista.Editor

All types are gated behind #if VISTA and the assemblies carry a VISTA define constraint. They are present only when Vista is installed.

Runtime — Carrot.Terrains.Vista

TypeBaseVista menuDescription
InputNodeDefaultPinwheel.Vista.Graph.InputNodeIO / Graph Input (Default)Graph Input with an extra Default input pin used as a fallback when the input is not externally supplied. Tracks the input's slot type; behaves as a stock Graph Input when consumed.
ColorLerpNodeImageNodeBaseGame / Color Lerplerp(A * colorA, B * colorB, mask) over two colour textures. Shader Hidden/Game/Terrain/ColorLerp.
ColorTintByMaskNodeImageNodeBaseGame / Color Tint By Masklerp(input, input * tint, mask * strength). Shader Hidden/Game/Terrain/ColorTintByMask.
FlipYNodeImageNodeBaseGame / Flip YVertical mask flip. Shader Hidden/Game/Terrain/FlipY.
InvertNodeImageNodeBaseGame / Invert1 - input over a mask. Shader Hidden/Game/Terrain/Invert.

Resources

AssetDescription
Resources/Game/Shaders/ColorLerp.shaderShader "Hidden/Game/Terrain/ColorLerp" — loaded by name via ShaderUtilities.Find.
Resources/Game/Shaders/ColorTintByMask.shaderShader "Hidden/Game/Terrain/ColorTintByMask".
Resources/Game/Shaders/FlipY.shaderShader "Hidden/Game/Terrain/FlipY".
Resources/Game/Shaders/Invert.shaderShader "Hidden/Game/Terrain/Invert".

Editor — Carrot.Terrains.Vista.Editor

TypeBaseDescription
InputNodeDefaultEditorPinwheel.VistaEditor.Graph.ExecutableNodeEditorBase[NodeEditor(typeof(InputNodeDefault))]. Name field with the reserved-name picker, slot-type popup, and output-port labelling.

Dependencies

External (not on a UPM feed — installed via the Asset Store):

Assembly referencesProvided by
Pinwheel.Vista.RuntimeVista (runtime)
Pinwheel.Vista.EditorVista (editor)

kids.kapish.tracking

Runtime (Carrot.Tracking)

Namespace: Carrot.Tracking

Core types

TypeKindDescription
TrackerMonoSingletonCentral orchestrator. Manages providers, consent, queue, log sink, and signals. Access via Tracker.Instance.
ITrackingProviderInterfacePluggable analytics backend. Semantic methods: PageView, Event, Identify, Reset. One implementation per platform (App Insights, GA, Meta Pixel, etc.).
ITrackingLogSinkInterfaceOptional bridge from tracking into a logger. Implement with a small adapter; tracking has no hard logging dependency.
ConsentStateEnumPending / Granted / Denied.
TrackingPropertiesClass (Dictionary<string, object>)Property bag with fluent .With(key, value) builder and Create / From factory helpers.
TrackingEventReadonly structSignal payload for EventTracked. Fields: Name, Properties.
TrackingPageViewReadonly structSignal payload for PageViewTracked. Fields: Path, Properties.

Providers

Namespace: Carrot.Tracking.Providers

TypeKindDescription
DebugTrackingProviderMonoBehaviourBuilt-in. Prints tracking calls to the Unity console with a configurable prefix.
AppInsightsTrackingProviderMonoBehaviour (stub)Placeholder for Azure Application Insights. Integration path documented in the source file.
LogAnalyticsTrackingProviderMonoBehaviour (stub)Placeholder for Azure Log Analytics Workspace (HTTP Data Collector API). Integration path documented in the source file.

API Surface

Tracker

MemberSignatureDescription
InstanceTracker (static)MonoSingleton accessor.
ConsentConsentState (property)Current consent state.
Consentlessbool (property)If true, all events bypass consent gating.
QueueSizeint (property)Current number of events queued while Pending.
ProvidersIReadOnlyList<ITrackingProvider> (property)Registered providers.
LogSinkITrackingLogSink (property)Optional logger bridge. Echo fires before consent gating.
ConsentChangedSignal<ConsentState>Dispatched on every SetConsent transition.
EventTrackedSignal<TrackingEvent>Dispatched on every Event(...) call, regardless of consent.
PageViewTrackedSignal<TrackingPageView>Dispatched on every PageView(...) call, regardless of consent.
AddProvidervoid AddProvider(ITrackingProvider)Register a provider. Throws ArgumentNullException if null.
RemoveProvidervoid RemoveProvider(ITrackingProvider)Unregister a provider.
InitializeProvidersvoid InitializeProviders()Call Initialize() on every registered provider. Each wrapped in try/catch.
SetConsentvoid SetConsent(ConsentState)Update consent. Granted flushes queue, Denied clears it. Dispatches ConsentChanged. No-op if unchanged.
PageViewvoid PageView(string path, TrackingProperties = null)Record a page/screen view.
Eventvoid Event(string name, TrackingProperties = null)Record a named event.
Identifyvoid Identify(string userId, TrackingProperties = null)Associate subsequent events with a user.
Resetvoid Reset()Clear per-user state across all providers.

Inspector fields on Tracker

FieldTypeDefaultDescription
consentlessboolfalseSkip consent gating entirely.
maxQueueSizeint500Max events queued while Pending. Oldest dropped when full.

ITrackingProvider

MemberSignatureDescription
Namestring (property)Provider identifier used in error logs.
Initializevoid Initialize()Called once by Tracker.InitializeProviders. Perform SDK setup here.
PageViewvoid PageView(string path, TrackingProperties = null)Record a page / screen view.
Eventvoid Event(string name, TrackingProperties = null)Record a named event.
Identifyvoid Identify(string userId, TrackingProperties = null)Associate user identity and traits.
Resetvoid Reset()Clear per-user state. Providers that don't support reset should no-op.

ITrackingLogSink

MemberSignatureDescription
OnPageViewvoid OnPageView(string path, TrackingProperties)Invoked before consent gating.
OnEventvoid OnEvent(string name, TrackingProperties)Invoked before consent gating.
OnIdentifyvoid OnIdentify(string userId, TrackingProperties traits)Invoked before consent gating.
OnResetvoid OnReset()Invoked before consent gating.

TrackingProperties

MemberSignatureDescription
WithTrackingProperties With(string key, object value)Fluent setter. Overwrites existing key. Returns this.
Createstatic TrackingProperties Create()Empty instance.
Fromstatic TrackingProperties From(string key, object value)Shorthand for Create().With(key, value).
(ctor)TrackingProperties()Empty dictionary.
(ctor)TrackingProperties(IDictionary<string, object>)Copy from an existing dictionary.

Inherits the full Dictionary<string, object> API (indexer, Add, ContainsKey, iteration, etc.).

ConsentState

ValueMeaning
PendingNo decision yet. Events are queued up to maxQueueSize, oldest dropped when exceeded. Signals still fire.
GrantedEvents forward to providers. Queued events are flushed on transition into this state.
DeniedEvents are dropped. Queued events are cleared on transition into this state. Signals still fire.

TrackingEvent / TrackingPageView (signal payloads)

TypeFields
TrackingEventstring Name, TrackingProperties Properties
TrackingPageViewstring Path, TrackingProperties Properties

Assembly Definitions

AssemblyPlatformReferencesEngine References
Carrot.TrackingAllCarrot, Carrot.Precompiled, Carrot.SignalsYes
Carrot.Tracking.EditorEditorCarrot, Carrot.Tracking, Carrot.EditorYes

Package Dependencies

PackageVersionReason
kids.kapish0.1.0MonoSingleton<T> base class for Tracker.
kids.kapish.signals0.1.0Signal<T> for ConsentChanged, EventTracked, PageViewTracked.

Not depended on: kids.kapish.logging. Logging integration is opt-in via ITrackingLogSink.

File Structure

Runtime/
  Carrot.Tracking.asmdef               # references Carrot, Carrot.Precompiled, Carrot.Signals
  Tracker.cs                           # MonoSingleton orchestrator
  ITrackingProvider.cs                 # provider contract
  ITrackingLogSink.cs                  # optional logger bridge
  ConsentState.cs                      # Pending / Granted / Denied
  TrackingProperties.cs                # Dictionary<string, object> + With()
  TrackingEvent.cs                     # TrackingEvent, TrackingPageView payloads
  Providers/
    DebugTrackingProvider.cs           # built-in console provider
    AppInsightsTrackingProvider.cs     # stub with integration notes
    LogAnalyticsTrackingProvider.cs    # stub with integration notes

Editor/
  Carrot.Tracking.Editor.asmdef        # Editor-only assembly

Carrot