Appearance
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:
- They are the targets of custom
[CustomEditor]inspectors that use the[Group]attribute system for automatic field grouping with foldouts. - 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,ColorYIQwith implicit conversions and full operator overloads - Color manipulation: Extension methods for hue/saturation/lightness/value modification, pastel generation, text contrast
- Color schemes: Reflection-discovered
ColorSchemehierarchy with built-in Crayons, FlatUI, LEGO, and Lospec palettes - Color sets:
ColorSetScriptableObject 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.assetfilesTweenDefinition-- Combines a source (manual AnimationCurve, standard easing, mixed in/out, or reference to another asset) with optional overlaysTweenRuntime-- Pure evaluation: all 11 standard easing functions (Quad through Bounce) in In/Out/InOut modes, plus overlay processingTweenOverlay-- Post-processing: Multiply, Add, ValuePow, TimeScale, TimeWarp, Overshoot- Caching --
TweenCurveAssetsupports editor-time pre-baking and lazy runtime fill. Cache quality ranges from 16 to 512 samples. TheTweenCurveBakerdebounces bake requests during editing. TweenCurvestruct 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
RandomListauto-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 componentsSerializedUnityField-- 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 inspectingGraphicsSettings.defaultRenderPipelinetype name. Watches for changes in editor viaEditorApplication.projectChangedandAssetPostprocessor.
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) orCoroutine()(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()). UsesStack<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. HandlesSetActive,SetParent,Instantiate, and editor-safeDestroy. Skips externally destroyed objects on acquire.- Quick-die: both pools support
Return(item, dieTimeMs, onDying)where the callback receives linear progress 0→1. A hiddenPoolTickerMonoBehaviour ticks dying items each frame and self-destructs when idle. Delegate registration is cached per pool instance (one alloc, ever). IPoolableis optional: ifTimplements it,OnAcquire()andOnReturn()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) InsertwithColorBlendMode.AlphaBlendorOverlay- Bounds checking on all pixel access
- File I/O:
Loadfrom disk,Saveto PNG/JPG/TGA/EXR
Key Design Decisions
No external dependencies. The
package.jsonhas zero dependencies. Everything is self-contained or relies on precompiled Carrot libraries.Engine-free precompiled layer.
Carrot.PrecompiledhasnoEngineReferences: true, allowing shared types (likeIPrimitiveBag) to exist independently of Unity.Extension method-heavy API. Most functionality is delivered as extensions on Unity types (
Color,Bounds,Vector3,Texture2D, etc.) for discoverability and minimal coupling.Editor-safe patterns. Methods like
Destroy()andEnsureComponent()handle the editor/play-mode split (DestroyImmediatevsDestroy,Undo.AddComponentin editor).Struct color types.
ColorHSV,ColorXYZ,ColorYIQare value types with implicit conversion operators, matching Unity'sColorconventions.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; // implicitParsing 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.signalsto your asmdef references if usingPipeline.Changedfrom 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
| Field | Value |
|---|---|
| Name | kids.kapish.atoms |
| Display Name | Carrot Atoms |
| Version | 0.1.0 |
| Unity | 2022.3+ |
| License | MIT |
| Namespace | Carrot.Atoms |
| Assembly | Carrot.Atoms |
| Dependencies | kids.kapish 0.1.0 |
Source Files
Runtime
| File | Type | Description |
|---|---|---|
Runtime/IAtom.cs | Interface | IAtom -- contract for all atom instances. Defines position, scale, rotation, sprite, color, mesh, bounds helpers, and managed lifecycle methods. |
Runtime/Atom.cs | Class | Atom -- 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.cs | Class | AtomSystem / 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.cs | Static Class | AtomSingle -- 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.cs | Static Class | AtomicCache -- hash cache for sprites and meshes. Produces composite hashes used by AtomSystem to group identical atoms into GPU-instanced batches. |
Runtime/AtomDefaultRenderMode.cs | Enum | AtomDefaultRenderMode -- Opaque, OpaqueEmissive, Transparent, DepthOnly. Controls which default shader/material an atom system uses. |
Runtime/Carrot.Atoms.asmdef | Assembly Definition | Assembly definition referencing the base Carrot assembly. |
kids.kapish.textures
Package Info
| Field | Value |
|---|---|
| Name | kids.kapish.textures |
| Display Name | Carrot.Textures |
| Version | 0.1.0 |
| Unity | 6000.0+ |
| License | MIT |
| Namespace | Carrot.Textures |
| Assembly | Carrot.Textures (runtime), Carrot.Textures.Editor (editor) |
| Dependencies | kids.kapish 0.1.0 |
Source Files
Runtime
| File | Type | Description |
|---|---|---|
Runtime/TextureExtensions.cs | Static Class | TextureExtensions -- 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.cs | Static Class | TextureBlitUtility -- 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.cs | Static Class | TextureSlicingCpu -- 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.cs | Static Class | TextureSlicingGpu -- 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
| File | Type | Description |
|---|---|---|
Runtime/Shaders/CopySlice.shader | Shader | Hidden/Textures/CopySlice -- samples a Texture2DArray at a given _Slice index and outputs the result. Used internally by TextureSlicingCpu and TextureSlicingGpu. |
Assembly
| File | Type | Description |
|---|---|---|
Runtime/Carrot.Textures.asmdef | Assembly Definition | Runtime assembly referencing Carrot. |
Editor/Carrot.Textures.Editor.asmdef | Assembly Definition | Editor-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
| Assembly | Platform | References |
|---|---|---|
Carrot.Automat | All | Carrot, Carrot.Textures |
Carrot.Automat.Editor | Editor | Carrot, Carrot.Precompiled, Carrot.Editor, Carrot.Automat, Carrot.Textures, Carrot.Textures.Editor, Unity.Nuget.Newtonsoft-Json |
kids.kapish.meshes
Package Info
| Field | Value |
|---|---|
| Name | kids.kapish.meshes |
| Display Name | Carrot Meshes |
| Version | 0.1.0 |
| Unity | 2022.3+ |
| License | MIT |
| Namespace | Carrot.Meshes, Carrot.Meshes.Builders |
| Assembly | Carrot.Meshes |
| Dependencies | kids.kapish 0.1.0, kids.kapish.maths 0.1.0 |
Source Files
Runtime / Builders
| File | Type | Description |
|---|---|---|
Runtime/Builders/MeshBuilder.cs | Class | MeshBuilder -- 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.cs | Class | BezierMeshBuilder -- 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.cs | Class | StrokeBuilder -- 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
| File | Type | Description |
|---|---|---|
Runtime/MeshShaders.cs | Static Class | MeshShaders -- provides access to shared mesh rendering shaders. Lazy-loads Carrot/UnlitVertexColor shader. Factory method CreateUnlitVertexColorMaterial(). |
Runtime/Shaders/UnlitVertexColor.shader | Shader | Carrot/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
| File | Type | Description |
|---|---|---|
Runtime/Carrot.Meshes.asmdef | Assembly Definition | Assembly definition referencing Carrot, Carrot.Geometry, and Carrot.Precompiled. |
kids.kapish.maths
Package Info
| Field | Value |
|---|---|
| Name | kids.kapish.maths |
| Display Name | Carrot Maths |
| Version | 0.1.0 |
| Unity | 2022.3+ |
| License | MIT |
| Namespace | Carrot.Geometry |
| Assembly | Carrot.Geometry |
| Dependencies | kids.kapish 0.1.0 |
Source Files
Runtime / Geometry
| File | Type | Description |
|---|---|---|
Runtime/Geometry/Bezier.cs | Class | Bezier -- 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.cs | Class | BezierFactory -- fluent builder for constructing Bezier paths curve-by-curve. Methods AddLinear, AddQuadratic, AddCubic, Add. Builds into BezierLoop or BezierStrip. |
Runtime/Geometry/BezierLoop.cs | Class | BezierLoop -- 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.cs | Class | BezierMultiLoop -- 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.cs | Class | BezierStrip -- 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.cs | Struct + Enum | BezierTessellationSettings -- 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.cs | Enum | BezierType -- Linear, Quadratic, Cubic. |
Runtime/Geometry/PolygonUtils.cs | Static Class | PolygonUtils -- 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.cs | Enum | WindingDirection -- Clockwise, CounterClockwise. |
Runtime / Triangulation
| File | Type | Description |
|---|---|---|
Runtime/Triangulation/EarClipTriangulator.cs | Static Class | EarClipTriangulator -- 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.cs | Static Class | TriangulationExtensions -- 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
| File | Type | Description |
|---|---|---|
Runtime/Interop/MathsInterop.cs | Static Class | MathsInterop -- 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
| File | Type | Description |
|---|---|---|
Runtime/Carrot.Geometry.asmdef | Assembly Definition | Assembly definition referencing Carrot.Precompiled. |
kids.kapish.input
Package Info
| Field | Value |
|---|---|
| Name | kids.kapish.input |
| Display Name | Carrot.Input |
| Version | 0.1.0 |
| Unity | 6000.0+ |
| License | MIT |
| Namespace | Carrot.Input |
| Assembly | Carrot.Input (runtime), Carrot.Input.Editors (editor) |
| Dependencies | kids.kapish 0.1.0, kids.kapish.signals 0.1.0, Unity.InputSystem |
Source Files
Runtime
| File | Type | Description |
|---|---|---|
Runtime/CarrotInput.cs | Static Class | CarrotInput -- 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.cs | readonly struct | ContextChange -- payload for CarrotInput.CurrentContextChanged. Fields: PlayerIndex (int, -1 for global), ContextName (string?). |
Runtime/CarrotInputScheme.cs | Enum | CarrotInputScheme -- KeyboardMouse, Gamepad, Touch. Identifies the broad input scheme category. |
Runtime/CarrotInputDeviceManager.cs | MonoBehaviour | CarrotInputDeviceManager -- 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.cs | readonly struct | PlayerDeviceChange -- payload for CarrotInputDeviceManager.PlayerDeviceChanged. Fields: PlayerIndex (int), Device (CarrotInputDevice). |
Runtime/Adapters/CarrotInputAdapterBase.cs | Abstract MonoBehaviour | CarrotInputAdapterBase -- 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.cs | Class | CarrotInputDevice -- immutable device descriptor holding Scheme, Brand, Model, Glyphs, Capabilities, Name, VendorId, and ProductId. |
Runtime/Devices/CarrotDeviceCapabilities.cs | Flags Enum | CarrotDeviceCapabilities -- None, Rumble, Gyro, Touchpad, BackButtons, AnalogTriggers. Bitwise flags describing hardware capabilities. |
Runtime/Devices/CarrotGamepadBrand.cs | Enum | CarrotGamepadBrand -- Unknown, Xbox, PlayStation, Nintendo, Steam, Generic. |
Runtime/Devices/CarrotGamepadModel.cs | Enum | CarrotGamepadModel -- Unknown, Xbox360, XboxOne, XboxSeries, DualShock4, DualSense, SwitchPro, JoyConPair, SteamDeck, SteamController, Generic. |
Runtime/UI/CarrotGlyphSet.cs | Enum | CarrotGlyphSet -- KeyboardMouse, Xbox, PlayStation, Nintendo, Steam, Touch, Generic. Used to select the correct button glyph sprites for the current device. |
Runtime/Carrot.Input.asmdef | Assembly Definition | Runtime assembly referencing Carrot and Unity.InputSystem. |
Editor
| File | Type | Description |
|---|---|---|
Editor/Carrot.Input.Editor.asmdef | Assembly Definition | Editor-only assembly referencing Carrot and Carrot.Input. |
kids.kapish.data.morsels
Package Info
| Field | Value |
|---|---|
| Name | kids.kapish.data.morsels |
| Display Name | Carrot.Data.Morsels |
| Version | 0.1.0 |
| Unity | 6000.0+ |
| License | MIT |
| Namespace | Carrot.Data.Morsels |
| Assembly | Carrot.Data.Morsels |
| Dependencies | kids.kapish 0.1.0 |
Source Files
Runtime/Core
| File | Type | Description |
|---|---|---|
Runtime/Core/IMorsel.cs | Interface | IMorsel -- contract for all morsel entities. Defines a uint MorselId property for auto-incremented identity. |
Runtime/Core/IMorsel{TKey}.cs | Interface | IMorsel<TKey> -- generic contract for keyed morsel entities. Defines a TKey MorselKey property for custom key types. |
Runtime/Core/IHasName.cs | Interface | IHasName -- mix-in interface for morsels that carry a display name. |
Runtime/Core/Morsel.cs | Abstract Class | Morsel -- base class implementing IMorsel. Holds MorselId (internally settable) for auto-incremented identity. |
Runtime/Core/Morsel{TKey}.cs | Abstract Class | Morsel<TKey> -- generic base class implementing IMorsel<TKey>. Holds MorselKey (internally settable) for custom-keyed identity. |
Runtime/Repos
| File | Type | Description |
|---|---|---|
Runtime/Repos/MorselRepo{T}.cs | Class | MorselRepo<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}.cs | Class | MorselRepo<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.cs | Exception | MorselKeyAlreadyRegisteredException<T> -- thrown when a morsel with a duplicate key is added to a repository. Exposes the conflicting Key. |
Runtime/IO
| File | Type | Description |
|---|---|---|
Runtime/IO/MorselBinaryWriter.cs | Class | MorselBinaryWriter -- 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.cs | Class | MorselBinaryStreamWriter -- extends MorselBinaryWriter. On dispose, flushes the accumulated byte buffer to a Stream via BinaryWriter. |
Runtime/IO/MorselBinaryChunkWriter.cs | Class | MorselBinaryChunkWriter -- extends MorselBinaryWriter. Writes into a parent writer as a chunk with a standard header (chunk ID, version, next-address) on dispose. |
Runtime/IO/MorselBinaryArrayWriter.cs | Class | MorselBinaryArrayWriter -- 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.cs | Class | MorselBinaryReader -- 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.cs | Class | MorselBinaryStreamReader -- extends MorselBinaryReader. Reads all bytes from a Stream (optimised path for MemoryStream) and passes them to the base reader. |
Runtime/IO/MorselBinaryChunkReader.cs | Static Class + Struct | MorselBinaryChunkReader -- static methods to read and skip chunk headers. MorselChunkHeader readonly struct holds Type (ushort), Version, and Next (address). |
Runtime/IO/MorselBinaryArrayReader.cs | Static Class | MorselBinaryArrayReader -- 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
| Field | Value |
|---|---|
| Name | kids.kapish.entityreact |
| Display Name | Carrot EntityReact |
| Version | 0.1.0 |
| Unity | 2022.3+ |
| License | MIT |
| Namespace | Carrot.EntityReact |
| Assembly | Carrot.EntityReact |
| Dependencies | kids.kapish 0.1.0, kids.kapish.signals 0.1.0 |
Source Files
Runtime
| File | Type | Description |
|---|---|---|
Runtime/Entity.cs | ScriptableObject | Entity -- 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.cs | Class | EntityProperties -- 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.cs | Abstract Class | EntityTag -- 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.cs | Class | EntityAction -- 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.cs | Class + Enum + Extensions | LateCastObject -- 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
| File | Type | Description |
|---|---|---|
Runtime/Views/View.cs | MonoBehaviour | View -- 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.cs | MonoBehaviour | ViewFallback -- 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.cs | Static Class | ViewReflection -- 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
| Type | Kind | Description |
|---|---|---|
IAddressableId | Interface | Contract for anything that can resolve to an Addressables key string. All loader methods accept this. |
Address types
| Type | Kind | Description |
|---|---|---|
AssetAddress | Readonly struct | Basic addressable ID wrapping a raw string key. Supports segment-based construction and implicit string conversion. |
ContentAddress | Readonly struct | Structured address for content-platform assets. Renders to content/{contentType}/{schema}/{name}. Implicitly converts to AssetAddress and string. |
AssetFamily | Readonly struct | Describes a family of addressable assets sharing a label. Provides LoadAllAsync<T>() and DownloadDependenciesAsync() for bulk operations. |
Handles
| Type | Kind | Description |
|---|---|---|
AssetHandle<T> | Sealed class | Disposable wrapper around AsyncOperationHandle<T>. Releases the Addressables handle on dispose. Use with using for scoped lifetime. |
TextHandle | Readonly struct | Carries extracted string content after the underlying TextAsset has already been released. |
Loader
| Type | Kind | Description |
|---|---|---|
AssetLoader | Static class | Awaitable-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)
| Type | Kind | Description |
|---|---|---|
AudioManager | class | Central singleton (MonoSingleton<AudioManager>) managing all audio playback. Owns the source pool, group settings, and master volume. Access via AudioManager.Instance. |
AudioEvent | ScriptableObject | Defines a playable sound: clip references (direct or Addressable), randomisation, pitch/volume variance, cooldowns, looping, and spatial blend. Create via Create > Carrot > Audio > Audio Event. |
AudioGroup | enum | Mixing group categories: SFX, Music, Ambient, UI, Voice. |
AudioGroupSettings | class | Per-group serializable settings: Volume (0-1), Muted, EffectiveVolume. |
AudioHandle | readonly struct | Lightweight handle returned from Play calls. Properties: IsValid, IsPlaying. Methods: Stop(), FadeOut(timeMs). |
AudioSourcePool | internal class | Wraps ComponentPool<AudioSource> for pooled source management. Acquire(), Acquire(position), Return(source). |
Music (Carrot.Audio)
| Type | Kind | Description |
|---|---|---|
MusicPlayer | class | Manages music playback with dual-source crossfading. Properties: IsPlaying, IsPaused. Methods: PlayAsync(AudioEvent, fadeMs), PlayAsync(AssetAddress, fadeMs), Stop(fadeOutMs), Pause(), Resume(). |
AudioManager API
| Member | Signature | Description |
|---|---|---|
Instance | static AudioManager | Singleton accessor (inherited from MonoSingleton<T>) |
MasterVolume | float { get; set; } | Global volume multiplier (0-1) |
Music | MusicPlayer | Lazy-created music player instance |
Play | AudioHandle Play(AudioEvent) | Play a 2D sound from an AudioEvent |
Play | AudioHandle Play(AudioEvent, Vector3) | Play a 3D positional sound from an AudioEvent |
IsPlaying | bool IsPlaying(uint handleId) | Check if a sound is still active |
Stop | void Stop(uint handleId) | Immediately stop a sound by handle ID |
FadeOut | void FadeOut(uint handleId, float timeMs) | Fade a sound to silence over the given duration |
GetGroupVolume | float GetGroupVolume(AudioGroup) | Get the raw volume for a group |
SetGroupVolume | void SetGroupVolume(AudioGroup, float) | Set the raw volume for a group |
SetGroupMuted | void SetGroupMuted(AudioGroup, bool) | Mute or unmute a group |
GetEffectiveVolume | float GetEffectiveVolume(AudioGroup) | Group volume * master volume (0 if muted) |
AudioEvent API
| Member | Signature | Description |
|---|---|---|
Group | AudioGroup | Which mixing group this event belongs to |
Loop | bool | Whether the sound should loop |
SpatialBlend | Optional<float> | Override spatial blend (if unset, defaults to 1 for 3D, 0 for 2D) |
HasDirectClips | bool | True if direct AudioClip references are assigned |
HasAddressableClips | bool | True if Addressable keys are assigned |
GetVolume() | float | Base volume with random variance applied |
GetPitch() | float | Base pitch with random variance applied |
CanPlay() | bool | False if still within cooldown window |
MarkPlayed() | void | Record the play timestamp for cooldown tracking |
GetDirectClip() | AudioClip | Pick a clip (random or sequential) from direct references |
GetAddressableClip() | AssetAddress | Pick an Addressable key (random or sequential) |
AudioHandle API
| Member | Signature | Description |
|---|---|---|
IsValid | bool | True if the handle was created by a manager |
IsPlaying | bool | True if the sound is still active |
Stop() | void | Immediately stop the sound |
FadeOut(timeMs) | void | Fade to silence over the given duration in milliseconds |
MusicPlayer API
| Member | Signature | Description |
|---|---|---|
IsPlaying | bool | True if a music track is currently playing |
IsPaused | bool | True if music is paused |
PlayAsync(AudioEvent, fadeMs) | Awaitable | Crossfade to a new track from an AudioEvent (default 1000ms fade) |
PlayAsync(AssetAddress, fadeMs) | Awaitable | Crossfade to a new track from an Addressable address |
Stop(fadeOutMs) | void | Stop music with optional fade out (default 1000ms) |
Pause() | void | Pause the current track |
Resume() | void | Resume 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)
| Type | Kind | Description |
|---|---|---|
FmodAudioBackend | static class | Placeholder 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:
| Type | Kind | Description |
|---|---|---|
FmodAudioManager | class | Replaces or wraps AudioManager with FMOD dispatch. Central runtime entry point for playing events, managing buses, and loading banks. |
FmodEventRef | struct/class | Maps AudioEvent to FMOD event paths or GUIDs. Serializable reference to an FMOD Studio event. |
FmodBankLoader | class | Loads and unloads FMOD banks, potentially integrated with Addressables for async streaming. |
FmodMusicPlayer | class | FMOD-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
| Type | Kind | Description |
|---|---|---|
CameraDirector | MonoSingleton<CameraDirector> | Manages the active rig and transitions between rigs. SetRig() / SetRigAsync(). Signals: RigChanged (Signal<RigChange>), TransitionStarted, TransitionCompleted. |
RigChange | readonly struct | Payload for CameraDirector.RigChanged — Previous and Current (CameraRig). |
CameraRig | abstract CarrotBehaviour | Base for all camera rigs. Owns Stack and Projection. Subclasses implement UpdateRig(). |
CameraStack | MonoBehaviour | Ordered list of CameraLayers, each backed by a Camera. Additive FOV via SetAdditiveFov(owner, delta) / ClearAdditiveFov(owner). Render-to-texture via SetRenderTarget() / ClearRenderTarget(). |
CameraLayer | class (serialisable) | Single camera config: Name, Depth, ClearFlags, BackgroundColor, CullingMask, TargetTexture, AudioListener. |
CameraProjection | struct (serialisable) | Perspective or orthographic projection. Static factories: Perspective(fov), Orthographic(size), Isometric(size). Lerp(a, b, t) for blending. ApplyTo(Camera). |
CameraProjectionKind | enum | Perspective, Orthographic |
CameraTransition | class (serialisable) | Transition config: Mode, DurationMs, Ease, EaseMode. IsCut property. Static factories: Cut(), Smooth(durationMs). |
CameraTransitionMode | enum | Cut, Lerp, Ease |
CameraEffectsSlot | class (serialisable) | Pipeline-agnostic post-processing holder. ProfileName, Enabled, VolumeComponent (set at runtime). |
Rigs
Namespace: Carrot.Cameras.Rigs
| Type | Description |
|---|---|
FollowRig | Third-person follow camera. Target, Offset, followSpeed, lookSpeed. Collision avoidance via SphereCast with configurable collisionMask and collisionRadius. |
FixedRig | Static camera at a fixed world position. Optional LookTarget with smoothed rotation tracking. |
IsometricRig | Orthographic isometric/top-down camera. Configurable Angle (10-89), Rotation (0-360), Zoom with range limits and smooth zoom. Sets projection to CameraProjection.Isometric. |
OrbitRig | Orbit camera around a target. RotateInput(h, v) and ZoomInput(delta) for input. Pitch limits, distance range, collision avoidance. |
Editor
| Assembly | Platform | References |
|---|---|---|
Carrot.Cameras | All | Carrot, Carrot.Precompiled, Carrot.Signals |
Carrot.Cameras.Editor | Editor | Carrot, 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. CarriesAssetId Id,AssetSource Source,AssetAvailability Availability. Schema identity and version are a type-level fact, resolved viaContentSchemaRegistry— 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 toSource.
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, surfacesUnlock(assetId),IsUnlocked(assetId), and theContentUnlockedsignal. 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 fromTypeto 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. OptionalSchemaIdpartitions 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 withSystem.ComponentModel.DataAnnotations.RequiredAttributeandUnityEngine.RangeAttribute.[LocalisedString]-- field is a localised string (hooks intokids.kapish.localisation).[AssetReference]-- field is anAssetRef<T>to another asset. Usually auto-detected on fields typed asAssetRef<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 onT[]andList<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, returnsValidationResult.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].SchemaIdwhen the class declares multiple schemas. Preferred entry point for callers isContentSchemaRegistry.
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(aUnityEngine.Rendering.Volume). - Bake All (
BakeAll(), also a context-menu item): flatten → rebuild paths → drop. Drives Vista'sForceGenerate, gatingPathFlattenNode.ApplyDropacross the two terrain passes and callingPathManager.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.
- References:
Editor (Carrot.Environment.Editor)
- EnvironmentManagerEditor — adds the prominent Bake All button and disables it while a bake is running.
Dependencies
kids.kapish.splines.paths—PathManager(the paths rebuilt mid-bake).kids.kapish.splines.vista—PathFlattenNode(theApplyDropgate) and theVISTA_UNITY_SPLINEdefine.- Pinwheel Vista (
Pinwheel.Vista.Runtime) —VistaManager. Unity.RenderPipelines.Core.Runtime—Volume.
kids.kapish.localisation
Carrot.Localisation (Runtime)
Manager
| Type | Kind | Description |
|---|---|---|
Localisation | MonoSingleton | Central manager. Registers locales, switches current language, resolves keys. Exposes LocaleChanged, LocaleRegistered, LocaleUnregistered signals. Access via Localisation.Instance. |
Locale data
| Type | Kind | Description |
|---|---|---|
LocaleData | ScriptableObject | One 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. |
LocaleFontSet | ScriptableObject | Optional per-locale fonts — TMP_FontAsset and legacy Font. Components opt into font swapping via applyFontFromLocale. |
LocaleStringEntry | Serializable struct | Inspector row: Key + Value (TextArea). |
LocaleAssetEntry | Serializable struct | Inspector row: Key + AddressableKey (used for audio/sprite/texture tables). |
TextDirection | Enum | LeftToRight, RightToLeft. |
Manifest
| Type | Kind | Description |
|---|---|---|
LocaleManifest | Serializable class | Root JSON manifest wrapping an array of entries. |
LocaleManifestEntry | Serializable class | code, displayName, displayNameNative, dataAddressableKey, version, textDirection. |
Loaders
| Type | Kind | Description |
|---|---|---|
ILocaleLoader | Interface | Pluggable source of LocaleData[]. Awaitable<LocaleData[]> LoadLocalesAsync(CancellationToken). |
BuiltInLocaleLoader | Class | Returns a fixed array of LocaleData assets shipped with the build. |
AddressableLocaleLoader | Class | Loads LocaleData assets from a list of addressable keys. |
ManifestLocaleLoader | Class | Loads a JSON manifest via addressables, then downloads each referenced locale. Primary path for CDN-driven locale extension. |
Serializable references
| Type | Kind | Description |
|---|---|---|
LocalisedString | Serializable struct | Key + fallback string. Implicit string conversion — drop in anywhere a string is expected. |
LocalisedAudioKey | Serializable struct | Key + fallback addressable key. ResolveAddressableKey(), ToAssetAddress(), LoadAsync() returning AssetHandle<AudioClip>. |
LocalisedSpriteKey | Serializable struct | As above, but resolves to AssetHandle<Sprite>. |
LocalisedTextureKey | Serializable struct | As above, but resolves to AssetHandle<Texture2D>. |
UI Components
| Type | Kind | Description |
|---|---|---|
LocalisedText | MonoBehaviour | Binds LocalisedString to a TMP_Text. Optionally applies LocaleFontSet.TmpFont. |
LocalisedTextUGui | MonoBehaviour | Binds LocalisedString to a legacy UGUI Text. Optionally applies LocaleFontSet.LegacyFont. |
LocalisedImage | MonoBehaviour | Binds LocalisedSpriteKey to a UGUI Image. Manages AssetHandle<Sprite> lifetime. |
LocalisedRawImage | MonoBehaviour | Binds LocalisedTextureKey to a UGUI RawImage. Manages AssetHandle<Texture2D> lifetime. |
Carrot.Localisation.Editor
| Type | Kind | Description |
|---|---|---|
LocaleDataEditor | Custom inspector | Summary panel (code/direction/key counts), key search filter over the strings list, "Rebuild Caches" button. |
LocalisedStringDrawer | Property drawer | Renders LocalisedString as Key + Fallback side-by-side. |
LocalisationMenu | Static menu items | Tools > 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
| Type | Kind | Description |
|---|---|---|
ILog | Interface | Primary logging interface. Exposes level-specific ILogModule properties (Debug, Info, Warn, Error, Fatal, Verbose) and GetModule(LogLevel). |
ILogModule | Interface | A logging module for a single level. Enabled flag, Level property, and Write() overloads for message, exception, or both. |
ILogSink | Interface | Sink contract. Implement Emit(LogLevel, string, Exception?) to add custom log destinations. |
ICanLog | Interface | Mixin interface for types that own a logger. Exposes ILog Log. |
ICanLogExtensions | Static class | Extension methods on ICanLog: LogInfo(), LogDebug(), LogWarning(), LogError(), LogAt(). Support optional module prefix and indent level. |
Log | Class | Primary logger implementation. Created via Log.Configure() fluent chain. Each level module is enabled/disabled based on the configured minimum level. |
LogConfiguration | Class | Fluent builder. SendTo(ILogSink) adds sinks, MinimumLevel(LogLevel) sets the floor, CreateLogger() builds the ILog. |
LogModule | Class | Concrete ILogModule. Dispatches messages to all registered sinks when enabled. |
LogLevel | Enum | Verbose, Debug, Information, Warning, Error, Fatal. Values match Serilog convention. |
Runtime (Unity source)
Namespace: Carrot.Logging / Carrot.Logging.Sinks
| Type | Kind | Description |
|---|---|---|
UnityConsoleSink | Class | ILogSink 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. |
LogConfigurationExtensions | Static class | Extension methods on LogConfiguration: SendToUnityConsole(bool includeLevel, bool includeTimestamp) and UnityConsole() (one-liner shortcut). |
Assembly Definitions
| Assembly | Platform | References |
|---|---|---|
Carrot.Logging.Precompiled | All | None (no engine references) |
Carrot.Logging | All | Carrot.Precompiled, Carrot.Logging.Precompiled |
kids.kapish.persistence
Package Info
| Field | Value |
|---|---|
| Name | kids.kapish.persistence |
| Display Name | Carrot.Persistence |
| Version | 0.1.0 |
| Unity | 6000.0+ |
| License | MIT |
| Namespace | Carrot.Persistence |
| Assembly | Carrot.Persistence |
| Editor Assembly | Carrot.Persistence.Editor |
| Dependencies | kids.kapish 0.1.0, kids.kapish.signals 0.1.0 |
Source Files
Runtime -- Orchestration
| File | Type | Description |
|---|---|---|
Runtime/PersistentState.cs | MonoSingleton | PersistentState -- 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
| File | Type | Description |
|---|---|---|
Runtime/SaveSlot.cs | Class | SaveSlot -- 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.cs | Serializable Class | SaveSlotMetadata -- 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
| File | Type | Description |
|---|---|---|
Runtime/ISaveProvider.cs | Interface | ISaveProvider -- pluggable storage backend. Methods: Exists(slotName), Load(slotName) returns byte[], Save(slotName, data), Delete(slotName), ListSlots() returns slot name array. |
Runtime/LocalFileSaveProvider.cs | Class | LocalFileSaveProvider -- default provider. Writes .sav files to Application.persistentDataPath/{subdirectory}/ (default subdirectory: saves). Auto-creates directories on save. ListSlots() returns filenames without extension. |
Runtime -- Sections
| File | Type | Description |
|---|---|---|
Runtime/ISaveSection.cs | Interface | ISaveSection -- 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}.cs | Generic Class | JsonSaveSection<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
| File | Type | Description |
|---|---|---|
Runtime/SaveBinaryWriter.cs | Class | SaveBinaryWriter -- 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.cs | Class | SaveBinaryReader -- 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
| File | Type | Description |
|---|---|---|
Runtime/SaveMigration.cs | Class | SaveMigration -- 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)
| Type | Kind | Description |
|---|---|---|
SceneDirector | class (MonoSingleton) | Central scene manager. Handles async loading, scene groups, loading screens, fade transitions, and addressable scenes. Access via SceneDirector.Instance. |
SceneGroup | ScriptableObject | Named 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. |
SceneRef | struct | Flexible scene reference -- either a build scene name or an addressable key. Factory methods: FromBuild(name), FromAddressable(key). |
SceneRefKind | enum | BuildScene, Addressable |
SceneTransition | class | Transition configuration: loading scene, fade in/out toggles, fade duration (0--2000 ms), minimum transition duration. |
SceneLoadProgress | class | Tracks progress across multiple concurrent scene load/unload operations. Exposes Progress (0--1), TotalScenes, LoadedScenes, CurrentSceneName, IsComplete. |
ILoadingScreen | interface | Contract for loading screen MonoBehaviours. Methods: Show(), Hide(), UpdateProgress(SceneLoadProgress). |
SceneDirector Members
Properties
| Member | Type | Description |
|---|---|---|
Instance | SceneDirector | Singleton accessor (inherited from MonoSingleton<T>) |
CurrentGroup | SceneGroup | The currently loaded scene group, or null if none |
IsTransitioning | bool | true while a group transition is in progress |
Signals
| Signal | Payload | Description |
|---|---|---|
GroupLoadStarted | Signal<SceneGroup> | Dispatched when a group transition begins |
GroupLoadCompleted | Signal<SceneGroup> | Dispatched when a group transition finishes |
ProgressChanged | Signal<SceneLoadProgress> | Dispatched on every progress update during a group transition |
Methods
| Method | Returns | Description |
|---|---|---|
LoadGroupAsync(SceneGroup, SceneTransition?, CancellationToken) | Awaitable | Full 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) | Awaitable | Load a single scene (build or addressable) outside of the group system |
UnloadSceneAsync(string, CancellationToken) | Awaitable | Unload a single build scene by name |
LoadAddressableSceneAsync(IAddressableId, LoadSceneMode, CancellationToken) | Awaitable | Load an addressable scene directly by address |
IsSceneLoaded(string) | bool | Check if a scene is currently loaded by name |
SceneGroup Members
| Member | Type | Description |
|---|---|---|
GroupName | string | Display name of the group |
Scenes | ReadOnlySpan<SceneRef> | The scenes in this group |
SceneCount | int | Number of scenes in the group |
ActiveSceneIndex | int | Index of the scene set as active for lighting (negative to skip) |
Transition | SceneTransition | Per-group transition override (can be null to use the director's default) |
GetScene(int) | SceneRef | Get a scene reference by index |
SceneRef Members
| Member | Type | Description |
|---|---|---|
Kind | SceneRefKind | Whether this is a build scene or addressable scene |
SceneName | string | Build scene name (when Kind == BuildScene) |
AddressableKey | string | Addressable key (when Kind == Addressable) |
IsValid | bool | Whether the reference has a non-empty name/key |
DisplayName | string | Human-readable name (scene name or addressable key) |
FromBuild(string) | SceneRef | Create a build scene reference |
FromAddressable(string) | SceneRef | Create an addressable scene reference |
ToAssetAddress() | AssetAddress | Convert to an AssetAddress for the addressables system |
SceneTransition Members
| Member | Type | Description |
|---|---|---|
LoadingScene | SceneRef | Scene containing an ILoadingScreen MonoBehaviour |
HasLoadingScene | bool | Whether a valid loading scene is configured |
FadeOut | bool | Whether to fade to black before loading (default: true) |
FadeIn | bool | Whether to fade from black after loading (default: true) |
FadeDurationMs | float | Duration of each fade in milliseconds (0--2000, default: 300) |
MinimumDurationMs | float | Minimum total transition time in milliseconds (ensures loading screens are visible long enough) |
SceneLoadProgress Members
| Member | Type | Description |
|---|---|---|
TotalScenes | int | Total number of scene operations (unloads + loads) |
LoadedScenes | int | Number of completed operations |
CurrentSceneName | string | Name of the scene currently being loaded/unloaded |
Progress | float | Overall progress from 0 to 1, including current operation's sub-progress |
IsComplete | bool | Whether all operations have finished |
ProgressChanged | Signal<SceneLoadProgress> | Dispatched on every progress update |
kids.kapish.signals
Runtime (Carrot.Signals)
Namespace: Carrot.Signals
Pure C# core
| Type | Kind | Description |
|---|---|---|
Signal | Class | Non-generic signal for events with no payload. Add, Once, Remove, Dispatch, Clear, ListenerCount. Dispatch-safe add/remove. |
Signal<T> | Class | Typed event signal. Subscribe with Add(Action<T>), fire with Dispatch(T). Same surface as Signal with a typed payload. |
ScriptableObject signals
| Type | Kind | Menu | Description |
|---|---|---|---|
SignalAsset | ScriptableObject | Carrot/Signals/Signal | Wraps 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>. |
SignalAssetInt | ScriptableObject | Carrot/Signals/Signal (int) | Concrete SignalAsset<int>. |
SignalAssetFloat | ScriptableObject | Carrot/Signals/Signal (float) | Concrete SignalAsset<float>. |
SignalAssetString | ScriptableObject | Carrot/Signals/Signal (string) | Concrete SignalAsset<string>. |
SignalAssetBool | ScriptableObject | Carrot/Signals/Signal (bool) | Concrete SignalAsset<bool>. |
SignalAssetGameObject | ScriptableObject | Carrot/Signals/Signal (GameObject) | Concrete SignalAsset<GameObject>. |
SignalAssetVector2 | ScriptableObject | Carrot/Signals/Signal (Vector2) | Concrete SignalAsset<Vector2>. |
SignalAssetVector3 | ScriptableObject | Carrot/Signals/Signal (Vector3) | Concrete SignalAsset<Vector3>. |
MonoBehaviour bridges
| Type | Kind | Menu | Description |
|---|---|---|---|
SignalEmitter | MonoBehaviour | Carrot/Signals/Signal Emitter | Dispatches an assigned SignalAsset via the Dispatch() method. Callable from UnityEvent wiring. |
SignalListener | MonoBehaviour | Carrot/Signals/Signal Listener | Subscribes 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. |
SignalListenerInt | MonoBehaviour | Carrot/Signals/Signal Listener (int) | Concrete SignalListener<int>. |
SignalListenerFloat | MonoBehaviour | Carrot/Signals/Signal Listener (float) | Concrete SignalListener<float>. |
SignalListenerString | MonoBehaviour | Carrot/Signals/Signal Listener (string) | Concrete SignalListener<string>. |
SignalListenerBool | MonoBehaviour | Carrot/Signals/Signal Listener (bool) | Concrete SignalListener<bool>. |
SignalListenerGameObject | MonoBehaviour | Carrot/Signals/Signal Listener (GameObject) | Concrete SignalListener<GameObject>. |
SignalListenerVector2 | MonoBehaviour | Carrot/Signals/Signal Listener (Vector2) | Concrete SignalListener<Vector2>. |
SignalListenerVector3 | MonoBehaviour | Carrot/Signals/Signal Listener (Vector3) | Concrete SignalListener<Vector3>. |
Editor (Carrot.Signals.Editor)
Namespace: Carrot.Signals.Editor
| Type | Target | Description |
|---|---|---|
SignalAssetEditor | SignalAsset | Listener count display + Dispatch button (Play mode only). |
SignalAssetIntEditor | SignalAssetInt | Listener count + int test value field + Dispatch button. |
SignalAssetFloatEditor | SignalAssetFloat | Listener count + float test value field + Dispatch button. |
SignalAssetStringEditor | SignalAssetString | Listener count + string test value field + Dispatch button. |
SignalAssetBoolEditor | SignalAssetBool | Listener count + bool toggle + Dispatch button. |
SignalAssetGameObjectEditor | SignalAssetGameObject | Listener count + GameObject object field + Dispatch button. |
SignalAssetVector2Editor | SignalAssetVector2 | Listener count + Vector2 field + Dispatch button. |
SignalAssetVector3Editor | SignalAssetVector3 | Listener count + Vector3 field + Dispatch button. |
API Surface
Signal
| Member | Signature | Description |
|---|---|---|
Add | Action Add(Action handler) | Subscribe a handler. Returns an unsubscribe Action. |
Once | Action Once(Action handler) | Subscribe a handler that fires once then auto-removes. Returns an unsubscribe Action. |
Remove | void Remove(Action handler) | Unsubscribe a specific handler. |
Dispatch | void Dispatch() | Fire the signal, invoking all handlers. |
Clear | void Clear() | Remove all handlers (regular, once, and pending). |
ListenerCount | int (property) | Current number of subscribed handlers. |
Signal<T>
| Member | Signature | Description |
|---|---|---|
Add | Action Add(Action<T> handler) | Subscribe a handler. Returns an unsubscribe Action. |
Once | Action Once(Action<T> handler) | Subscribe a handler that fires once then auto-removes. Returns an unsubscribe Action. |
Remove | void Remove(Action<T> handler) | Unsubscribe a specific handler. |
Dispatch | void Dispatch(T value) | Fire the signal, invoking all handlers with the given value. |
Clear | void Clear() | Remove all handlers (regular, once, and pending). |
ListenerCount | int (property) | Current number of subscribed handlers. |
SignalAsset
| Member | Signature | Description |
|---|---|---|
Signal | Signal (property) | Underlying pure-C# signal. Use .Add(handler) to subscribe. |
Dispatch | void Dispatch() | Fire the underlying signal. |
ListenerCount | int (property) | Forwarded from the underlying Signal. |
OnDisable | protected virtual void | Clears all handlers. |
SignalAsset<T>
| Member | Signature | Description |
|---|---|---|
Signal | Signal<T> (property) | Underlying pure-C# signal. |
Dispatch | void Dispatch(T value) | Fire the underlying signal with value. |
ListenerCount | int (property) | Forwarded from the underlying Signal<T>. |
OnDisable | protected virtual void | Clears all handlers. |
SignalEmitter
| Member | Signature | Description |
|---|---|---|
Signal | SignalAsset (property) | Assigned asset to dispatch. |
Dispatch | void Dispatch() | Dispatches the assigned signal (no-op if null). Callable from UnityEvent wiring. |
SignalListener / SignalListener<T>
| Member | Signature | Description |
|---|---|---|
Signal | SignalAsset / SignalAsset<T> (property) | Asset to subscribe to. Setter reconnects if currently enabled. |
Response | UnityEvent / UnityEvent<T> (property) | Event invoked on dispatch. |
OnEnable | private void | Subscribes to Signal. |
OnDisable | private void | Unsubscribes from Signal. |
Assembly Definitions
| Assembly | Platform | References | Engine References |
|---|---|---|---|
Carrot.Signals | All | None | Yes (noEngineReferences: false) |
Carrot.Signals.Editor | Editor | Carrot.Signals | Yes |
kids.kapish.splines
Namespace: Carrot.Splines
Runtime
| Type | Kind | Description |
|---|---|---|
StripCalculator | static class | Strip[] ComputeAll(SplineContainer, StripSettings, ITerrainSampler = null) and Strip Compute(...). Samples splines into ribbons; defaults to a RaycastTerrainSampler when conforming and none is given. |
Strip | sealed class | One spline's ribbon. StripSample[] Samples, float TotalArcLength, int SplineIndex, int SampleCount, bool IsEmpty, static Empty. |
StripSample | struct | Per-sample data: ArcLength, HalfWidth, FalloffY, position/tangent, Slope, Camber. |
StripSampleFlags | enum : byte | Per-sample flags. |
StripSettings | sealed class (serialisable) | Width, SampleSpacing, MiterLimit, ConformToTerrain, SurfaceOffset, RaycastDistance, EnableEndFalloff, FalloffDistance, FalloffDepth. |
Dependencies
| Dependency | Kind |
|---|---|
kids.kapish.terrains | runtime — ITerrainSampler / RaycastTerrainSampler for terrain conforming |
com.unity.splines | runtime — 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
| Type | Kind | Description |
|---|---|---|
StripProfilePoint | struct | One 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). |
StripProfile | abstract class (serialisable) | The cross-section extruded along a strip. GetCrossSection(List<StripProfilePoint>); Closed (outline/tube vs open ribbon). Subclass per primitive (e.g. WallProfile). |
StripMeshBuilder | static class | List<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
| Dependency | Kind |
|---|---|
kids.kapish.splines | runtime — Strip / StripSample geometry |
kids.kapish.meshes | runtime — MeshBuilder assembly |
kids.kapish.splines.paths
Namespaces: Carrot.Splines.Paths, Carrot.Splines.Paths.Editor
Runtime — Carrot.Splines.Paths
| Type | Kind | Description |
|---|---|---|
SplineGeometrySourcePath | MonoBehaviour : SplineStripSource | The 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. |
PathMeshStrip | MonoBehaviour, 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. |
SplineManager | MonoBehaviour | Kind-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. |
PathMeshBuilder | static class | List<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. |
PathMeshSettings | sealed class (serialisable) | Profile ([SerializeReference] PathProfile), TargetSegmentLength, WidthSubdivisions, DiagonalPattern, EnableEdgeSkirt, SkirtWidth, SkirtDepth, ChunkLength. |
DiagonalPattern | enum | Triangulation diagonal pattern for the strip mesh. |
PathProfilePoint | struct | One 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). |
PathProfile | abstract class (serialisable) | Defines the cross-section swept along the path. GetCrossSection(List<PathProfilePoint>), ordered Left→Right. Subclass for new shapes. |
FlatPathProfile | PathProfile | Even flat strip across the full width — the default; reproduces the original path exactly. |
CrownPathProfile | PathProfile | Cambered: raised centre (CrownHeight) falling to the edges. Worked example of a non-flat profile. |
Object mode (tile cage-deformed templates along the path)
| Type | Kind | Description |
|---|---|---|
PathObjectStrip | MonoBehaviour, 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. |
PathObjectSettings | sealed class (serialisable) | Templates, Seed, TileLength (0 = template's own length), CompressToFit, StretchToWidth. |
PathObjectTemplate | struct (serialisable) | Source (prefab, authored +Z forward / X across / Y up), Weight (rare = low weight), Scale. |
PathObjectMeshBuilder | static class | List<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. |
PathObjectMesh | struct | One baked, deformed mesh + its Material. |
Editor — Carrot.Splines.Paths.Editor
| Type | Kind | Description |
|---|---|---|
PathManagerEditor | Editor | Custom inspector for SplineManager (bulk rebuild / tear-down). |
PathMeshStripEditor | Editor | Custom inspector for PathMeshStrip (rebuild + mesh save). |
PathObjectStripEditor | Editor | Custom inspector for PathObjectStrip (baked stats + rebuild / tear-down). |
Dependencies
| Dependency | Kind |
|---|---|
kids.kapish.splines | runtime — Strip / StripCalculator strip generation |
kids.kapish.terrains | runtime — terrain conforming via ITerrainSampler |
com.unity.splines | runtime — SplineContainer |
kids.kapish.splines.vista
Namespaces: Carrot.Splines.Vista, Carrot.Splines.Vista.Editor
Runtime — Carrot.Splines.Vista
| Type | Kind | Description |
|---|---|---|
PathVistaLink | MonoBehaviour [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. |
PathFlattenNode | Vista 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. |
PathFlattenSimpleNode | Vista 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
| Asset | Description |
|---|---|
Resources/Carrot/Shaders/PathFlatten.shader | Shader "Hidden/Carrot/Terrain/PathFlatten" — out = height − mask·drop. |
Resources/Carrot/Shaders/PathDecamber.shader | Shader "Hidden/Carrot/Terrain/PathDecamber" — out = lerp(height, flat, saturate(amount·mask)). |
Editor — Carrot.Splines.Vista.Editor
| Type | Kind | Description |
|---|---|---|
VistaUnitySplineDefine | static [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
| Dependency | Kind |
|---|---|
kids.kapish.splines | family / intent — the Vista arm of the Carrot splines |
com.unity.splines | functional 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
| Type | Kind | Description |
|---|---|---|
WallProfile | abstract class : StripProfile (serialisable) | Closed wall cross-section. Height, ColliderHeight. |
SolidWallProfile | WallProfile | Plain rectangular wall (the default). |
HedgeProfile | WallProfile | Rectangular body with chamfered top corners. TopChamfer. |
FenceProfile | WallProfile | Thin body with a pointed top cap. CapHeight. |
SplineGeometrySourceWall | MonoBehaviour : SplineStripSource | The 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. |
WallColliderMode | enum | None / Box (AABB-ish boxes) / ConvexHull (a convex-hull mesh per section, follows curves). |
WallMeshStrip | MonoBehaviour, 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
| Type | Kind | Description |
|---|---|---|
WallMeshStripEditor | Editor | Baked stats + rebuild / tear-down. |
Dependencies
| Dependency | Kind |
|---|---|
kids.kapish | runtime — IBakeable |
kids.kapish.splines | runtime — Strip / StripCalculator / StripSettings |
kids.kapish.splines.meshes | runtime — StripProfile / StripMeshBuilder |
com.unity.splines | runtime — SplineContainer |
kids.kapish.statemachines
Scannable reference of every public type exported by the kids.kapish.statemachines package.
Unity Runtime (Carrot.StateMachines)
| Type | Kind | Description |
|---|---|---|
StateMachineHost | MonoBehaviour | Owns 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. |
StateChange | readonly struct | Payload for StateMachineHost.StateChanged — From and To state IDs (both string). |
StateMachineLoader | static class | Loads state machine templates from Addressables, deserializes them, and builds runnable machines. Can load directly or into a host. |
StateMachineTemplateAsset | ScriptableObject | Wraps raw JSON for a StateMachineTemplate. JSON-library-agnostic -- deserialization is handled by the consumer. CreateAssetMenu: Carrot/State Machine Template. |
IStateNodeAwaitable | interface | Unity-native async state node using Awaitable. Zero-alloc, PlayerLoop-integrated. Extends IStateNode with OnEnterAsync and OnExitAsync. |
Editor (Carrot.StateMachines.Editor)
| Type | Kind | Description |
|---|---|---|
StateMachineTemplateAssetEditor | CustomEditor | Inspector for StateMachineTemplateAsset. Shows Schema ID field, JSON text area, and a Validate JSON button. |
Precompiled Core (Carrot.StateMachines -- from DLL)
State Machine
| Type | Kind | Description |
|---|---|---|
StateMachine<TNode, TEdge> | sealed class | Runtime state machine instance. Generic over node and edge types. Manages state graph, transitions, ticking, guard evaluation, and re-entrancy protection. |
StateMachineBuilder | sealed class | Fluent builder for code-first state machines using callback-based StateNode/StateEdge. |
StateMachineBuilder<TNode, TEdge> | sealed class | Fluent builder for state machines with custom node/edge types. |
StateMachineFactory | static class | Builds a StateMachine<IStateNode, StateEdge> from a StateMachineTemplate using a handler registry. Resolves composite guards (all/any/not). |
Nodes (Carrot.StateMachines.Nodes)
| Type | Kind | Description |
|---|---|---|
IStateNode | interface | Contract for state nodes: Id, OnEnter, OnExit, OnTick. |
IStateNodeAsync | interface | Extends IStateNode with Task-based OnEnterAsync/OnExitAsync. |
IStateNodeHandler | interface | Factory that creates an IStateNode from template params. Registered in the handler registry by node type string. |
StateNode | class | Callback-based state node for code-first machines. Accepts Action delegates for enter, exit, and tick. |
Edges (Carrot.StateMachines.Edges)
| Type | Kind | Description |
|---|---|---|
IStateEdge | interface | Contract for state edges: Id, From, To, Trigger, EvaluateGuard. |
StateEdge | class | Default edge implementation with optional IStateGuard. Auto-generates an ID from from->to:trigger. |
IStateGuard | interface | Guard condition: Evaluate() returns true if the transition is allowed. |
IStateGuardHandler | interface | Factory that creates an IStateGuard from template params. Registered by guard type string. |
StateGuard | sealed class | Func<bool>-based guard for code-first machines. |
StateGuardAll | sealed class | Composite guard -- all children must pass. |
StateGuardAny | sealed class | Composite guard -- any child must pass. |
StateGuardNot | sealed class | Composite guard -- negates a single child. |
Templates (Carrot.StateMachines.Templates)
| Type | Kind | Description |
|---|---|---|
StateMachineTemplate | sealed class | Serializable template describing a state machine's structure. String-based, JSON-friendly wire format between authoring tools and the runtime. |
StateMachineTemplateNode | sealed class | A node within a template. Id, Type, Params, and namespaced Meta dictionary. |
StateMachineTemplateEdge | sealed class | An edge within a template. Id, From, To, Trigger, optional Guard, and namespaced Meta. |
StateMachineTemplateGuard | sealed class | A guard within a template edge. Supports composites via Children (for all/any/not). |
StateMachineHandlerRegistry | sealed class | Maps 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
| Type | Kind | Description |
|---|---|---|
ITerrainSampler | interface | Surface query abstraction. bool TrySampleSurface(Vector3 referencePosition, out Vector3 surfacePoint, out Vector3 surfaceNormal). |
RaycastTerrainSampler | sealed class : ITerrainSampler | Downward 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
| Asset | Shader name | Description |
|---|---|---|
TerrainVertexColor.shadergraph | Carrot/Terrain/Vertex Color | URP 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
| Dependency | Kind |
|---|---|
com.unity.render-pipelines.universal | runtime — URP target for the Shader Graph |
kids.kapish.terrains.vista
Namespaces: Carrot.Terrains.Vista, Carrot.Terrains.Vista.Editor
All types are gated behind
#if VISTAand the assemblies carry aVISTAdefine constraint. They are present only when Vista is installed.
Runtime — Carrot.Terrains.Vista
| Type | Base | Vista menu | Description |
|---|---|---|---|
InputNodeDefault | Pinwheel.Vista.Graph.InputNode | IO / 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. |
ColorLerpNode | ImageNodeBase | Game / Color Lerp | lerp(A * colorA, B * colorB, mask) over two colour textures. Shader Hidden/Game/Terrain/ColorLerp. |
ColorTintByMaskNode | ImageNodeBase | Game / Color Tint By Mask | lerp(input, input * tint, mask * strength). Shader Hidden/Game/Terrain/ColorTintByMask. |
FlipYNode | ImageNodeBase | Game / Flip Y | Vertical mask flip. Shader Hidden/Game/Terrain/FlipY. |
InvertNode | ImageNodeBase | Game / Invert | 1 - input over a mask. Shader Hidden/Game/Terrain/Invert. |
Resources
| Asset | Description |
|---|---|
Resources/Game/Shaders/ColorLerp.shader | Shader "Hidden/Game/Terrain/ColorLerp" — loaded by name via ShaderUtilities.Find. |
Resources/Game/Shaders/ColorTintByMask.shader | Shader "Hidden/Game/Terrain/ColorTintByMask". |
Resources/Game/Shaders/FlipY.shader | Shader "Hidden/Game/Terrain/FlipY". |
Resources/Game/Shaders/Invert.shader | Shader "Hidden/Game/Terrain/Invert". |
Editor — Carrot.Terrains.Vista.Editor
| Type | Base | Description |
|---|---|---|
InputNodeDefaultEditor | Pinwheel.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 references | Provided by |
|---|---|
Pinwheel.Vista.Runtime | Vista (runtime) |
Pinwheel.Vista.Editor | Vista (editor) |
kids.kapish.tracking
Runtime (Carrot.Tracking)
Namespace: Carrot.Tracking
Core types
| Type | Kind | Description |
|---|---|---|
Tracker | MonoSingleton | Central orchestrator. Manages providers, consent, queue, log sink, and signals. Access via Tracker.Instance. |
ITrackingProvider | Interface | Pluggable analytics backend. Semantic methods: PageView, Event, Identify, Reset. One implementation per platform (App Insights, GA, Meta Pixel, etc.). |
ITrackingLogSink | Interface | Optional bridge from tracking into a logger. Implement with a small adapter; tracking has no hard logging dependency. |
ConsentState | Enum | Pending / Granted / Denied. |
TrackingProperties | Class (Dictionary<string, object>) | Property bag with fluent .With(key, value) builder and Create / From factory helpers. |
TrackingEvent | Readonly struct | Signal payload for EventTracked. Fields: Name, Properties. |
TrackingPageView | Readonly struct | Signal payload for PageViewTracked. Fields: Path, Properties. |
Providers
Namespace: Carrot.Tracking.Providers
| Type | Kind | Description |
|---|---|---|
DebugTrackingProvider | MonoBehaviour | Built-in. Prints tracking calls to the Unity console with a configurable prefix. |
AppInsightsTrackingProvider | MonoBehaviour (stub) | Placeholder for Azure Application Insights. Integration path documented in the source file. |
LogAnalyticsTrackingProvider | MonoBehaviour (stub) | Placeholder for Azure Log Analytics Workspace (HTTP Data Collector API). Integration path documented in the source file. |
API Surface
Tracker
| Member | Signature | Description |
|---|---|---|
Instance | Tracker (static) | MonoSingleton accessor. |
Consent | ConsentState (property) | Current consent state. |
Consentless | bool (property) | If true, all events bypass consent gating. |
QueueSize | int (property) | Current number of events queued while Pending. |
Providers | IReadOnlyList<ITrackingProvider> (property) | Registered providers. |
LogSink | ITrackingLogSink (property) | Optional logger bridge. Echo fires before consent gating. |
ConsentChanged | Signal<ConsentState> | Dispatched on every SetConsent transition. |
EventTracked | Signal<TrackingEvent> | Dispatched on every Event(...) call, regardless of consent. |
PageViewTracked | Signal<TrackingPageView> | Dispatched on every PageView(...) call, regardless of consent. |
AddProvider | void AddProvider(ITrackingProvider) | Register a provider. Throws ArgumentNullException if null. |
RemoveProvider | void RemoveProvider(ITrackingProvider) | Unregister a provider. |
InitializeProviders | void InitializeProviders() | Call Initialize() on every registered provider. Each wrapped in try/catch. |
SetConsent | void SetConsent(ConsentState) | Update consent. Granted flushes queue, Denied clears it. Dispatches ConsentChanged. No-op if unchanged. |
PageView | void PageView(string path, TrackingProperties = null) | Record a page/screen view. |
Event | void Event(string name, TrackingProperties = null) | Record a named event. |
Identify | void Identify(string userId, TrackingProperties = null) | Associate subsequent events with a user. |
Reset | void Reset() | Clear per-user state across all providers. |
Inspector fields on Tracker
| Field | Type | Default | Description |
|---|---|---|---|
consentless | bool | false | Skip consent gating entirely. |
maxQueueSize | int | 500 | Max events queued while Pending. Oldest dropped when full. |
ITrackingProvider
| Member | Signature | Description |
|---|---|---|
Name | string (property) | Provider identifier used in error logs. |
Initialize | void Initialize() | Called once by Tracker.InitializeProviders. Perform SDK setup here. |
PageView | void PageView(string path, TrackingProperties = null) | Record a page / screen view. |
Event | void Event(string name, TrackingProperties = null) | Record a named event. |
Identify | void Identify(string userId, TrackingProperties = null) | Associate user identity and traits. |
Reset | void Reset() | Clear per-user state. Providers that don't support reset should no-op. |
ITrackingLogSink
| Member | Signature | Description |
|---|---|---|
OnPageView | void OnPageView(string path, TrackingProperties) | Invoked before consent gating. |
OnEvent | void OnEvent(string name, TrackingProperties) | Invoked before consent gating. |
OnIdentify | void OnIdentify(string userId, TrackingProperties traits) | Invoked before consent gating. |
OnReset | void OnReset() | Invoked before consent gating. |
TrackingProperties
| Member | Signature | Description |
|---|---|---|
With | TrackingProperties With(string key, object value) | Fluent setter. Overwrites existing key. Returns this. |
Create | static TrackingProperties Create() | Empty instance. |
From | static 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
| Value | Meaning |
|---|---|
Pending | No decision yet. Events are queued up to maxQueueSize, oldest dropped when exceeded. Signals still fire. |
Granted | Events forward to providers. Queued events are flushed on transition into this state. |
Denied | Events are dropped. Queued events are cleared on transition into this state. Signals still fire. |
TrackingEvent / TrackingPageView (signal payloads)
| Type | Fields |
|---|---|
TrackingEvent | string Name, TrackingProperties Properties |
TrackingPageView | string Path, TrackingProperties Properties |
Assembly Definitions
| Assembly | Platform | References | Engine References |
|---|---|---|---|
Carrot.Tracking | All | Carrot, Carrot.Precompiled, Carrot.Signals | Yes |
Carrot.Tracking.Editor | Editor | Carrot, Carrot.Tracking, Carrot.Editor | Yes |
Package Dependencies
| Package | Version | Reason |
|---|---|---|
kids.kapish | 0.1.0 | MonoSingleton<T> base class for Tracker. |
kids.kapish.signals | 0.1.0 | Signal<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