Kaskade Scripting guide

C# Scripting API

Reference for Kaskade.Managed.API. Open a type for its signatures, lifecycle callbacks, and overloads. For setup and working examples, start with the scripting guide.

Kaskade

Animator

public sealed class Animator

Inherits EngineComponent

Plays an animation clip on the object's model.

clip

public string clip { get; set; }
Gets or sets the clip (a .kanim path).

currentState

public string currentState { get; }
The current state of the base layer, as of the last frame.

isInTransition

public bool isInTransition { get; }
Whether the base layer is blending to another state.

speed

public double speed { get; set; }
Gets or sets the playback speed (1: normal).

CrossFade

public void CrossFade(string state, float duration)
Blends to a state of the base layer over duration seconds.

GetFloat

public float GetFloat(string name)
The value of a float parameter, as of the last frame.

Play

public void Play(string? clip = null)
Plays clip (or the current clip) from the start.

PlayState

public void PlayState(string state, int layer = 0)
Jumps to a state of a layer of the controller.

ResetTrigger

public void ResetTrigger(string name)
Clears a trigger that no transition consumed.

SetBool

public void SetBool(string name, bool value)
Sets a bool parameter of the controller.

SetFloat

public void SetFloat(string name, float value)
Sets a float parameter of the controller.

SetInteger

public void SetInteger(string name, int value)
Sets an int parameter of the controller.

SetTrigger

public void SetTrigger(string name)
Fires a trigger of the controller (a transition waiting for it consumes it).

Stop

public void Stop()
Stops playing.

Kaskade

Application

public static class Application
The running application (Unity's Application).

dataPath

public static string dataPath { get; }
The project's Assets folder (Unity's dataPath).

isFocused

public static bool isFocused { get; }
Whether the window has the keyboard (the engine does not report focus: always).

isPlaying

public static bool isPlaying { get; }
Scripts only run while the game plays.

projectPath

public static string projectPath { get; }
The project's folder.

Quit

public static void Quit()
Ends the game.

Kaskade

AssetAttribute

public sealed class AssetAttribute

Inherits Attribute

Marks a string field as an asset path (drop an asset from the Project panel).

AssetAttribute

public AssetAttribute(string kind = "")
Marks a string field as an asset path (drop an asset from the Project panel).

Kind

public string Kind { get; }
Gets the kind of asset expected (shown in the empty slot).

Kaskade

AudioClip

public sealed class AudioClip

Implements IEquatable<AudioClip>

A sound file of the project (a .wav, .ogg, .mp3, .flac): what AudioSource plays. A script field of this type is an audio slot in the inspector (pick a clip, listen to it); AudioClip.Load names one in code.

name

public string name { get; }
The file's name without folder or extension.

path

public string path { get; }
The clip's path, as the engine finds it: project relative (Assets/Audio/Doors/open.wav), or relative to Assets/Audio without the extension (Doors/open).

Equals

public bool Equals(AudioClip? other)
Implements bool IEquatable<AudioClip>.Equals(AudioClip? other).

Equals

public override bool Equals(object? obj)
Overrides bool object.Equals(object? obj).

GetHashCode

public override int GetHashCode()
Overrides int object.GetHashCode().

Load

public static AudioClip? Load(string? path)
The clip at path (see AudioClip.path), or null for an empty path or "None".

ToString

public override string ToString()
Overrides string? object.ToString().

implicit operator string

public static implicit operator string(AudioClip? clip)
Obsolete Clips are AudioClip now: read clip.path for its path.
The clip's path (old code that kept clips as strings).

implicit operator AudioClip?

public static implicit operator AudioClip?(string? path)
Obsolete Clips are AudioClip now: use an AudioClip field (pick it in the inspector) or AudioClip.Load(path).
Clips used to be strings: a string still converts, with a warning (once per place it is used). Use an AudioClip field, or AudioClip.Load.

Kaskade

AudioListener

public sealed class AudioListener

Inherits EngineComponent

Where the player hears from (usually on the camera).

volume

public double volume { get; set; }
Gets or sets the listener's volume.

Kaskade

AudioSource

public sealed class AudioSource

Inherits EngineComponent

Plays a sound clip in 3D (or 2D) space.

clip

public AudioClip? clip { get; set; }
Gets or sets the clip it plays (null: none).

isPlaying

public bool isPlaying { get; }
Gets whether it is playing.

loop

public bool loop { get; set; }
Gets or sets whether the clip repeats.

maxDistance

public double maxDistance { get; set; }
Gets or sets the distance beyond which it is silent.

minDistance

public double minDistance { get; set; }
Gets or sets the distance within which it is at full volume.

pitch

public double pitch { get; set; }
Gets or sets the pitch (1: normal).

playOnAwake

public bool playOnAwake { get; set; }
Gets or sets whether it plays when the object appears.

spatialBlend

public double spatialBlend { get; set; }
Gets or sets 2D (0) to 3D (1) blending.

volume

public double volume { get; set; }
Gets or sets the volume (0-1).

Play

public void Play()
Starts playing the clip (from the start).

PlayClipAtPoint

public static void PlayClipAtPoint(AudioClip? clip, Vector3 position, double volume = 1)
Plays clip once at a world position (nothing for null).

PlayClipAtPoint

public static void PlayClipAtPoint(string clip, Vector3 position, double volume = 1)
Obsolete Clips are AudioClip now: PlayClipAtPoint(AudioClip, ...). Declare an AudioClip field or use AudioClip.Load(path).
Plays a clip named by a string once at a world position.

PlayOneShot

public void PlayOneShot(AudioClip? clip, double volumeScale = 1)
Plays clip once at the object's position, over whatever plays.

PlayOneShot

public void PlayOneShot(string clip, double volumeScale = 1)
Obsolete Clips are AudioClip now: PlayOneShot(AudioClip). Declare an AudioClip field or use AudioClip.Load(path).
Plays a clip named by a string once at the object's position.

PlayVoice

public static long PlayVoice(AudioClip? clip, double volume = 1)
Plays clip once as recorded, heard everywhere (a narrator, a PA); it pauses with the game. Returns the voice, for AudioSource.StopVoice (0 for null).

PlayVoice

public static long PlayVoice(string clip, double volume = 1)
Obsolete Clips are AudioClip now: PlayVoice(AudioClip). Declare an AudioClip field or use AudioClip.Load(path).
Plays a clip named by a string as a voice.

Stop

public void Stop()
Stops playing.

StopVoice

public static void StopVoice(long voice)
Stops a voice of AudioSource.PlayVoice (one that ended already: nothing).

Kaskade

Behaviour

public abstract class Behaviour

Inherits Component

Base class for C# components. Override what you need, in Unity's order: Behaviour.Awake, Behaviour.OnEnable, Behaviour.Start (before the first update), then every frame Behaviour.FixedUpdate (per physics step), Behaviour.Update, Behaviour.LateUpdate, Behaviour.OnGUI; physics reports OnCollisionEnter/Stay/Exit and OnTriggerEnter/Stay/Exit; at the end Behaviour.OnDisable and Behaviour.OnDestroy.

Behaviour

protected Behaviour()
Creates a default instance of Behaviour.

enabled

public bool enabled { get; set; }
Gets or sets whether the component runs (its updates are called).

isActiveAndEnabled

public bool isActiveAndEnabled { get; }
Gets whether the component is enabled and its object active.

Awake

protected virtual void Awake()
Called once when the component is created, before Behaviour.Start.

CancelInvoke

public void CancelInvoke(string? methodName = null)
Cancels the pending Behaviour.Invoke calls (of one method, or all).

FixedUpdate

protected virtual void FixedUpdate()
Called before every physics step (Time.fixedDeltaTime apart); move rigidbodies here.

Invoke

public void Invoke(string methodName, double time)
Calls the method named methodName after time seconds.

InvokeRepeating

public void InvokeRepeating(string methodName, double time, double repeatRate)
Calls the method after time seconds, then every repeatRate seconds.

IsInvoking

public bool IsInvoking(string? methodName = null)
Whether a call of methodName (or any) is pending.

LateUpdate

protected virtual void LateUpdate()
Called every frame after all updates.

LateUpdate

protected virtual void LateUpdate(double deltaTime)
Called every frame after all updates, with the frame's time in seconds.

OnAfterHotReload

protected virtual void OnAfterHotReload(HotReloadContext context)
Called on the replacement object after its state and engine identity are restored.
context The old and new managed code generations.

OnBeforeHotReload

protected virtual void OnBeforeHotReload()
Called before a structural reload captures this instance's state.

OnCollisionEnter

protected virtual void OnCollisionEnter(Collision collision)
Called when this object's collider starts touching another one.

OnCollisionExit

protected virtual void OnCollisionExit(Collision collision)
Called when this object's collider stops touching another one.

OnCollisionStay

protected virtual void OnCollisionStay(Collision collision)
Called every physics step while this object's collider touches another one.

OnDestroy

protected virtual void OnDestroy()
Called before the component is destroyed.

OnDisable

protected virtual void OnDisable()
Called whenever the component is disabled or its object deactivated.

OnEnable

protected virtual void OnEnable()
Called whenever the component becomes enabled and its object active.

OnGUI

protected virtual void OnGUI()
Called for drawing immediate-mode GUI (GUI, GUILayout).

OnReady

protected virtual void OnReady()
Earlier name of Behaviour.Awake: called once after the component and its object are ready.

OnReset

protected virtual void OnReset()
Called when the component is reset to its authored defaults (in the editor).

OnTriggerEnter

protected virtual void OnTriggerEnter(Collider other)
Called when a collider enters a trigger (this object's, or this object enters one).

OnTriggerExit

protected virtual void OnTriggerExit(Collider other)
Called when a collider leaves a trigger.

OnTriggerStay

protected virtual void OnTriggerStay(Collider other)
Called every physics step while a collider is inside a trigger.

Start

protected virtual void Start()
Called once before the component's first update.

StartCoroutine

public Coroutine StartCoroutine(string methodName, object? value = null)
Runs the coroutine method named methodName.

StopAllCoroutines

public void StopAllCoroutines()
Stops every coroutine of this component.

StopCoroutine

public void StopCoroutine(Coroutine coroutine)
Stops a coroutine.

StopCoroutine

public void StopCoroutine(IEnumerator routine)
Stops the coroutine running routine.

Update

protected virtual void Update()
Called every frame.

Update

protected virtual void Update(double deltaTime)
Called every frame with the frame's time in seconds (also Time.deltaTime).

print

public static void print(object? message)
Writes message to the console (Unity's print).

Kaskade

BonePose

public readonly readonly struct BonePose

Implements IEquatable<BonePose>

A bone's pose: local to its parent bone, and in the world.
localPosition Position in the parent bone's space.
localRotation Rotation relative to the parent bone.
position World position.
rotation World rotation.

BonePose

public BonePose()
Creates a default instance of BonePose.

BonePose

public BonePose(Vector3 localPosition, Quaternion localRotation, Vector3 position, Quaternion rotation)
A bone's pose: local to its parent bone, and in the world.
localPosition Position in the parent bone's space.
localRotation Rotation relative to the parent bone.
position World position.
rotation World rotation.

localPosition

public Vector3 localPosition { get; init; }
Position in the parent bone's space.

localRotation

public Quaternion localRotation { get; init; }
Rotation relative to the parent bone.

position

public Vector3 position { get; init; }
World position.

rotation

public Quaternion rotation { get; init; }
World rotation.

Deconstruct

public void Deconstruct(out Vector3 localPosition, out Quaternion localRotation, out Vector3 position, out Quaternion rotation)
Copies the positional values into the output parameters.

Equals

public bool Equals(BonePose other)
Checks equality using the record's data.

Equals

public override bool Equals(object obj)
Checks equality using the record's data.

GetHashCode

public override int GetHashCode()
Returns a hash of the record's data.

ToString

public override string ToString()
Returns a string representation of the record.

operator ==

public static bool operator ==(BonePose left, BonePose right)
Checks equality using the record's data.

operator !=

public static bool operator !=(BonePose left, BonePose right)
Checks whether the records differ.

Kaskade

Bounds

public struct Bounds
An axis-aligned box: centre and extents.

Bounds

public Bounds()
Creates a default instance of Bounds.

Bounds

public Bounds(Vector3 center, Vector3 size)
A box from its centre and size.

center

public Vector3 center
Centre.

extents

public Vector3 extents
Half the size.

max

public readonly Vector3 max { get; }
The largest corner.

min

public readonly Vector3 min { get; }
The smallest corner.

size

public Vector3 size { readonly get; set; }
Full size.

ClosestPoint

public readonly Vector3 ClosestPoint(Vector3 point)
The nearest point inside.

Contains

public readonly bool Contains(Vector3 point)
Whether point is inside.

Encapsulate

public void Encapsulate(Bounds other)
Grows to hold other.

Encapsulate

public void Encapsulate(Vector3 point)
Grows to hold point.

IntersectRay

public readonly bool IntersectRay(Ray ray)
Whether ray hits the box (Unity's Bounds.IntersectRay).

IntersectRay

public readonly bool IntersectRay(Ray ray, out double distance)
Whether ray hits the box, and how far along it the ray enters (Unity's Bounds.IntersectRay). A ray starting inside hits with a negative distance (back to where it would have entered); a box wholly behind the ray is missed.

Kaskade

BoxCollider

public sealed class BoxCollider

Inherits Collider

A box collider.

center

public Vector3 center { get; set; }
Gets or sets the centre relative to the object.

size

public Vector3 size { get; set; }
Gets or sets the size in metres (before the object's scale).

Kaskade

Camera

public sealed class Camera

Inherits EngineComponent

A camera. Camera.main is the scene's main camera; its screen and world conversions use its position, rotation and field of view. Screen points are window pixels from the top-left corner, as Input.mousePosition gives them.
Example What the player clicked:
            if (Input.GetMouseButtonDown(MouseButton.Left)
                && Camera.main.ScreenPointToWorldPos(Input.mousePosition, out RaycastHit hit))
            {
                marker.transform.position = hit.point;
            }
            

allCameras

public static Camera[] allCameras { get; }
Gets every camera of the scene.

aspect

public double aspect { get; }
Gets width / height of the window.

backgroundColor

public Color backgroundColor { get; set; }
Gets or sets the colour the camera clears to.

depth

public int depth { get; set; }
Gets or sets the priority (higher draws later).

farClipPlane

public double farClipPlane { get; set; }
Gets or sets the far clipping distance.

fieldOfView

public double fieldOfView { get; set; }
Gets or sets the vertical field of view in degrees.

isMainCamera

public bool isMainCamera { get; set; }
Gets or sets whether this is the main camera (the one the game shows).

main

public static Camera? main { get; }
Gets the scene's main camera, or null when there is none.

nearClipPlane

public double nearClipPlane { get; set; }
Gets or sets the near clipping distance.

pixelHeight

public int pixelHeight { get; }
Gets the window height in pixels.

pixelWidth

public int pixelWidth { get; }
Gets the window width in pixels.

ScreenPointToRay

public Ray ScreenPointToRay(Vector2 screenPoint)
The ray from the camera through a screen point.

ScreenPointToWorldPos

public bool ScreenPointToWorldPos(Vector2 screenPoint, out RaycastHit hit, double maxDistance = 1000)
The world point under a screen point, with what was hit there.

ScreenPointToWorldPos

public Vector3? ScreenPointToWorldPos(Vector2 screenPoint, double maxDistance = 1000)
The world point under a screen point: where the ray from the camera through it first hits a collider, up to maxDistance metres; null when nothing is there.

ScreenToWorldPoint

public Vector3 ScreenToWorldPoint(Vector2 screenPoint, double distance)
The world point distance metres along the ray through a screen point (no physics).

ScreenToWorldPoint

public Vector3 ScreenToWorldPoint(Vector3 screenPoint)
The world point for a screen point whose Z is the distance from the camera (Unity's form).

ViewportPointToRay

public Ray ViewportPointToRay(Vector2 viewportPoint)
The ray from the camera through a viewport point (0..1, top-left origin).

WorldToScreenPoint

public Vector3 WorldToScreenPoint(Vector3 worldPoint)
Where a world point shows on screen (X, Y in pixels; Z the distance in front of the camera).

WorldToScreenPoint

public bool WorldToScreenPoint(Vector3 worldPoint, out Vector2 screenPoint)
Where a world point shows on screen; false when it is behind the camera.

WorldToViewportPoint

public Vector3 WorldToViewportPoint(Vector3 worldPoint)
Where a world point shows in the viewport (0..1, top-left origin; Z the distance).

Kaskade

CapsuleCollider

public sealed class CapsuleCollider

Inherits Collider

A capsule collider (upright).

height

public double height { get; set; }
Gets or sets the total height in metres.

radius

public double radius { get; set; }
Gets or sets the radius in metres.

Kaskade

CharacterController

public sealed class CharacterController

Inherits Collider

A collider moved by scripts that walks on ground and slides along walls.

groundNormal

public Vector3 groundNormal { get; }
Gets the normal of the ground it stands on.

height

public double height { get; set; }
Gets or sets the capsule height.

isGrounded

public bool isGrounded { get; }
Gets whether it stood on ground after the last move.

radius

public double radius { get; set; }
Gets or sets the capsule radius.

slopeLimit

public double slopeLimit { get; set; }
Gets or sets the steepest slope it walks up, in degrees.

stepOffset

public double stepOffset { get; set; }
Gets or sets the highest step it climbs.

Move

public void Move(Vector3 motion)
Moves by motion (world space, metres), sliding along what it hits.

SimpleMove

public void SimpleMove(Vector3 speed)
Moves at speed (metres per second) for this frame, with gravity.

Kaskade

Collider

public abstract class Collider

Inherits EngineComponent

A shape the physics engine collides with.

attachedRigidbody

public Rigidbody? attachedRigidbody { get; }
Gets the rigidbody that moves this collider (on the object or a parent), or null.

isTrigger

public bool isTrigger { get; set; }
Gets or sets whether the collider is a trigger: things pass through it and OnTriggerEnter/OnTriggerExit report them.

ClosestPoint

public Vector3 ClosestPoint(Vector3 position)
The point of the collider closest to position.

Raycast

public bool Raycast(Ray ray, out RaycastHit hit, double maxDistance)
Casts a ray against this collider only.

Kaskade

Collision

public sealed class Collision
A collision reported to OnCollisionEnter/Stay/Exit.

collider

public Collider? collider { get; }
Gets the other object's collider.

contactCount

public int contactCount { get; }
Gets the number of contact points.

contacts

public ContactPoint[] contacts { get; }
Gets the contact points (where they touch, the normal pointing away from the other object).

gameObject

public GameObject gameObject { get; }
Gets the other object.

relativeVelocity

public Vector3 relativeVelocity { get; }
Gets how fast the two approached each other.

rigidbody

public Rigidbody? rigidbody { get; }
Gets the other object's rigidbody, or null.

transform

public Transform transform { get; }
Gets the other object's transform.

GetContact

public ContactPoint GetContact(int index)
The contact at index.

Kaskade

Color

public struct Color
Representation of RGBA colors.

Color

public Color()
Creates a default instance of Color.

Color

public Color(double r, double g, double b, double a = 1)
A color from double components (scripts' math).

Color

public Color(float r, float g, float b, float a = 1)
A colour from red, green, blue and alpha (0..1).

a

public float a
Alpha (opacity), 0..1.

b

public float b
Blue, 0..1.

g

public float g
Green, 0..1.

r

public float r
Red, 0..1.

A

public float A { get; set; }
Alpha (opacity), 0..1.

B

public float B { get; set; }
Blue, 0..1.

Black

public static Color Black { get; }
Solid black.

Blue

public static Color Blue { get; }
Solid blue.

Clear

public static Color Clear { get; }
Fully transparent black.

Cyan

public static Color Cyan { get; }
Solid cyan.

G

public float G { get; set; }
Green, 0..1.

Gray

public static Color Gray { get; }
Middle grey.

Green

public static Color Green { get; }
Solid green.

Magenta

public static Color Magenta { get; }
Solid magenta.

R

public float R { get; set; }
Red, 0..1.

Red

public static Color Red { get; }
Solid red.

White

public static Color White { get; }
Solid white.

Yellow

public static Color Yellow { get; }
Unity's yellow (1, 0.92, 0.016).

black

public static Color black { get; }
Solid black.

blue

public static Color blue { get; }
Solid blue.

clear

public static Color clear { get; }
Fully transparent black.

cyan

public static Color cyan { get; }
Solid cyan.

gray

public static Color gray { get; }
Middle grey.

green

public static Color green { get; }
Solid green.

grey

public static Color grey { get; }
Middle grey.

magenta

public static Color magenta { get; }
Solid magenta.

red

public static Color red { get; }
Solid red.

white

public static Color white { get; }
Solid white.

yellow

public static Color yellow { get; }
Unity's yellow (1, 0.92, 0.016).

Equals

public override bool Equals(object? obj)
Overrides bool ValueType.Equals(object? obj).

GetHashCode

public override int GetHashCode()
Overrides int ValueType.GetHashCode().

Lerp

public static Color Lerp(Color a, Color b, double t)
Between a and b (t clamped to 0..1).

LerpUnclamped

public static Color LerpUnclamped(Color a, Color b, double t)
Between a and b.

ToString

public override string ToString()
Overrides string? ValueType.ToString().

operator +

public static Color operator +(Color a, Color b)
Component-wise sum.

operator ==

public static bool operator ==(Color lhs, Color rhs)
Whether all four components are equal.

operator !=

public static bool operator !=(Color lhs, Color rhs)
Whether any component differs.

operator *

public static Color operator *(Color a, Color b)
Component-wise product, or every component scaled.

operator *

public static Color operator *(Color a, double b)
Scaled.

operator *

public static Color operator *(Color a, float b)
Component-wise product, or every component scaled.

operator -

public static Color operator -(Color a, Color b)
Component-wise difference.

Kaskade

Component

public abstract class Component

Inherits Object

Something attached to a Component.GameObject: a C# Behaviour, the Component.Transform, or an engine component (Rigidbody, Light, ...).

gameObject

public GameObject gameObject { get; }
Gets the game object this component is attached to.

name

public override string name { get; set; }
Gets or sets the object's name (for a component: its game object's name).

tag

public string tag { get; set; }
Gets or sets the game object's tag.

transform

public Transform transform { get; }
Gets the transform of the game object.

BroadcastMessage

public void BroadcastMessage(string methodName, object? value = null)
Calls the method on the game object's behaviours and its descendants'.

CompareTag

public bool CompareTag(string tag)
Whether the game object has tag tag.

GetComponent

public Component? GetComponent(Type type)
The game object's component of type type, or null.

GetComponent

public T? GetComponent<T>()
The game object's component of type T, or null.

GetComponentInChildren

public T? GetComponentInChildren<T>(bool includeInactive = false)
The first component of type T on the game object or its descendants.

GetComponentInParent

public T? GetComponentInParent<T>()
The first component of type T on the game object or its ancestors.

GetComponents

public T[] GetComponents<T>()
All the game object's components of type T.

GetComponentsInChildren

public T[] GetComponentsInChildren<T>(bool includeInactive = false)
Every component of type T on the game object and its descendants.

GetComponentsInParent

public T[] GetComponentsInParent<T>()
Every component of type T on the game object and its ancestors.

GetInstanceID

public override int GetInstanceID()
A number unique to this object while it exists.

SendMessage

public void SendMessage(string methodName, object? value = null)
Calls the method named methodName on every C# behaviour of the game object.

TryGetComponent

public bool TryGetComponent<T>(out T component)
Whether the game object has a component of type T.

Kaskade

ComponentHandle

public readonly readonly struct ComponentHandle
Safe generational handle to a component implemented by Zito.

ComponentHandle

public ComponentHandle()
Creates a default instance of ComponentHandle.

IsValid

public bool IsValid { get; }
Gets whether this handle is non-null and can be resolved this frame.

Kaskade

ComputeBuffer

public sealed class ComputeBuffer

Implements IDisposable

A GPU buffer (Unity's ComputeBuffer): count elements of stride bytes, a StructuredBuffer / RWStructuredBuffer to shaders.

ComputeBuffer

public ComputeBuffer(int count, int stride)
A buffer of count elements of stride bytes.

count

public int count { get; }
The number of elements.

stride

public int stride { get; }
Bytes per element.

Dispose

public void Dispose()
Frees the buffer.

GetData

public bool GetData<T>(T[] data) where T : unmanaged
Copies the buffer into data: what was read back on an earlier frame (the first call asks and returns false; GPU work is carried out between frames).

IsValid

public bool IsValid()
Whether the buffer still exists.

Release

public void Release()
Frees the buffer.

SetData

public void SetData<T>(List<T> data) where T : unmanaged
Fills the buffer from a list.

SetData

public void SetData<T>(T[] data) where T : unmanaged
Fills the buffer with data (any unmanaged element type).

Kaskade

ComputeShader

public sealed class ComputeShader
A compute shader (Unity's ComputeShader): a .compute (kernels named by #pragma kernel), an .hlsl or a compiled .fxc. Values set here bind to the kernels by name at ComputeShader.Dispatch.

path

public string path { get; }
The project-relative file.

Dispatch

public void Dispatch(int kernel, int x, int y, int z)
Runs a kernel over x*y*z thread groups.

FindKernel

public int FindKernel(string name)
The index of a kernel.

GetKernelThreadGroupSizes

public void GetKernelThreadGroupSizes(int kernel, out uint x, out uint y, out uint z)
Threads per group of a kernel (known once it has run; else 1, 1, 1).

HasKernel

public bool HasKernel(string name)
Whether it has the kernel.

Load

public static ComputeShader Load(string path)
The compute shader at path (project-relative).

SetBool

public void SetBool(string name, bool value)
Sets a bool (as an int).

SetBuffer

public void SetBuffer(int kernel, string name, ComputeBuffer buffer)
Gives a kernel a buffer.

SetFloat

public void SetFloat(string name, float value)
Sets a float.

SetFloats

public void SetFloats(string name, params float[] values)
Sets an array of floats.

SetInt

public void SetInt(string name, int value)
Sets an int.

SetInts

public void SetInts(string name, params int[] values)
Sets an array of ints.

SetMatrix

public void SetMatrix(string name, Matrix4x4 value)
Sets a matrix.

SetTexture

public void SetTexture(int kernel, string name, Texture texture)
Gives a kernel a texture (a render texture it writes when random write is on).

SetVector

public void SetVector(string name, Vector4 value)
Sets a vector.

SetVectorArray

public void SetVectorArray(string name, Vector4[] values)
Sets an array of vectors.

Kaskade

ConVar

public sealed class ConVar
A developer console variable (Source's ConVar): set from the console with name value.

Bool

public bool Bool { get; }
Whether the value is non-zero.

Float

public float Float { get; }
The value as a number (0 when it is not one).

Int

public int Int { get; }
The value as a whole number.

Name

public string Name { get; }
The variable's name.

String

public string String { get; set; }
The value as text; setting it skips the cheat check.

Kaskade

ConVarFlags

public enum ConVarFlags
How a console variable or command behaves.

Cheat

Cheat = 1
Only usable while sv_cheats is 1.

Hidden

Hidden = 2
Not offered by completion or find.

None

None = 0
An ordinary variable or command.

Kaskade

ContactPoint

public readonly readonly struct ContactPoint

Implements IEquatable<ContactPoint>

Where two colliders touch.
point The point of contact (world space).
normal The contact normal.

ContactPoint

public ContactPoint()
Creates a default instance of ContactPoint.

ContactPoint

public ContactPoint(Vector3 point, Vector3 normal)
Where two colliders touch.
point The point of contact (world space).
normal The contact normal.

normal

public Vector3 normal { get; init; }
The contact normal.

point

public Vector3 point { get; init; }
The point of contact (world space).

Deconstruct

public void Deconstruct(out Vector3 point, out Vector3 normal)
Copies the positional values into the output parameters.

Equals

public bool Equals(ContactPoint other)
Checks equality using the record's data.

Equals

public override bool Equals(object obj)
Checks equality using the record's data.

GetHashCode

public override int GetHashCode()
Returns a hash of the record's data.

ToString

public override string ToString()
Returns a string representation of the record.

operator ==

public static bool operator ==(ContactPoint left, ContactPoint right)
Checks equality using the record's data.

operator !=

public static bool operator !=(ContactPoint left, ContactPoint right)
Checks whether the records differ.

Kaskade

Coroutine

public sealed class Coroutine

Inherits YieldInstruction

A running coroutine (Behaviour.StartCoroutine); yield it to wait for it to finish.

IsDone

public bool IsDone { get; }
Gets whether the coroutine has finished or was stopped.

Kaskade

Cursor

public static class Cursor
The mouse cursor.

lockState

public static CursorLockMode lockState { get; set; }
Gets or sets how the cursor is held.

visible

public static bool visible { get; set; }
Gets or sets whether the cursor shows (a locked cursor never does).

Kaskade

CursorLockMode

public enum CursorLockMode
How the mouse cursor is held.

Locked

Locked = 1
Held in the window centre and hidden (first-person look).

None

None = 0
Free, visible.

Kaskade

CustomYieldInstruction

public abstract class CustomYieldInstruction

Implements IEnumerator

A wait the coroutine keeps doing while CustomYieldInstruction.keepWaiting is true (checked every frame).

CustomYieldInstruction

protected CustomYieldInstruction()
Creates a default instance of CustomYieldInstruction.

keepWaiting

public abstract bool keepWaiting { get; }
Gets whether to keep waiting.

Kaskade

Debug

public static class Debug
Writes to the engine console and draws debug lines in the scene.

Assert

public static void Assert(bool condition, object? message = null)
Writes an error when condition is false.

DrawLine

public static void DrawLine(Vector3 start, Vector3 end, Color? color = null, double duration = 0)
Draws a line in the scene for duration seconds (0: one frame).

DrawRay

public static void DrawRay(Vector3 start, Vector3 direction, Color? color = null, double duration = 0)
Draws a line from start along direction.

Log

public static void Log(object? message)
Writes a message (any value: it is converted with ToString).

Log

public static void Log(object? message, Object? context)
Writes a message about context.

LogError

public static void LogError(object? message)
Writes an error.

LogError

public static void LogError(object? message, Object? context)
Writes an error about context.

LogException

public static void LogException(Exception exception)
Writes an exception as an error.

LogFormat

public static void LogFormat(string format, params object?[] args)
Writes a message built like System.String.Format(System.String,System.Object[]).

LogWarning

public static void LogWarning(object? message)
Writes a warning.

LogWarning

public static void LogWarning(object? message, Object? context)
Writes a warning about context.

Kaskade

DevConsole

public static class DevConsole
The developer console (the key left of 1): register variables and commands, run command lines and print to it. Command callbacks run during the frame's script updates.

Execute

public static void Execute(string line)
Runs a console line, as if typed (several commands separated by ;).

GetVar

public static string? GetVar(string name)
A variable's value, or null when there is no such variable.

Print

public static void Print(string text)
Prints a line to the console.

Print

public static void Print(string text, Color color)
Prints a line in color.

RegisterCommand

public static void RegisterCommand(string name, Action<string[]> callback, string help = "", ConVarFlags flags = ConVarFlags.None)
Registers a command; callback gets its arguments.

RegisterVar

public static ConVar RegisterVar(string name, string defaultValue, string help = "", ConVarFlags flags = ConVarFlags.None)
Registers a variable (an existing value is kept) and returns it.

SetVar

public static bool SetVar(string name, string value)
Sets a variable (no cheat check); false when there is no such variable.

Kaskade

EngineComponent

public abstract class EngineComponent

Inherits Component

A component implemented by the engine (physics, lights, audio, rendering). Its values are the ones of the scene format (the Inspector's); changes are applied after the scripts' update, before physics and rendering.

enabled

public bool enabled { get; set; }
Gets or sets whether the component takes part (a disabled light does not shine, ...).

Kaskade

FindObjectsInactive

public enum FindObjectsInactive
Unity's FindObjectsInactive.

Exclude

Exclude = 0
Active objects only.

Include

Include = 1
Inactive ones too (only active are found).

Kaskade

FindObjectsSortMode

public enum FindObjectsSortMode
Unity's sort modes of FindObjectsByType (the order is not kept either way).

InstanceID

InstanceID = 1
By instance ID (not kept).

None

None = 0
Any order.

Kaskade

Font

public sealed class Font
A font asset (a project path to a .ttf).

Font

public Font(string path)
A font from its file.

path

public string path
The font file.

implicit operator Font

public static implicit operator Font(string path)
A scene field's font path.

Kaskade

FontStyle

public enum FontStyle
Unity's font styles.

Bold

Bold = 1
Requests bold type.

BoldAndItalic

BoldAndItalic = 3
Requests both bold and italic type.

Italic

Italic = 2
Requests italic type.

Normal

Normal = 0
Uses regular type.

Kaskade

ForceMode

public enum ForceMode
Type of force to apply to a Rigidbody.

Acceleration

Acceleration = 3
Apply continuous acceleration to the rigidbody, ignoring its mass.

Force

Force = 0
Apply continuous force to the rigidbody, using its mass.

Impulse

Impulse = 1
Apply instantaneous force impulse to the rigidbody, using its mass.

VelocityChange

VelocityChange = 2
Apply instantaneous velocity change to the rigidbody, ignoring its mass.

Kaskade

FormerlySerializedAsAttribute

public sealed class FormerlySerializedAsAttribute

Inherits Attribute

Declares an earlier serialized name so hot reload and saved scenes can migrate data.
name The field or property name used by an earlier script version.

FormerlySerializedAsAttribute

public FormerlySerializedAsAttribute(string name)
Declares an earlier serialized name so hot reload and saved scenes can migrate data.
name The field or property name used by an earlier script version.

Name

public string Name { get; }
Gets the earlier serialized name.

Kaskade

GUI

public static class GUI
GUI class for IMGUI manual layout controls.

backgroundColor

public static Color backgroundColor { get; set; }
Tint of control backgrounds drawn after it.

color

public static Color color { get; set; }
Tint of everything drawn after it (Unity's GUI.color).

contentColor

public static Color contentColor { get; set; }
Tint of control text and icons drawn after it.

enabled

public static bool enabled { get; set; }
Whether the controls drawn after it react to input (false greys them out).

matrix

public static Matrix4x4 matrix { get; set; }
Unity's GUI matrix (scaling the GUI): not applied.

skin

public static GUISkin skin { get; set; }
The default styles (the immediate GUI draws its own: styles set only the text color).

Box

public static void Box(Rect position, string text)
Draws a framed box with an optional title.

Box

public static void Box(Rect position, string text, GUIStyle style)
A box in style's color.

Button

public static bool Button(Rect position, string text)
Draws a button. Returns true on the frame it is clicked.

Button

public static bool Button(Rect position, string text, GUIStyle style)
A button in style's color.

DrawTexture

public static void DrawTexture(Rect position, Texture? image)
A filled rectangle in the current color (the texture's own pixels are not drawn).

DrawTexture

public static void DrawTexture(Rect position, Texture? image, ScaleMode scaleMode, bool alphaBlend = true)
A filled rectangle (see GUI.DrawTexture).

HorizontalScrollbar

public static float HorizontalScrollbar(Rect position, float value, float size, float leftValue, float rightValue)
Draws a horizontal scroll bar. Returns the new scroll value.

HorizontalSlider

public static float HorizontalSlider(Rect position, float value, float leftValue, float rightValue)
Draws a horizontal slider between two values. Returns the new value.

Label

public static void Label(Rect position, string text)
Draws text in a rectangle (screen pixels from the top-left).

Label

public static void Label(Rect position, string text, GUIStyle style)
A label in style's color.

PasswordField

public static string PasswordField(Rect position, string password, char mask = '*', int maxLength = 256)
Draws a text box that shows every character as the mask. Returns the edited text.

RepeatButton

public static bool RepeatButton(Rect position, string text)
Draws a button. Returns true every frame while it is held.

TextArea

public static string TextArea(Rect position, string text, int maxLength = 1024)
Draws a multi-line text box. Returns the edited text.

TextField

public static string TextField(Rect position, string text, int maxLength = 256)
Draws a one-line text box. Returns the edited text.

Toggle

public static bool Toggle(Rect position, bool value, string text)
Draws a check box. Returns its new state.

VerticalScrollbar

public static float VerticalScrollbar(Rect position, float value, float size, float topValue, float bottomValue)
Draws a vertical scroll bar. Returns the new scroll value.

VerticalSlider

public static float VerticalSlider(Rect position, float value, float topValue, float bottomValue)
Draws a vertical slider between two values. Returns the new value.

Kaskade

GUILayout

public static class GUILayout
GUILayout class for automatic IMGUI layout controls.

BeginArea

public static void BeginArea(Rect screenRect)
Lays out the controls until EndArea inside a screen rectangle.

BeginHorizontal

public static void BeginHorizontal()
Starts a row: the controls until EndHorizontal sit side by side.

BeginScrollView

public static Vector2 BeginScrollView(Vector2 scrollPosition, float width = 0, float height = 0)
Starts a scrolling region (0 width/height: as large as the content allows). Returns the new scroll position.

BeginVertical

public static void BeginVertical()
Starts a column: the controls until EndVertical sit one below the other.

Box

public static void Box(string text)
A framed box in the current layout group.

Button

public static bool Button(string text)
A button in the current layout group. Returns true on the frame it is clicked.

EndArea

public static void EndArea()
Ends the area started by BeginArea.

EndHorizontal

public static void EndHorizontal()
Ends the row started by BeginHorizontal.

EndScrollView

public static void EndScrollView()
Ends the region started by BeginScrollView.

EndVertical

public static void EndVertical()
Ends the column started by BeginVertical.

FlexibleSpace

public static void FlexibleSpace()
Space that takes up whatever room is left in the current group.

HorizontalSlider

public static float HorizontalSlider(float value, float leftValue, float rightValue)
A horizontal slider in the current layout group. Returns the new value.

Label

public static void Label(string text)
A text line in the current layout group.

PasswordField

public static string PasswordField(string password, char mask = '*', int maxLength = 256)
A masked text box in the current layout group. Returns the edited text.

RepeatButton

public static bool RepeatButton(string text)
A button in the current layout group. Returns true every frame while it is held.

Space

public static void Space(float pixels)
Empty space of a number of pixels along the current group.

TextArea

public static string TextArea(string text, int maxLength = 1024)
A multi-line text box in the current layout group. Returns the edited text.

TextField

public static string TextField(string text, int maxLength = 256)
A one-line text box in the current layout group. Returns the edited text.

Toggle

public static bool Toggle(bool value, string text)
A check box in the current layout group. Returns its new state.

VerticalSlider

public static float VerticalSlider(float value, float topValue, float bottomValue)
A vertical slider in the current layout group. Returns the new value.

Kaskade

GUISkin

public sealed class GUISkin
Unity's GUISkin: the default styles.

GUISkin

public GUISkin()
Creates a default instance of GUISkin.

box

public GUIStyle box
Boxes.

button

public GUIStyle button
Buttons.

font

public Font? font
The skin's font.

label

public GUIStyle label
Labels.

textField

public GUIStyle textField
Text fields.

Kaskade

GUIStyle

public sealed class GUIStyle
Unity's GUIStyle as the immediate GUI uses it: font, size, alignment, color, wrapping.

GUIStyle

public GUIStyle()
A default style.

GUIStyle

public GUIStyle(GUIStyle other)
A copy of other.

alignment

public TextAnchor alignment
Text alignment in the rect.

font

public Font? font
The style's font.

fontSize

public int fontSize
Font size in pixels (0: the default).

fontStyle

public FontStyle fontStyle
Bold or italic.

hover

public GUIStyleState hover
Hover state.

normal

public GUIStyleState normal
Normal state (text color).

richText

public bool richText
Rich text tags.

wordWrap

public bool wordWrap
Wraps long text.

Kaskade

GUIStyleState

public sealed class GUIStyleState
Unity's GUIStyleState: the text color.

GUIStyleState

public GUIStyleState()
Creates a default instance of GUIStyleState.

background

public Texture2D? background
Background (not drawn).

textColor

public Color textColor
Text color.

Kaskade

GameObject

public sealed class GameObject

Inherits Object

An object of the scene: a name, a GameObject.transform and components. Also a prefab asset to make objects from: a [SerializeField] GameObject field takes an object from the Hierarchy or a .kprefab from the Project panel, either works with Object.Instantiate.

GameObject

public GameObject()
A new empty object named "GameObject" in the scene of the running script.

GameObject

public GameObject(string name)
A new empty object in the scene of the running script; usable at once.

GameObject

public GameObject(string name, params Type[] components)
A new object with components of the given types added.

IsAlive

public bool IsAlive { get; }
Earlier name of this existing (if (gameObject)).

IsPrefab

public bool IsPrefab { get; }
Gets whether this is a prefab asset rather than an object in the scene.

PrefabPath

public string? PrefabPath { get; }
Gets the prefab's project-relative path, or null for an object in the scene.

Rigidbody

public Rigidbody Rigidbody { get; }
Earlier way to get the Rigidbody: use GetComponent<Rigidbody>().

activeInHierarchy

public bool activeInHierarchy { get; }
Gets whether the object and all its parents are active.

activeSelf

public bool activeSelf { get; }
Gets whether the object itself is active (its parents may still hide it).

layer

public int layer { get; set; }
Gets or sets the object's layer (0-63; physics queries filter by it).

name

public override string name { get; set; }
Gets or sets the object's name (for a component: its game object's name).

scene

public Scene scene { get; }
Gets the scene the object is in.

tag

public string tag { get; set; }
Gets or sets the object's tag.

transform

public Transform transform { get; }
Gets the object's transform: position, rotation, scale and place in the hierarchy.

AddComponent

public T AddComponent<T>() where T : Component
Adds a component: a C# behaviour, or an engine component (GameObject.Rigidbody, BoxCollider, Light, AudioSource, ...). It is returned at once; its callbacks start with the next frame.

BroadcastMessage

public void BroadcastMessage(string methodName, object? value = null)
Calls the method named methodName on the object's behaviours and its descendants'.

CompareTag

public bool CompareTag(string tag)
Whether the object has tag tag.

Find

public static GameObject? Find(string name)
The active object named name (or at path "Parent/Child"), or null.

FindGameObjectWithTag

public static GameObject? FindGameObjectWithTag(string tag)
Unity's other name for GameObject.FindWithTag.

FindGameObjectsWithTag

public static GameObject[] FindGameObjectsWithTag(string tag)
Every active object tagged tag.

FindWithTag

public static GameObject? FindWithTag(string tag)
An active object tagged tag, or null.

GetComponent

public Component? GetComponent(Type type)
The object's component of type type, or null.

GetComponentInChildren

public T? GetComponentInChildren<T>(bool includeInactive = false)
The first component of type T on the object or its descendants.

GetComponentInParent

public T? GetComponentInParent<T>()
The first component of type T on the object or its ancestors.

GetComponents

public T[] GetComponents<T>()
All the object's components of type T.

GetComponentsInChildren

public T[] GetComponentsInChildren<T>(bool includeInactive = false)
Every component of type T on the object and its descendants.

GetComponentsInParent

public T[] GetComponentsInParent<T>()
Every component of type T on the object and its ancestors.

GetInstanceID

public override int GetInstanceID()
A number unique to this object while it exists.

GetRigidbody

public Rigidbody GetRigidbody()
Earlier way to get the Rigidbody: use GetComponent<Rigidbody>().

Prefab

public static GameObject Prefab(string path)
The prefab asset at path (a project-relative .kprefab).

SendMessage

public void SendMessage(string methodName, object? value = null)
Calls the method named methodName on every C# behaviour of the object.

SendMessageUpwards

public void SendMessageUpwards(string methodName, object? value = null)
Calls the method named methodName on the object's behaviours and its ancestors'.

SetActive

public void SetActive(bool value)
Activates or deactivates the object (with its children).

ToString

public override string ToString()
Overrides string? object.ToString().

TryGetComponent

public bool TryGetComponent<T>(out T component)
Whether the object has a component of type T; it is returned in component.

Kaskade

Graphics

public static class Graphics
Drawing helpers (Unity's Graphics).

Blit

public static void Blit(Texture source, RenderTexture destination)
Copies a render texture into another of the same size.

Kaskade

HeaderAttribute

public sealed class HeaderAttribute

Inherits Attribute

A heading shown above the field in the inspector.

HeaderAttribute

public HeaderAttribute(string text)
A heading shown above the field in the inspector.

Text

public string Text { get; }
Gets the heading.

Kaskade

HideInInspectorAttribute

public sealed class HideInInspectorAttribute

Inherits Attribute

Keeps a serialized field out of the inspector.

HideInInspectorAttribute

public HideInInspectorAttribute()
Creates a default instance of HideInInspectorAttribute.

Kaskade

HotReloadContext

public readonly readonly struct HotReloadContext

Implements IEquatable<HotReloadContext>

Describes a completed structural replacement of managed gameplay code.
PreviousGeneration Generation that created the old behaviour object.
CurrentGeneration Generation that created the replacement behaviour object.

HotReloadContext

public HotReloadContext()
Creates a default instance of HotReloadContext.

HotReloadContext

public HotReloadContext(ulong PreviousGeneration, ulong CurrentGeneration)
Describes a completed structural replacement of managed gameplay code.
PreviousGeneration Generation that created the old behaviour object.
CurrentGeneration Generation that created the replacement behaviour object.

CurrentGeneration

public ulong CurrentGeneration { get; init; }
Generation that created the replacement behaviour object.

PreviousGeneration

public ulong PreviousGeneration { get; init; }
Generation that created the old behaviour object.

Deconstruct

public void Deconstruct(out ulong PreviousGeneration, out ulong CurrentGeneration)
Copies the positional values into the output parameters.

Equals

public bool Equals(HotReloadContext other)
Checks equality using the record's data.

Equals

public override bool Equals(object obj)
Checks equality using the record's data.

GetHashCode

public override int GetHashCode()
Returns a hash of the record's data.

ToString

public override string ToString()
Returns a string representation of the record.

operator ==

public static bool operator ==(HotReloadContext left, HotReloadContext right)
Checks equality using the record's data.

operator !=

public static bool operator !=(HotReloadContext left, HotReloadContext right)
Checks whether the records differ.

Kaskade

HotStateBuffer

public sealed class HotStateBuffer
Stores reload-safe values under source-generated stable field IDs. The buffer belongs to the default load context and never retains gameplay-defined objects or types.

HotStateBuffer

public HotStateBuffer()
Creates a default instance of HotStateBuffer.

TryRead

public bool TryRead<T>(ulong fieldId, out T value)
Attempts to read a reload-safe value from a stable field ID.
T Expected reload-safe value type.
fieldId Source-generated stable field ID.
value Receives the value when its type is compatible.
Returns true when a compatible value exists.

Write

public void Write<T>(ulong fieldId, T value)
Writes a reload-safe value under a stable field ID.
T A primitive, string, vector, or Kaskade handle wrapper.
fieldId Source-generated stable field ID.
value Value to preserve.

Kaskade

IGeneratedBehaviourRegistry

public interface IGeneratedBehaviourRegistry
Implemented by Kaskade's source generator inside each GameScripts assembly. The managed host uses this stable interface without scanning gameplay types through reflection.

Metadata

IReadOnlyList<BehaviourMetadata> Metadata { get; }
Gets the generated component and lifecycle metadata.

CaptureState

void CaptureState(Behaviour behaviour, HotStateBuffer state)
Captures reload-safe instance fields without runtime reflection.

Create

Behaviour? Create(ulong typeIdLow, ulong typeIdHigh)
Creates a behaviour by its persistent 128-bit type ID.

GetField

JsonNode? GetField(Behaviour behaviour, string name)
A serialized field's value as JSON; null for an unknown field.

GetFieldMetadata

IReadOnlyList<FieldMetadata> GetFieldMetadata(ulong typeIdLow, ulong typeIdHigh)
The inspector-visible serialized fields of a component type, in declaration order.

RestoreState

void RestoreState(Behaviour behaviour, HotStateBuffer state)
Restores reload-safe instance fields, including former serialized names.

SetField

bool SetField(Behaviour behaviour, string name, JsonNode? value)
Sets a serialized field from JSON; false for an unknown field or a value that does not fit.

Kaskade

IZitoComponent<TSelf>

public interface IZitoComponent<TSelf> where TSelf : struct, IZitoComponent<TSelf>
Marker and factory contract implemented by generated Zito component proxies.

TypeId

ZitoTypeId TypeId { get; }
Gets the persistent Zito type identity.

FromHandle

TSelf FromHandle(ComponentHandle handle)
Creates a proxy around a native component handle.

Kaskade

Input

public static class Input
Keyboard and mouse input of the current frame (Unity's Input). Nothing is reported while a menu or the debug overlay has the input.
Example
            if (Input.GetKeyDown(Key.E)) Interact();
            if (Input.GetMouseButtonDown(MouseButton.Left)
                && Camera.ScreenPointToWorldPos(Input.mousePosition, out RaycastHit hit))
            {
                Debug.Log($"Clicked {hit.gameObject} at {hit.point}");
            }
            

cursorLocked

public static bool cursorLocked { get; set; }
Whether the cursor is locked to the window and hidden (first person look).

mouseDelta

public static Vector2 mouseDelta { get; }
How far the cursor moved this frame (pixels).

mousePosition

public static Vector2 mousePosition { get; }
The cursor in window pixels from the top-left corner: what the Camera screen conversions take.

mouseScrollDelta

public static Vector2 mouseScrollDelta { get; }
Wheel scroll this frame (y: up is positive).

rawMouseDelta

public static Vector2 rawMouseDelta { get; }
Raw mouse motion this frame, also while the cursor is locked (mouse look).

GetKey

public static bool GetKey(Key key)
Whether key is held down this frame.

GetKey

public static bool GetKey(string engineKeyName)
Whether the key with the engine name engineKeyName (such as "KeyE", "Digit1" or "ShiftLeft") is held down.

GetKeyDown

public static bool GetKeyDown(Key key)
Whether key went down this frame (true for one frame per press).

GetKeyDown

public static bool GetKeyDown(string engineKeyName)
Whether the key with the engine name engineKeyName went down this frame.

GetKeyUp

public static bool GetKeyUp(Key key)
Whether key was released this frame.

GetKeyUp

public static bool GetKeyUp(string engineKeyName)
Whether the key with the engine name engineKeyName was released this frame.

GetMouseButton

public static bool GetMouseButton(MouseButton button)
Whether a mouse button is held down.

GetMouseButton

public static bool GetMouseButton(int button)
Whether mouse button button (0 left, 1 right, 2 middle) is held down.

GetMouseButtonDown

public static bool GetMouseButtonDown(MouseButton button)
Whether a mouse button went down this frame.

GetMouseButtonDown

public static bool GetMouseButtonDown(int button)
Whether mouse button button (0 left, 1 right, 2 middle) went down this frame.

GetMouseButtonUp

public static bool GetMouseButtonUp(MouseButton button)
Whether a mouse button was released this frame.

GetMouseButtonUp

public static bool GetMouseButtonUp(int button)
Whether mouse button button (0 left, 1 right, 2 middle) was released this frame.

KeyDown

public static bool KeyDown(Key key)
Same as Input.GetKeyDown: whether key went down this frame.

KeyName

public static string KeyName(Key key)
The engine's name for a key (as the Zito SDK's input.key_down takes it).

Kaskade

KaskadeComponentAttribute

public sealed class KaskadeComponentAttribute

Inherits Attribute

Assigns a persistent, rename-safe engine identity to a gameplay component.
id A GUID that remains stable for the lifetime of the component type.

KaskadeComponentAttribute

public KaskadeComponentAttribute(string id)
Assigns a persistent, rename-safe engine identity to a gameplay component.
id A GUID that remains stable for the lifetime of the component type.

Id

public Guid Id { get; }
Gets the persistent component identity.

Kaskade

Key

public enum Key
Keyboard keys, named as in Unity; each maps to the engine's key name (see Input.KeyName).

A

A = 1
The A key.

Alpha0

Alpha0 = 28
The 0 key of the top row.

Alpha1

Alpha1 = 29
The 1 key of the top row.

Alpha2

Alpha2 = 30
The 2 key of the top row.

Alpha3

Alpha3 = 31
The 3 key of the top row.

Alpha4

Alpha4 = 32
The 4 key of the top row.

Alpha5

Alpha5 = 33
The 5 key of the top row.

Alpha6

Alpha6 = 34
The 6 key of the top row.

Alpha7

Alpha7 = 35
The 7 key of the top row.

Alpha8

Alpha8 = 36
The 8 key of the top row.

Alpha9

Alpha9 = 37
The 9 key of the top row.

B

B = 6
The B key.

Backspace

Backspace = 40
The Backspace key.

C

C = 7
The C key.

D

D = 3
The D key.

DownArrow

DownArrow = 48
The Down arrow.

E

E = 8
The E key.

Escape

Escape = 5
The Escape key.

F

F = 9
The F key.

F1

F1 = 51
The F1 key.

F10

F10 = 58
The F10 key.

F2

F2 = 52
The F2 key.

F3

F3 = 53
The F3 key.

F4

F4 = 54
The F4 key.

F5

F5 = 55
The F5 key.

F6

F6 = 56
The F6 key.

F8

F8 = 57
The F8 key (F7, F9, F11 and F12 are taken by the engine's overlays).

G

G = 10
The G key.

H

H = 11
The H key.

I

I = 12
The I key.

J

J = 13
The J key.

K

K = 14
The K key.

L

L = 15
The L key.

LeftAlt

LeftAlt = 45
The left Alt key.

LeftArrow

LeftArrow = 49
The Left arrow.

LeftControl

LeftControl = 43
The left Ctrl key.

LeftShift

LeftShift = 41
The left Shift key.

M

M = 16
The M key.

N

N = 17
The N key.

O

O = 18
The O key.

P

P = 19
The P key.

Q

Q = 20
The Q key.

R

R = 21
The R key.

Return

Return = 38
The Enter (Return) key.

RightAlt

RightAlt = 46
The right Alt key.

RightArrow

RightArrow = 50
The Right arrow.

RightControl

RightControl = 44
The right Ctrl key.

RightShift

RightShift = 42
The right Shift key.

S

S = 2
The S key.

Space

Space = 4
The Space bar.

T

T = 22
The T key.

Tab

Tab = 39
The Tab key.

U

U = 23
The U key.

UpArrow

UpArrow = 47
The Up arrow.

V

V = 24
The V key.

W

W = 0
The W key.

X

X = 25
The X key.

Y

Y = 26
The Y key.

Z

Z = 27
The Z key.

Kaskade

LayerMask

public struct LayerMask
Bit masks of layers for the physics queries.

LayerMask

public LayerMask()
Creates a default instance of LayerMask.

value

public int value
The mask's bits.

GetMask

public static int GetMask(params int[] layers)
The mask of the given layer numbers.

implicit operator int

public static implicit operator int(LayerMask mask)
The mask's bits.

implicit operator LayerMask

public static implicit operator LayerMask(int value)
A mask from its bits.

Kaskade

Light

public sealed class Light

Inherits EngineComponent

A point, spot or directional light.

color

public Color color { get; set; }
Gets or sets the colour.

innerSpotAngle

public double innerSpotAngle { get; set; }
Gets or sets a spot light's inner (full brightness) cone angle in degrees.

intensity

public double intensity { get; set; }
Gets or sets the brightness.

range

public double range { get; set; }
Gets or sets how far a point or spot light reaches, in metres.

spotAngle

public double spotAngle { get; set; }
Gets or sets a spot light's outer cone angle in degrees.

type

public LightType type { get; }
Gets the kind of light (a different kind is a different component: add that one).

Kaskade

LightType

public enum LightType
The kind of a light.

Directional

Directional = 2
Shines in one direction everywhere (the sun).

Point

Point = 0
Shines in all directions from a point, up to its range.

Spot

Spot = 1
Shines in a cone.

Kaskade

Material

public sealed class Material
The material of an object's renderers (Unity's Material; every object using it sees changes, as Unity's sharedMaterial). Values go to its custom shader by name; _Color, _MainTex, _EmissionColor, _Metallic and _Smoothness also set the built-in shader's. Values are applied before the next frame renders.

color

public Color color { get; set; }
Gets or sets _Color.

mainTexture

public Texture? mainTexture { get; set; }
Gets or sets _MainTex.

mainTextureOffset

public Vector2 mainTextureOffset { get; set; }
Gets or sets _MainTex_ST's offset.

mainTextureScale

public Vector2 mainTextureScale { get; set; }
Gets or sets _MainTex_ST's scale.

name

public string name { get; }
The material's file (.kmat) or scene name, when known.

shader

public Shader? shader { get; set; }
Gets or sets its shader (a .shader, .hlsl or .fxc file).

DisableKeyword

public void DisableKeyword(string keyword)
Disables a keyword.

EnableKeyword

public void EnableKeyword(string keyword)
Enables a keyword (multi_compile / shader_feature).

GetColor

public Color GetColor(int id)
A color by property ID.

GetColor

public Color GetColor(string name)
A colour this script set (else white).

GetFloat

public float GetFloat(int id)
A float by property ID.

GetFloat

public float GetFloat(string name)
A float this script set (else 0).

GetInt

public int GetInt(string name)
An int this script set (else 0).

GetTexture

public Texture? GetTexture(string name)
A texture this script set.

GetVector

public Vector4 GetVector(string name, Vector4 fallback = default(Vector4))
A vector this script set (else fallback).

HasProperty

public bool HasProperty(int id)
Whether the material has the property (by ID).

HasProperty

public bool HasProperty(string name)
Whether this script set the value.

IsKeywordEnabled

public bool IsKeywordEnabled(string keyword)
Whether this script enabled the keyword.

Of

public static Material Of(GameObject gameObject)
The material of gameObject's renderers (its model's, all of them).

SetColor

public void SetColor(int id, Color value)
Sets a color by property ID.

SetColor

public void SetColor(string name, Color value)
Sets a colour (linear).

SetFloat

public void SetFloat(int id, double value)
Sets a float by property ID.

SetFloat

public void SetFloat(string name, double value)
Sets a float.

SetFloat

public void SetFloat(string name, float value)
Sets a float.

SetInt

public void SetInt(string name, int value)
Sets an int (as a float, as Unity's SetInt).

SetInteger

public void SetInteger(string name, int value)
Sets an integer (as SetInteger).

SetMatrix

public void SetMatrix(string name, Matrix4x4 value)
Sets a matrix.

SetTexture

public void SetTexture(string name, Texture value)
Sets a texture (a file or a render texture).

SetTextureOffset

public void SetTextureOffset(string name, Vector2 value)
Sets a texture's offset (name_ST zw).

SetTextureScale

public void SetTextureScale(string name, Vector2 value)
Sets a texture's tiling (name_ST xy).

SetVector

public void SetVector(int id, Vector4 value)
Sets a vector by property ID.

SetVector

public void SetVector(string name, Vector4 value)
Sets a vector.

implicit operator bool

public static implicit operator bool(Material? material)
Whether there is a material.

implicit operator string

public static implicit operator string(Material material)
The material's name.

implicit operator Material

public static implicit operator Material(string name)
A material by its file (.kmat) or scene name, to give a renderer.

Kaskade

MaterialPropertyBlock

public sealed class MaterialPropertyBlock
Per-renderer material values (applied to the renderer's own material).

MaterialPropertyBlock

public MaterialPropertyBlock()
Creates a default instance of MaterialPropertyBlock.

isEmpty

public bool isEmpty { get; }
Whether nothing is set.

Clear

public void Clear()
Removes every value.

GetColor

public Color GetColor(int id)
A color set before (white otherwise).

GetColor

public Color GetColor(string name)
A color set before (white otherwise).

GetFloat

public float GetFloat(int id)
A float set before (0 otherwise).

GetFloat

public float GetFloat(string name)
A float set before (0 otherwise).

SetColor

public void SetColor(int id, Color value)
Sets a color by property ID.

SetColor

public void SetColor(string name, Color value)
Sets a color.

SetFloat

public void SetFloat(int id, double value)
Sets a float by property ID.

SetFloat

public void SetFloat(string name, double value)
Sets a float.

SetVector

public void SetVector(int id, Vector4 value)
Sets a vector by property ID.

SetVector

public void SetVector(string name, Vector4 value)
Sets a vector.

Kaskade

Mathf

public static class Mathf
Float maths in Unity's names (single precision; the same functions take doubles too).

Deg2Rad

public const float Deg2Rad = 0.017453292
Degrees to radians: multiply by this.

Epsilon

public const float Epsilon = 1E-45
The smallest positive float.

Infinity

public const float Infinity = Infinity
Positive infinity.

NegativeInfinity

public const float NegativeInfinity = -Infinity
Negative infinity.

PI

public const float PI = 3.1415927
π.

Rad2Deg

public const float Rad2Deg = 57.295776
Radians to degrees: multiply by this.

Abs

public static double Abs(double value)
The absolute value.

Abs

public static int Abs(int value)
The absolute value.

Abs

public static float Abs(float value)
The absolute value.

Acos

public static double Acos(double f)
The double version.

Acos

public static float Acos(float f)
Arc cosine (radians).

Approximately

public static bool Approximately(float a, float b)
Whether two floats are nearly equal.

Asin

public static double Asin(double f)
The double version.

Asin

public static float Asin(float f)
Arc sine (radians).

Atan

public static double Atan(double f)
The double version.

Atan

public static float Atan(float f)
Arc tangent (radians).

Atan2

public static double Atan2(double y, double x)
The double version.

Atan2

public static float Atan2(float y, float x)
The angle of (x, y) in radians.

Ceil

public static double Ceil(double f)
The double version.

Ceil

public static float Ceil(float f)
Rounds up.

CeilToInt

public static int CeilToInt(double f)
Rounds up to an int.

Clamp

public static double Clamp(double value, double min, double max)
value limited to min..max.

Clamp

public static int Clamp(int value, int min, int max)
value limited to min..max.

Clamp

public static float Clamp(float value, float min, float max)
value limited to min..max.

Clamp01

public static double Clamp01(double value)
value limited to 0..1.

Clamp01

public static float Clamp01(float value)
value limited to 0..1.

Cos

public static double Cos(double f)
The double version.

Cos

public static float Cos(float f)
Cosine (radians).

DeltaAngle

public static double DeltaAngle(double current, double target)
The double version.

DeltaAngle

public static float DeltaAngle(float current, float target)
The shortest difference between two angles in degrees (-180..180).

Exp

public static double Exp(double power)
The double version.

Exp

public static float Exp(float power)
e to the power power.

Floor

public static double Floor(double f)
The double version.

Floor

public static float Floor(float f)
Rounds down.

FloorToInt

public static int FloorToInt(double f)
Rounds down to an int.

InverseLerp

public static double InverseLerp(double a, double b, double value)
Where value is between a and b (0..1).

InverseLerp

public static float InverseLerp(float a, float b, float value)
Where value is between a and b (0..1).

IsPowerOfTwo

public static bool IsPowerOfTwo(int value)
Whether value is a power of two.

Lerp

public static double Lerp(double a, double b, double t)
The value t of the way from a to b (t clamped to 0..1).

Lerp

public static float Lerp(float a, float b, float t)
The value t of the way from a to b (t clamped to 0..1).

LerpAngle

public static double LerpAngle(double a, double b, double t)
The double version.

LerpAngle

public static float LerpAngle(float a, float b, float t)
Lerps angles in degrees the short way round.

LerpUnclamped

public static double LerpUnclamped(double a, double b, double t)
The value t of the way from a to b (t not clamped).

LerpUnclamped

public static float LerpUnclamped(float a, float b, float t)
The value t of the way from a to b (t not clamped).

Log

public static double Log(double f)
The double version.

Log

public static double Log(double f, double p)
The double version.

Log

public static float Log(float f)
Natural logarithm.

Log

public static float Log(float f, float p)
Logarithm in base p.

Log10

public static double Log10(double f)
The double version.

Log10

public static float Log10(float f)
Base-10 logarithm.

Max

public static double Max(double a, double b)
The larger value.

Max

public static double Max(params double[] values)
The double version.

Max

public static int Max(int a, int b)
The larger value.

Max

public static float Max(float a, float b)
The larger value.

Max

public static float Max(params float[] values)
The largest value.

Min

public static double Min(double a, double b)
The smaller value.

Min

public static double Min(params double[] values)
The double version.

Min

public static int Min(int a, int b)
The smaller value.

Min

public static float Min(float a, float b)
The smaller value.

Min

public static float Min(params float[] values)
The smallest value.

MoveTowards

public static double MoveTowards(double current, double target, double maxDelta)
Moves current to target by at most maxDelta.

MoveTowards

public static float MoveTowards(float current, float target, float maxDelta)
Moves current to target by at most maxDelta.

MoveTowardsAngle

public static double MoveTowardsAngle(double current, double target, double maxDelta)
The double version.

MoveTowardsAngle

public static float MoveTowardsAngle(float current, float target, float maxDelta)
Like Mathf.MoveTowards for angles in degrees.

NextPowerOfTwo

public static int NextPowerOfTwo(int value)
The next power of two at or above value.

PerlinNoise

public static float PerlinNoise(float x, float y)
Smooth 2D noise in 0..1.

PingPong

public static double PingPong(double t, double length)
The double version.

PingPong

public static float PingPong(float t, float length)
t bouncing between 0 and length.

Pow

public static double Pow(double f, double p)
The double version.

Pow

public static float Pow(float f, float p)
f to the power p.

Repeat

public static double Repeat(double t, double length)
The double version.

Repeat

public static float Repeat(float t, float length)
t wrapped into 0..length.

Round

public static double Round(double f)
The double version.

Round

public static float Round(float f)
Rounds to nearest.

RoundToInt

public static int RoundToInt(double f)
Rounds to the nearest int.

Sign

public static double Sign(double f)
The double version.

Sign

public static float Sign(float f)
-1, 0 or 1 (Unity's Sign gives 1 for 0).

Sin

public static double Sin(double f)
The double version.

Sin

public static float Sin(float f)
Sine (radians).

SmoothDamp

public static double SmoothDamp(double current, double target, ref double currentVelocity, double smoothTime, double maxSpeed = double.PositiveInfinity, double deltaTime = -1)
The double version.

SmoothDamp

public static float SmoothDamp(float current, float target, ref float currentVelocity, float smoothTime, float maxSpeed = float.PositiveInfinity, float deltaTime = -1)
Moves current smoothly towards target (a critically damped spring).

SmoothStep

public static double SmoothStep(double from, double to, double t)
The double version.

SmoothStep

public static float SmoothStep(float from, float to, float t)
Smooth Hermite interpolation from a to b.

Sqrt

public static double Sqrt(double f)
The double version.

Sqrt

public static float Sqrt(float f)
Square root.

Tan

public static double Tan(double f)
The double version.

Tan

public static float Tan(float f)
Tangent (radians).

Kaskade

Matrix4x4

public struct Matrix4x4
A 4x4 matrix (Unity's Matrix4x4), column-major as shaders read it.

Matrix4x4

public Matrix4x4()
Creates a default instance of Matrix4x4.

Matrix4x4

public Matrix4x4(float[] columnMajor)
A matrix from its sixteen values, column after column.

Values

public float[] Values { get; }
The matrix's sixteen values, column after column.

identity

public static Matrix4x4 identity { get; }
The identity.

Indexer

public float this[int row, int column] { get; set; }
The value at row, column.

MultiplyPoint

public Vector3 MultiplyPoint(Vector3 p)
A point transformed (w 1).

TRS

public static Matrix4x4 TRS(Vector3 position, Quaternion rotation, Vector3 scale)
Translation, rotation and scale (Unity's Matrix4x4.TRS).

operator *

public static Matrix4x4 operator *(Matrix4x4 a, Matrix4x4 b)
The product a * b.

Kaskade

MeshCollider

public sealed class MeshCollider

Inherits Collider

A collider with the shape of the object's mesh.

Kaskade

MeshRenderer

public sealed class MeshRenderer

Inherits EngineComponent

Draws a mesh (a primitive or a model's part) with a material.

allowOcclusionWhenDynamic

public bool allowOcclusionWhenDynamic { get; set; }
Unity's dynamic occlusion switch (nothing is occlusion-culled here).

bounds

public Bounds bounds { get; }
The world box of what this object (with its children) drew last frame; a point at the object before it has been drawn.

castShadows

public bool castShadows { get; set; }
Gets or sets whether it casts shadows.

material

public Material material { get; set; }
Gets or sets the material (a .kmat path or a material of the scene; a string converts). Its Set* calls reach its shader.

materials

public Material[] materials { get; set; }
Its materials (one per renderer here).

receiveShadows

public bool receiveShadows { get; set; }
Gets or sets whether shadows fall on it.

sharedMaterial

public Material sharedMaterial { get; set; }
The material (shared by every object using it, as all of KasKade's are).

sharedMaterials

public Material[] sharedMaterials { get; set; }
Its materials (one per renderer here).

GetPropertyBlock

public void GetPropertyBlock(MaterialPropertyBlock block)
Reads the overrides last set on this renderer.

SetPropertyBlock

public void SetPropertyBlock(MaterialPropertyBlock block)
Overrides material values of this renderer only (its material instance).

Kaskade

MouseButton

public enum MouseButton
Mouse buttons for Input.GetMouseButton.

Back

Back = 3
The "back" side button.

Forward

Forward = 4
The "forward" side button.

Left

Left = 0
The left button.

Middle

Middle = 2
The middle button (wheel press).

Right

Right = 1
The right button.

Kaskade

NavMesh

public static class NavMesh
High-level Navigation Mesh and Pathfinding API.

Bake

public static void Bake()
Bakes the active NavMesh using default or pending scene geometry.
Usually baked once in the editor (Navigation tab) and loaded with the scene.

Bake

public static void Bake(Scene scene)
Bakes the NavMesh for a given scene.

CalculatePath

public static bool CalculatePath(Vector3 sourcePosition, Vector3 targetPosition, NavMeshPath path)
Calculates a path between two points and writes waypoints to the provided path object.
Returns false when no path exists.

FindPath

public static Vector3[] FindPath(Vector3 start, Vector3 end)
Finds a path between two points and returns the array of waypoints.
Returns The waypoints, empty when no path exists.

Kaskade

NavMeshAgent

public class NavMeshAgent

Inherits Behaviour

Navigation agent component for autonomous path following. Fully compatible with AI behaviors like Angry Neighbor's node_AIMovement.

NavMeshAgent

public NavMeshAgent()
Creates a default instance of NavMeshAgent.

desiredVelocity

public Vector3 desiredVelocity { get; }
The velocity the agent wants towards its next corner.

destination

public Vector3 destination { get; set; }
Where the agent walks to; setting it computes a path (see NavMeshAgent.SetDestination).

hasPath

public bool hasPath { get; }
Whether the agent has a path it has not finished.

isStopped

public bool isStopped { get; set; }
Pauses movement along the current path.

pathPending

public bool pathPending { get; }
Whether a path is still being computed.

remainingDistance

public float remainingDistance { get; }
Distance left along the path (metres).

speed

public float speed { get; set; }
Walking speed (metres per second).

stoppingDistance

public float stoppingDistance { get; set; }
How close to the destination the agent stops (metres).

updatePosition

public bool updatePosition { get; set; }
Whether the agent moves its object (off: it only computes velocity).

updateRotation

public bool updateRotation { get; set; }
Whether the agent turns its object along the path.

velocity

public Vector3 velocity { get; }
The current velocity (metres per second).

CalculatePath

public bool CalculatePath(Vector3 targetPosition, NavMeshPath path)
Computes a path to a point into path without following it.

ResetPath

public void ResetPath()
Clears the path; the agent stops.

SetDestination

public bool SetDestination(Vector3 target)
Computes a path on the baked navmesh to target. Returns false when there is none.

Update

protected override void Update(double deltaTime)
Moves the agent along its path every frame.

UpdateMovement

public void UpdateMovement(float deltaTime)
Moves the agent along its path by one step of deltaTime seconds (Update calls it).

Warp

public void Warp(Vector3 newPosition)
Teleports the agent and clears its path.

Kaskade

NavMeshPath

public class NavMeshPath
Represents a calculated path across the NavMesh.

NavMeshPath

public NavMeshPath()
Creates a default instance of NavMeshPath.

corners

public Vector3[] corners { get; }
The waypoints from start to end (on the navmesh surface).

status

public NavMeshPathStatus status { get; }
Whether the path is complete, partial or missing.

ClearCorners

public void ClearCorners()
Empties the path.

Kaskade

NavMeshPathStatus

public enum NavMeshPathStatus
Status of a NavMesh path calculation.

PathComplete

PathComplete = 0
The path reaches the destination.

PathInvalid

PathInvalid = 2
No path was found.

PathPartial

PathPartial = 1
The path ends as close to the destination as the navmesh allows.

Kaskade

Network

public static class Network
Multiplayer, made simple. Host or join (Network.Host, Network.Connect, or the console's host / connect ip); every game moves its own player, the others appear as avatars (the PlayerController's Network Avatar prefab, or a box figure), and the host's physics is shared on its own. Handlers on a behaviour stop by themselves when it is destroyed.

IsAuthority

public static bool IsAuthority { get; }
This game decides shared things: the host, or anyone offline.

IsClient

public static bool IsClient { get; }
This game is a host's client.

IsHost

public static bool IsHost { get; }
This game hosts.

IsOnline

public static bool IsOnline { get; }
In a game, hosting or connected.

LocalId

public static int LocalId { get; }
This game's player id (the host is 0; 0 offline).

LocalPlayer

public static NetworkPlayer? LocalPlayer { get; }
This game's player (null offline).

PlayerCount

public static int PlayerCount { get; }
Players in the game, this one included (0 offline).

Players

public static IReadOnlyList<NetworkPlayer> Players { get; }
Everyone in the game, this game's player included (empty offline).

Role

public static NetworkRole Role { get; }
What this game is now: offline, host or client.

Connected

public static Action? Connected
This game is in a game now (hosting, or the host took it in).

Disconnected

public static Action? Disconnected
This game left the game, or the game ended.

PlayerJoined

public static Action<NetworkPlayer>? PlayerJoined
Someone else came in.

PlayerLeft

public static Action<NetworkPlayer>? PlayerLeft
Someone else left.

Connect

public static void Connect(string address)
Joins a hosted game ("192.168.1.5", "host:27015").

Disconnect

public static void Disconnect()
Leaves the game (a host ends it for everyone).

Get

public static T Get<T>(string key, T fallback = default(T))
A shared value, or fallback if nobody set it (or it does not fit).

GetPlayer

public static NetworkPlayer? GetPlayer(int id)
The player with id id, or null.

GetState

public static string? GetState(string key)
A shared value as text, or null (see Network.Get).

Has

public static bool Has(string key)
Whether anyone set key.

Host

public static void Host(int port = 27015)
Hosts a game on the current level.

IsLocalPlayer

public static bool IsLocalPlayer(int index)
Whether the index-th player is this game's.

IsTaken

public static bool IsTaken(GameObject gameObject)
Whether another player has this body right now (carrying it): leave it to them.

KeyOf

public static string KeyOf(GameObject gameObject)
A name for the object that is the same in every game: its parents' names and where it stands. Take it in Awake, while the object is where the level put it.

Off

public static void Off(string type)
Stops every handler of type.

Off

public static void Off(string type, Delegate handler)
Stops calling handler.

On

public static void On(string type, Action<NetworkMessage> handler)
Calls handler for every type message.

On

public static void On<T>(string type, Action<T?, NetworkPlayer?> handler)
Calls handler with the data of every type message and its sender.

On

public static void On<T>(string type, Action<T?> handler)
Calls handler with the data of every type message.

PlayerId

public static int PlayerId(int index)
The index-th player's id (see Network.Players).

PlayerName

public static string PlayerName(int index)
The index-th player's name (see Network.Players).

PlayerObject

public static GameObject? PlayerObject(int index)
The object that stands for the index-th player (see NetworkPlayer.gameObject).

PlayerPing

public static int PlayerPing(int index)
Round trip to the index-th player in milliseconds.

Send

public static void Send(string type, object? data = null, NetworkTarget to = NetworkTarget.Others, bool reliable = true)
Sends type with data (anything JSON can carry: a number, a string, a record, an anonymous object, a Vector3) to to. Reliable messages arrive once each, in time; unreliable ones are for what is sent all the time anyway. At most about 1 KB of data.

SendTo

public static void SendTo(NetworkPlayer player, string type, object? data = null, bool reliable = true)
Sends type to one player.

SendTo

public static void SendTo(int playerId, string type, object? data = null, bool reliable = true)
Sends type to one player.

Set

public static void Set<T>(string key, T value)
Sets a shared value here and for everyone (late joiners get it too).

SetState

public static void SetState(string key, string value)
Sets a shared value as text (see Network.Set).

Unwatch

public static void Unwatch(string key, Delegate handler)
Stops calling handler for key.

Watch

public static void Watch<T>(string key, Action<T?> handler)
Calls handler whenever key's value changes (whoever changed it), and once now if it is set.

Kaskade

NetworkMessage

public readonly readonly struct NetworkMessage
A message another player (or this game) sent with Network.Send.

NetworkMessage

public NetworkMessage()
Creates a default instance of NetworkMessage.

From

public int From { get; }
The sender's player id.

Json

public string Json { get; }
The data as sent, as JSON.

Sender

public NetworkPlayer? Sender { get; }
The sender (null if they left meanwhile).

Type

public string Type { get; }
What it is (the name it was sent with).

Read

public T? Read<T>()
The data as T (default if there is none or it does not fit).

Kaskade

NetworkPlayer

public sealed record NetworkPlayer

Implements IEquatable<NetworkPlayer>

Someone in the game.
Id Their id (the host is 0); stays theirs for the session.
Name Their name (the console's name).
Ping Round trip to them in milliseconds, as the host measures it.
IsLocal This game's own player.

NetworkPlayer

public NetworkPlayer(int Id, string Name, int Ping, bool IsLocal)
Someone in the game.
Id Their id (the host is 0); stays theirs for the session.
Name Their name (the console's name).
Ping Round trip to them in milliseconds, as the host measures it.
IsLocal This game's own player.

Id

public int Id { get; init; }
Their id (the host is 0); stays theirs for the session.

IsHost

public bool IsHost { get; }
They host the game.

IsLocal

public bool IsLocal { get; init; }
This game's own player.

Name

public string Name { get; init; }
Their name (the console's name).

Ping

public int Ping { get; init; }
Round trip to them in milliseconds, as the host measures it.

gameObject

public GameObject? gameObject { get; }
The object that stands for them here: this game's own player object for itself, their avatar for the others (null until it is spawned).

Deconstruct

public void Deconstruct(out int Id, out string Name, out int Ping, out bool IsLocal)
Copies the positional values into the output parameters.

Equals

public bool Equals(NetworkPlayer? other)
Checks equality using the record's data.

Equals

public override bool Equals(object? obj)
Checks equality using the record's data.

GetHashCode

public override int GetHashCode()
Returns a hash of the record's data.

ToString

public override string ToString()
Overrides string? object.ToString().

operator ==

public static bool operator ==(NetworkPlayer? left, NetworkPlayer? right)
Checks equality using the record's data.

operator !=

public static bool operator !=(NetworkPlayer? left, NetworkPlayer? right)
Checks whether the records differ.

Kaskade

NetworkRole

public enum NetworkRole
What this game is in multiplayer.

Client

Client = 2
Connected to a host.

Host

Host = 1
Hosting the game (others connect to it).

Offline

Offline = 0
Not in a game.

Kaskade

NetworkTarget

public enum NetworkTarget
Who a Network.Send message is for.

All

All = -1
Everyone, this game too.

Host

Host = -3
The host only.

Others

Others = -2
Everyone but this game.

Kaskade

Object

public abstract class Object
Base class of everything that lives in the engine: GameObject and Component. As in Unity, a destroyed object compares equal to null (if (target == null), if (target)), and Object.Destroy, Object.Instantiate and the Find functions are available everywhere.

name

public abstract string name { get; set; }
Gets or sets the object's name (for a component: its game object's name).

Destroy

public static void Destroy(Object obj, double delay = 0)
Destroys a game object (with its children and components) or removes a component, after delay seconds. The object goes at the end of the frame.

DestroyImmediate

public static void DestroyImmediate(Object obj)
Same as Object.Destroy (the engine never destroys mid-frame).

DontDestroyOnLoad

public static void DontDestroyOnLoad(Object target)
Keeps the object's root alive when another scene is loaded.

Equals

public override bool Equals(object? obj)
Overrides bool object.Equals(object? obj).

FindAnyObjectByType

public static T? FindAnyObjectByType<T>() where T : class
Unity's FindAnyObjectByType.

FindFirstObjectByType

public static T? FindFirstObjectByType<T>() where T : class
Unity's name for Object.FindObjectOfType.

FindFirstObjectByType

public static T? FindFirstObjectByType<T>(FindObjectsInactive inactive) where T : class
Unity's FindFirstObjectByType.

FindObjectOfType

public static T? FindObjectOfType<T>() where T : class
The first object with a component of type T, or null.

FindObjectsByType

public static T[] FindObjectsByType<T>(FindObjectsInactive inactive, FindObjectsSortMode sortMode) where T : class
Unity's FindObjectsByType (sorting ignored).

FindObjectsByType

public static T[] FindObjectsByType<T>(FindObjectsSortMode sortMode) where T : class
Unity's FindObjectsByType (sorting ignored).

FindObjectsOfType

public static T[] FindObjectsOfType<T>() where T : class
Every object with a component of type T (C# behaviours or engine components).

GetHashCode

public override int GetHashCode()
Overrides int object.GetHashCode().

GetInstanceID

public abstract int GetInstanceID()
A number unique to this object while it exists.

Instantiate

public static GameObject Instantiate(GameObject original)
A copy of original: an object made from a prefab, or a copy of an object of the scene with its children (as they were authored, at the original's current place). The copy is returned at once and can be used in the same frame.

Instantiate

public static GameObject Instantiate(GameObject original, Transform? parent, bool instantiateInWorldSpace = false)
A copy of original made a child of parent.

Instantiate

public static GameObject Instantiate(GameObject original, Vector3 position, Quaternion rotation)
A copy of original at a world position and rotation.

Instantiate

public static GameObject Instantiate(GameObject original, Vector3 position, Quaternion rotation, Transform? parent)
A copy of original at a world position and rotation, under parent.

Instantiate

public static T Instantiate<T>(T original) where T : Component
A copy of the game object of original; returns the copy's matching component.

Instantiate

public static T Instantiate<T>(T original, Vector3 position, Quaternion rotation) where T : Component
A copy of the game object of original at a place; returns the copy's matching component.

ToString

public override string ToString()
Overrides string? object.ToString().

operator ==

public static bool operator ==(Object? left, Object? right)
Equal when both are the same engine object, or both are null or destroyed.

implicit operator bool

public static implicit operator bool(Object? value)
True when value exists (is not null and not destroyed).

operator !=

public static bool operator !=(Object? left, Object? right)
The opposite of Object.operator ==.

Kaskade

Physics

public static class Physics
Physics queries against the colliders of the scene (Box3D) and global settings.

AllLayers

public const int AllLayers = -1
The layer mask that includes every layer (the default of the queries).

MaxDistance

public const double MaxDistance = 100000
The longest distance the queries reach.

gravity

public static Vector3 gravity { get; }
Gets the gravity acceleration in metres per second squared.

BoxCast

public static bool BoxCast(Vector3 center, Vector3 halfExtents, Vector3 direction, out RaycastHit hitInfo, Quaternion? orientation = null, double maxDistance = double.PositiveInfinity, int layerMask = -1)
Sweeps a box along a direction; whether it hits something.

CapsuleCast

public static bool CapsuleCast(Vector3 point1, Vector3 point2, double radius, Vector3 direction, out RaycastHit hitInfo, double maxDistance = double.PositiveInfinity, int layerMask = -1)
Sweeps a capsule (between the centres of its end spheres) along a direction.

CheckBox

public static bool CheckBox(Vector3 center, Vector3 halfExtents, Quaternion? orientation = null, int layerMask = -1)
Whether any collider touches a box.

CheckSphere

public static bool CheckSphere(Vector3 position, double radius, int layerMask = -1)
Whether any collider touches a sphere.

Linecast

public static bool Linecast(Vector3 start, Vector3 end, out RaycastHit hitInfo, int layerMask = -1)
Whether the line from start to end crosses a collider.

Linecast

public static bool Linecast(Vector3 start, Vector3 end, int layerMask = -1)
Whether the line from start to end crosses a collider.

OverlapBox

public static Collider[] OverlapBox(Vector3 center, Vector3 halfExtents, Quaternion? orientation = null, int layerMask = -1)
The colliders touching or inside a box.

OverlapSphere

public static Collider[] OverlapSphere(Vector3 position, double radius, int layerMask = -1)
The colliders touching or inside a sphere.

Raycast

public static bool Raycast(Ray ray, out RaycastHit hitInfo, double maxDistance = double.PositiveInfinity, int layerMask = -1)
Whether ray hits a collider; the nearest hit in hitInfo.

Raycast

public static bool Raycast(Ray ray, double maxDistance = double.PositiveInfinity, int layerMask = -1)
Whether ray hits a collider.

Raycast

public static bool Raycast(Vector3 origin, Vector3 direction, out RaycastHit hitInfo, double maxDistance = double.PositiveInfinity, int layerMask = -1)
Whether a ray hits a collider; the nearest hit in hitInfo.

Raycast

public static bool Raycast(Vector3 origin, Vector3 direction, double maxDistance = double.PositiveInfinity, int layerMask = -1)
Whether a ray hits a collider.

RaycastAll

public static RaycastHit[] RaycastAll(Ray ray, double maxDistance = double.PositiveInfinity, int layerMask = -1)
Every collider ray hits, nearest first.

RaycastAll

public static RaycastHit[] RaycastAll(Vector3 origin, Vector3 direction, double maxDistance = double.PositiveInfinity, int layerMask = -1)
Every collider a ray hits, nearest first.

RaycastNonAlloc

public static int RaycastNonAlloc(Vector3 origin, Vector3 direction, RaycastHit[] results, double maxDistance = double.PositiveInfinity, int layerMask = -1)
The ray's hits into results; their count.

SphereCast

public static bool SphereCast(Vector3 origin, double radius, Vector3 direction, out RaycastHit hitInfo, double maxDistance = double.PositiveInfinity, int layerMask = -1)
Sweeps a sphere along a direction; whether it hits something.

SphereCastAll

public static RaycastHit[] SphereCastAll(Vector3 origin, double radius, Vector3 direction, double maxDistance = double.PositiveInfinity, int layerMask = -1)
The sphere sweep's hits (the nearest only).

SyncTransforms

public static void SyncTransforms()
Transforms reach the physics at the step (nothing to flush).

Kaskade

PlayState

public enum PlayState
Whether a PlayableDirector is playing (Unity's PlayState).

Paused

Paused = 0
Stopped, paused, or finished.

Playing

Playing = 1
Advancing with time.

Kaskade

PlayableDirector

public sealed class PlayableDirector

Inherits EngineComponent

Plays the object's timeline ([object.director], a .ktimeline), as Unity's PlayableDirector. Commands take effect on the director's next update.

duration

public double duration { get; }
The timeline's length (seconds).

isFinished

public bool isFinished { get; }
Has reached the end of the timeline (and holds its last frame).

speed

public double speed { set; }
Sets the playback speed (1: normal).

state

public PlayState state { get; }
Playing or paused.

time

public double time { get; set; }
Gets or sets the time on the timeline (seconds); setting it samples that time.

Pause

public void Pause()
Stops where it is.

Play

public void Play()
Plays from where it is (from the start once it has finished).

SignalPassed

public bool SignalPassed(string name)
Whether the signal name was passed during the last update.

Stop

public void Stop()
Stops and goes back to the start.

Kaskade

PlayerController

public sealed class PlayerController

Inherits EngineComponent

The Source player controller ([object.player_controller]): moves its object (the feet) with collisions, steps, crouching and jumping, from the keys and mouse, and carries the child camera at the eye. State is as of its last step; changes take effect on its next one.

cameraOffset

public Vector3 cameraOffset { get; set; }
Gets or sets what is added to the camera's place above the feet (metres, in the body's yaw frame: x left, z back as KasKade's axes), as a script puts the camera at a model's head.

customNetworkAvatar

public bool customNetworkAvatar { get; set; }
Gets or sets whether other players are drawn with PlayerController.networkAvatar instead of the default box figure.

eyeHeight

public float eyeHeight { get; }
The eye above the feet (metres).

footstepVolume

public float footstepVolume { get; set; }
Gets or sets the loudness of the steps (1: as recorded; 0 to 4).

footsteps

public bool footsteps { get; set; }
Gets or sets whether the player's footsteps, jumps and landings make sounds (clips from Assets/Audio/Footsteps).

isCrouched

public bool isCrouched { get; }
Fully crouched.

isCrouching

public bool isCrouching { get; }
Crouched or on the way: the crouch key is doing something.

isDucking

public bool isDucking { get; }
Crouching down or standing up.

isGrounded

public bool isGrounded { get; }
Standing on the ground.

isSprinting

public bool isSprinting { get; }
Moving with the sprint key held.

jumpImpulse

public float jumpImpulse { get; set; }
Gets or sets the jump's upward speed (Source units per second).

lookInput

public bool lookInput { get; set; }
Gets or sets whether the mouse turns the view.

mouseSensitivity

public float mouseSensitivity { get; set; }
Gets or sets the mouse sensitivity (Source's sensitivity).

moveInput

public Vector2 moveInput { get; }
The movement keys held: x right, y forward (-1..1).

movementInput

public bool movementInput { get; set; }
Gets or sets whether the movement keys move it; off, it still falls and collides.

networkAvatar

public string networkAvatar { get; set; }
Gets or sets the prefab (.kprefab, project relative) other players are drawn with when PlayerController.customNetworkAvatar is on: its origin at their feet, turned the way they face.

pitch

public float pitch { get; }
The look pitch (degrees, up positive).

sprintSpeed

public float sprintSpeed { get; set; }
Gets or sets the sprinting speed (Source units per second).

velocity

public Vector3 velocity { get; }
The body's velocity (metres per second, world space).

walkSpeed

public float walkSpeed { get; set; }
Gets or sets the walking speed (Source units per second; 39.37 a metre).

yaw

public float yaw { get; }
The look yaw (degrees).

Push

public void Push(Vector3 velocity)
Adds velocity (metres per second) on the next step, as a pusher does (an upward push lifts it off the ground).

SetFootstepSounds

public void SetFootstepSounds(string surface, params AudioClip[] clips)
Sets the step sounds of a surface: "Default", "Concrete", "Wood", "Metal", "Grass", "Gravel", "Dirt", "Tile", "Water", any word of a collider's name, or "Jump" / "Land". One is picked at random each step; no clips clears the surface (the project's Footsteps folders play again).

SetLook

public void SetLook(float pitch, float yaw)
Turns the view to pitch and yaw (degrees).

Teleport

public void Teleport(Vector3 position, Quaternion rotation)
Moves it to position (the feet) facing rotation, dropping its speed.

Kaskade

PlayerPrefs

public static class PlayerPrefs
Small values the game keeps between runs (unlocked levels, volume, the last save slot), by key, as Unity's PlayerPrefs. Changes reach the disk about once a second and when the game ends; PlayerPrefs.Save writes at once.

DeleteAll

public static void DeleteAll()
Removes every value.

DeleteKey

public static void DeleteKey(string key)
Removes the value at key.

GetFloat

public static float GetFloat(string key, float defaultValue = 0)
The float at key, or defaultValue.

GetInt

public static int GetInt(string key, int defaultValue = 0)
The int at key, or defaultValue.

GetString

public static string GetString(string key, string defaultValue = "")
The string at key, or defaultValue.

HasKey

public static bool HasKey(string key)
Whether a value is stored at key.

Save

public static void Save()
Writes the prefs to disk now.

SetFloat

public static void SetFloat(string key, float value)
Stores a float at key.

SetInt

public static void SetInt(string key, int value)
Stores an int at key.

SetString

public static void SetString(string key, string value)
Stores a string at key.

Kaskade

Quaternion

public readonly readonly struct Quaternion

Implements IEquatable<Quaternion>

A double-precision rotation (unit quaternion).
X X component.
Y Y component.
Z Z component.
W W component.

Quaternion

public Quaternion()
Creates a default instance of Quaternion.

Quaternion

public Quaternion(double X, double Y, double Z, double W)
A double-precision rotation (unit quaternion).
X X component.
Y Y component.
Z Z component.
W W component.

Identity

public static Quaternion Identity { get; }
Gets the rotation that changes nothing.

W

public double W { get; init; }
W component.

X

public double X { get; init; }
X component.

Y

public double Y { get; init; }
Y component.

Z

public double Z { get; init; }
Z component.

eulerAngles

public Vector3 eulerAngles { get; }
Gets the Euler angles in degrees (X, Y, Z, each -180..180), as the Inspector shows them.

identity

public static Quaternion identity { get; }
Gets the rotation that changes nothing (Unity name of Quaternion.Identity).

normalized

public Quaternion normalized { get; }
Gets the rotation scaled to length 1 (identity for a zero quaternion).

w

public double w { get; }
Gets the W component (Unity naming).

x

public double x { get; }
Gets the X component (Unity naming).

y

public double y { get; }
Gets the Y component (Unity naming).

z

public double z { get; }
Gets the Z component (Unity naming).

Angle

public static double Angle(Quaternion a, Quaternion b)
The angle in degrees between two rotations.

AngleAxis

public static Quaternion AngleAxis(double angleDegrees, Vector3 axis)
The rotation of angleDegrees about axis.

Deconstruct

public void Deconstruct(out double X, out double Y, out double Z, out double W)
Copies the positional values into the output parameters.

Dot

public static double Dot(Quaternion a, Quaternion b)
The dot product of two rotations (1 or -1 when they are the same).

Equals

public bool Equals(Quaternion other)
Checks equality using the record's data.

Equals

public override bool Equals(object obj)
Checks equality using the record's data.

Euler

public static Quaternion Euler(Vector3 euler)
The rotation by Euler angles in degrees, given as a vector.

Euler

public static Quaternion Euler(double x, double y, double z)
The rotation by Euler angles in degrees, composed as the Inspector and scene files do (X * Y * Z): x about X, y about Y, z about Z. Quaternion.eulerAngles gives the angles back.

FromToRotation

public static Quaternion FromToRotation(Vector3 from, Vector3 to)
The rotation that turns direction from to to.

GetHashCode

public override int GetHashCode()
Returns a hash of the record's data.

Inverse

public Quaternion Inverse()
The rotation that undoes this one.

Inverse

public static Quaternion Inverse(Quaternion rotation)
The rotation that undoes rotation.

Lerp

public static Quaternion Lerp(Quaternion a, Quaternion b, double t)
Normalized linear interpolation (faster than Quaternion.Slerp, t clamped to 0..1).

LookRotation

public static Quaternion LookRotation(Vector3 forward, Vector3? up = null)
The rotation that turns Kaskade's forward (-Z) to forward, keeping up (default world up) as upright as possible.

RotateTowards

public static Quaternion RotateTowards(Quaternion from, Quaternion to, double maxDegreesDelta)
Rotates from towards to by at most maxDegreesDelta.

Slerp

public static Quaternion Slerp(Quaternion a, Quaternion b, double t)
Spherical interpolation from a to b (t clamped to 0..1).

ToAngleAxis

public void ToAngleAxis(out double angle, out Vector3 axis)
The angle in degrees and the axis of the rotation.

ToString

public override string ToString()
"(x, y, z, w)". Written out: the record's own ToString prints every property, and Quaternion.normalized (a quaternion) would print its own forever.

operator ==

public static bool operator ==(Quaternion left, Quaternion right)
Checks equality using the record's data.

operator !=

public static bool operator !=(Quaternion left, Quaternion right)
Checks whether the records differ.

operator *

public static Quaternion operator *(Quaternion a, Quaternion b)
The combined rotation: a * b rotates by b first, then by a.

operator *

public static Vector3 operator *(Quaternion rotation, Vector3 point)
The point (or direction) rotated by rotation.

Kaskade

Random

public static class Random
Random numbers in Unity's names.

insideUnitCircle

public static Vector2 insideUnitCircle { get; }
Gets a random point inside a circle of radius 1.

insideUnitSphere

public static Vector3 insideUnitSphere { get; }
Gets a random point inside a sphere of radius 1.

onUnitSphere

public static Vector3 onUnitSphere { get; }
Gets a random point on a sphere of radius 1.

rotation

public static Quaternion rotation { get; }
Gets a random rotation.

value

public static float value { get; }
Gets a number in 0..1 (both included).

ColorHSV

public static Color ColorHSV(float hueMin = 0, float hueMax = 1, float saturationMin = 0, float saturationMax = 1, float valueMin = 0, float valueMax = 1)
A random colour (hue, saturation and value in the given ranges).

InitState

public static void InitState(int seed)
Restarts the sequence from seed.

Range

public static double Range(double minInclusive, double maxInclusive)
A number in min..max (both included).

Range

public static int Range(int minInclusive, int maxExclusive)
An integer from minInclusive up to (not including) maxExclusive.

Range

public static float Range(float minInclusive, float maxInclusive)
A number in min..max (both included).

Kaskade

RangeAttribute

public sealed class RangeAttribute

Inherits Attribute

Shows a numeric field as a slider between min and max.

RangeAttribute

public RangeAttribute(double min, double max)
Shows a numeric field as a slider between min and max.

Max

public double Max { get; }
Gets the slider maximum.

Min

public double Min { get; }
Gets the slider minimum.

Kaskade

Ray

public readonly readonly struct Ray

Implements IEquatable<Ray>

A half-line in world space: where it starts and the unit direction it goes in.
Origin Start point.
Direction Unit direction.

Ray

public Ray()
Creates a default instance of Ray.

Ray

public Ray(Vector3 Origin, Vector3 Direction)
A half-line in world space: where it starts and the unit direction it goes in.
Origin Start point.
Direction Unit direction.

Direction

public Vector3 Direction { get; init; }
Unit direction.

Origin

public Vector3 Origin { get; init; }
Start point.

direction

public Vector3 direction { get; }
Gets the direction (Unity name).

origin

public Vector3 origin { get; }
Gets the start point (Unity name).

Deconstruct

public void Deconstruct(out Vector3 Origin, out Vector3 Direction)
Copies the positional values into the output parameters.

Equals

public bool Equals(Ray other)
Checks equality using the record's data.

Equals

public override bool Equals(object obj)
Checks equality using the record's data.

GetHashCode

public override int GetHashCode()
Returns a hash of the record's data.

GetPoint

public Vector3 GetPoint(double distance)
The point distance metres along the ray.

ToString

public override string ToString()
Returns a string representation of the record.

operator ==

public static bool operator ==(Ray left, Ray right)
Checks equality using the record's data.

operator !=

public static bool operator !=(Ray left, Ray right)
Checks whether the records differ.

Kaskade

RaycastHit

public readonly readonly struct RaycastHit
What a ray or sweep struck: the object, the point, the surface normal there and how far away.

RaycastHit

public RaycastHit()
Creates a default instance of RaycastHit.

collider

public Collider? collider { get; }
Gets the collider hit.

distance

public double distance { get; }
Gets the distance from the ray's origin to RaycastHit.point (metres).

gameObject

public GameObject gameObject { get; }
Gets the object whose collider was hit.

normal

public Vector3 normal { get; }
Gets the surface normal at RaycastHit.point.

point

public Vector3 point { get; }
Gets where the ray met the collider (world space).

rigidbody

public Rigidbody? rigidbody { get; }
Gets the rigidbody of the collider hit (on the object or a parent), or null.

transform

public Transform transform { get; }
Gets the transform of the object hit.

Kaskade

Rect

public struct Rect
A 2D rectangle defined by X, Y, Width, and Height.

Rect

public Rect()
Creates a default instance of Rect.

Rect

public Rect(Rect source)
A rectangle from its top-left corner and size.

Rect

public Rect(Vector2 position, Vector2 size)
A rectangle from its top-left corner and size.

Rect

public Rect(double x, double y, double width, double height)
A rectangle from its top-left corner and size (scripts' doubles).

Rect

public Rect(float x, float y, float width, float height)
A rectangle from its top-left corner and size.

height

public float height
Height.

width

public float width
Width.

x

public float x
Left edge.

y

public float y
Top edge.

Height

public float Height { get; set; }
Height.

Width

public float Width { get; set; }
Width.

X

public float X { get; set; }
Left edge.

Y

public float Y { get; set; }
Top edge.

center

public Vector2 center { get; set; }
Centre point.

max

public Vector2 max { get; set; }
Bottom-right corner (xMax, yMax).

min

public Vector2 min { get; set; }
Top-left corner (xMin, yMin).

position

public Vector2 position { get; set; }
Top-left corner.

size

public Vector2 size { get; set; }
Width and height.

xMax

public float xMax { get; set; }
Right edge.

xMin

public float xMin { get; set; }
Left edge (moving it keeps the right edge).

yMax

public float yMax { get; set; }
Bottom edge.

yMin

public float yMin { get; set; }
Top edge (moving it keeps the bottom edge).

zero

public static Rect zero { get; }
The empty rectangle at the origin.

Contains

public bool Contains(Vector2 point)
Whether a point lies inside (right and bottom edges excluded).

Equals

public override bool Equals(object? obj)
Overrides bool ValueType.Equals(object? obj).

GetHashCode

public override int GetHashCode()
Overrides int ValueType.GetHashCode().

Overlaps

public bool Overlaps(Rect other)
Whether two rectangles intersect.

Set

public void Set(float newX, float newY, float newWidth, float newHeight)
Sets position and size at once.

ToString

public override string ToString()
Overrides string? ValueType.ToString().

operator ==

public static bool operator ==(Rect lhs, Rect rhs)
Whether position and size are equal.

operator !=

public static bool operator !=(Rect lhs, Rect rhs)
Whether position or size differ.

Kaskade

RenderTexture

public class RenderTexture

Inherits Texture

A texture the GPU draws into (Unity's RenderTexture): a camera's target, a compute shader's output (RenderTexture.enableRandomWrite), what materials read by name.

RenderTexture

public RenderTexture(int width, int height, int depth = 0, RenderTextureFormat format = RenderTextureFormat.Default)
A render texture (made on RenderTexture.Create or first use).

RenderTexture

public RenderTexture(string name, int width, int height, RenderTextureFormat format = RenderTextureFormat.Default)
A render texture with a name (a scene's camera target of that name, or new).

enableRandomWrite

public bool enableRandomWrite { get; set; }
Whether compute shaders write it (set before RenderTexture.Create).

format

public RenderTextureFormat format { get; }
The pixel format.

height

public int height { get; }
Height in pixels.

name

public string name { get; }
Its name (shaders read it as rt:<name>).

width

public int width { get; }
Width in pixels.

IsCreated

public bool IsCreated()
Whether it was made.

Release

public void Release()
Frees it on the GPU.

Kaskade

RenderTextureFormat

public enum RenderTextureFormat
A render texture's pixels (Unity's RenderTextureFormat).

ARGB32

ARGB32 = 0
8 bits per channel.

ARGBFloat

ARGBFloat = 2
32-bit float channels.

ARGBHalf

ARGBHalf = 1
16-bit float channels.

Default

Default = 6
The default (8 bits).

DefaultHDR

DefaultHDR = 5
The HDR default (16-bit floats).

RFloat

RFloat = 3
One 32-bit float.

RGHalf

RGHalf = 4
Two 16-bit floats.

Kaskade

Resources

public static class Resources
Assets by path (Unity's Resources): under Assets/Resources, then the project.

Load

public static T? Load<T>(string path) where T : class
A compute shader, shader or texture at path (without its extension, as Unity's, under Assets/Resources; or a project-relative file).

Kaskade

Rigidbody

public sealed class Rigidbody

Inherits EngineComponent

Moves the object by Box3D physics: forces, velocities, gravity and collisions.

angularDrag

public double angularDrag { get; set; }
Gets or sets the angular damping.

angularVelocity

public Vector3 angularVelocity { get; set; }
Gets or sets the angular velocity in radians per second.

bodyType

public RigidbodyType bodyType { get; }
Gets how the body moves.

detectCollisions

public bool detectCollisions { get; set; }
Gets or sets whether the body collides at all.

drag

public double drag { get; set; }
Gets or sets the linear damping (Unity: drag).

gravityScale

public double gravityScale { get; set; }
Gets or sets the multiplier of gravity (0: no gravity).

isAwake

public bool isAwake { get; set; }
Gets or sets whether the body simulates (false: asleep until something wakes it).

isKinematic

public bool isKinematic { get; set; }
Gets or sets whether the body is moved only by scripts.

linearDamping

public double linearDamping { get; set; }
Unity 6's name of Rigidbody.drag.

linearVelocity

public Vector3 linearVelocity { get; set; }
Unity 6's name of Rigidbody.velocity.

mass

public float mass { get; set; }
Gets or sets the mass in kilograms.

position

public Vector3 position { get; set; }
Gets or sets the body's position (the object's world position).

rotation

public Quaternion rotation { get; set; }
Gets or sets the body's rotation (the object's world rotation).

useGravity

public bool useGravity { get; set; }
Gets or sets whether gravity pulls the body.

velocity

public Vector3 velocity { get; set; }
Gets or sets the velocity in metres per second.

AddExplosionForce

public void AddExplosionForce(double explosionForce, Vector3 explosionPosition, double explosionRadius, double upwardsModifier = 0, ForceMode mode = ForceMode.Force)
Pushes the body away from explosionPosition, weaker with distance up to explosionRadius.

AddForce

public void AddForce(Vector3 force, ForceMode mode = ForceMode.Force)
Applies a force (world space) through the centre of mass.

AddForce

public void AddForce(double x, double y, double z, ForceMode mode = ForceMode.Force)
Applies a force (x, y, z) in world space.

AddForceAtPosition

public void AddForceAtPosition(Vector3 force, Vector3 position, ForceMode mode = ForceMode.Force)
Applies a force at a world position (also turns the body).

AddRelativeForce

public void AddRelativeForce(Vector3 force, ForceMode mode = ForceMode.Force)
Applies a force along the body's own axes.

AddRelativeTorque

public void AddRelativeTorque(Vector3 torque, ForceMode mode = ForceMode.Force)
Applies a torque about the body's own axes.

AddTorque

public void AddTorque(Vector3 torque, ForceMode mode = ForceMode.Force)
Applies a torque (world space).

GetPointVelocity

public Vector3 GetPointVelocity(Vector3 worldPoint)
The velocity of the body at a world point (linear plus rotation).

IsSleeping

public bool IsSleeping()
Whether the body is asleep.

Move

public void Move(Vector3 position, Quaternion rotation, float timeStep = 0.016666668)
Moves and turns the body over the next physics step.

MovePosition

public void MovePosition(Vector3 position, float timeStep = 0.016666668)
Moves the body to position over the next physics step (keeps its rotation).

MoveRotation

public void MoveRotation(Quaternion rotation, float timeStep = 0.016666668)
Turns the body to rotation over the next physics step.

Sleep

public void Sleep()
Puts the body to sleep.

WakeUp

public void WakeUp()
Wakes the body up.

Kaskade

RigidbodyType

public enum RigidbodyType
How a rigidbody moves.

Dynamic

Dynamic = 0
Moved by forces, gravity and collisions.

Kinematic

Kinematic = 1
Moved only by scripts (MovePosition); pushes dynamic bodies.

Static

Static = 2
Never moves.

Kaskade

ScaleMode

public enum ScaleMode
Unity-compatible scale mode values. The current GUI.DrawTexture overload ignores this setting.

ScaleAndCrop

ScaleAndCrop = 1
Preserves aspect ratio, fills the destination and crops excess.

ScaleToFit

ScaleToFit = 2
Preserves aspect ratio and fits the source inside the destination.

StretchToFill

StretchToFill = 0
Stretches the source to the destination rectangle.

Kaskade

Scene

public readonly readonly struct Scene
A scene: the objects loaded from a scene file.

Scene

public Scene()
Creates a default instance of Scene.

isLoaded

public bool isLoaded { get; }
Gets whether the scene is loaded.

name

public string name { get; }
Gets the scene's name.

rootCount

public int rootCount { get; }
Gets the number of root objects.

GetRootGameObjects

public GameObject[] GetRootGameObjects()
The scene's root objects.

IsValid

public bool IsValid()
Gets whether this refers to a scene at all.

Kaskade

SceneManager

public static class SceneManager
Loads scenes.

GetActiveScene

public static Scene GetActiveScene()
The scene of the running script.

LoadScene

public static void LoadScene(string scenePath)
Loads the scene file at scenePath (project relative, e.g. Scenes/Level2.kscene), replacing this one.

Kaskade

Screen

public static class Screen
The game window.

center

public static Vector2 center { get; }
Gets the centre of the window in pixels (where a first-person player looks).

height

public static int height { get; }
Gets the window height in pixels.

width

public static int width { get; }
Gets the window width in pixels.

Kaskade

SerializeFieldAttribute

public sealed class SerializeFieldAttribute

Inherits Attribute

Exposes a field or property to Kaskade serialization and editor tooling.

SerializeFieldAttribute

public SerializeFieldAttribute()
Creates a default instance of SerializeFieldAttribute.

Kaskade

Shader

public sealed class Shader
A shader file (Unity's Shader): a .shader, .hlsl or .fxc.

path

public string path { get; }
The project-relative file.

Find

public static Shader Find(string path)
The shader at path (a project-relative file).

PropertyToID

public static int PropertyToID(string name)
A number standing for the property name.

SetGlobalColor

public static void SetGlobalColor(string name, Color value)
A colour every shader sees.

SetGlobalFloat

public static void SetGlobalFloat(string name, float value)
A float every custom shader and compute kernel sees.

SetGlobalInt

public static void SetGlobalInt(string name, int value)
An int every shader sees.

SetGlobalMatrix

public static void SetGlobalMatrix(string name, Matrix4x4 value)
A matrix every shader sees.

SetGlobalTexture

public static void SetGlobalTexture(string name, Texture value)
A texture every shader sees.

SetGlobalVector

public static void SetGlobalVector(string name, Vector4 value)
A vector every shader sees.

implicit operator bool

public static implicit operator bool(Shader? shader)
Whether there is a shader.

Kaskade

SoftBodies

public static class SoftBodies
Soft bodies ([object.soft_body]: nodes and beams over the object's mesh). Their Rigidbody works as usual (velocity, gravity, forces); this switches the rest.

SetRigid

public static void SetRigid(GameObject gameObject, bool rigid)
Makes the soft body hard (it keeps its shape like a rigid body) or soft again.

Kaskade

Space

public enum Space
Whether a transform operation works in world space or in the object's own (local) space.

Self

Self = 1
The object's own axes.

World

World = 0
World axes.

Kaskade

SpaceAttribute

public sealed class SpaceAttribute

Inherits Attribute

Empty space above the field in the inspector, to set groups of fields apart.
height The gap, in pixels.

SpaceAttribute

public SpaceAttribute(double height = 8)
Empty space above the field in the inspector, to set groups of fields apart.
height The gap, in pixels.

Height

public double Height { get; }
Gets the gap, in pixels.

Kaskade

SphereCollider

public sealed class SphereCollider

Inherits Collider

A sphere collider.

radius

public double radius { get; set; }
Gets or sets the radius in metres.

Kaskade

TextAnchor

public enum TextAnchor
Unity's text anchors (GUIStyle.alignment).

LowerCenter

LowerCenter = 7
Aligns text to the bottom and horizontal center of the rectangle.

LowerLeft

LowerLeft = 6
Aligns text to the bottom and left edge of the rectangle.

LowerRight

LowerRight = 8
Aligns text to the bottom and right edge of the rectangle.

MiddleCenter

MiddleCenter = 4
Aligns text to the vertical middle and horizontal center of the rectangle.

MiddleLeft

MiddleLeft = 3
Aligns text to the vertical middle and left edge of the rectangle.

MiddleRight

MiddleRight = 5
Aligns text to the vertical middle and right edge of the rectangle.

UpperCenter

UpperCenter = 1
Aligns text to the top and horizontal center of the rectangle.

UpperLeft

UpperLeft = 0
Aligns text to the top and left edge of the rectangle.

UpperRight

UpperRight = 2
Aligns text to the top and right edge of the rectangle.

Kaskade

Texture

public class Texture
A texture to give a shader: a file of the project or a render texture.

Texture

public Texture(string path)
A texture file (project-relative).

path

public string path { get; }
The project-relative file, or rt:<name> for a render texture.

implicit operator Texture

public static implicit operator Texture(string path)
A texture by its file.

Kaskade

Texture2D

public class Texture2D

Inherits Texture

A 2D texture file (Unity's Texture2D).

Texture2D

public Texture2D(string path)
A texture file (project-relative).

Kaskade

Time

public static class Time
Game time: the frame's duration, the time since start, the physics step and the time scale.

DeltaTime

public static double DeltaTime { get; }
Earlier name of Time.deltaTime.

deltaTime

public static double deltaTime { get; }
Gets the duration of this frame in seconds (in FixedUpdate: the physics step), scaled by Time.timeScale.

fixedDeltaTime

public static double fixedDeltaTime { get; }
Gets the physics step in seconds.

frameCount

public static long frameCount { get; }
Gets the number of the frame.

realtimeSinceStartup

public static double realtimeSinceStartup { get; }
Gets the real time since the program started, in seconds.

time

public static double time { get; }
Gets the game time since the start, in seconds.

timeScale

public static double timeScale { get; set; }
Gets or sets how fast game time runs (1: normal, 0: paused).

timeSinceLevelLoad

public static double timeSinceLevelLoad { get; }
Gets the game time since the scene loaded, in seconds.

unscaledDeltaTime

public static double unscaledDeltaTime { get; }
Gets the duration of this frame in seconds, not scaled.

Kaskade

TooltipAttribute

public sealed class TooltipAttribute

Inherits Attribute

Text shown when hovering the field in the inspector.

TooltipAttribute

public TooltipAttribute(string text)
Text shown when hovering the field in the inspector.

Text

public string Text { get; }
Gets the tooltip.

Kaskade

Transform

public sealed class Transform

Inherits Component · Implements IEnumerable<Transform>, IEnumerable

An object's place: position, rotation and scale (in world space and relative to its parent), and its place in the hierarchy. Enumerating a transform gives its children.

Changes are applied when the current update phase ends; reading a value this script set in the same frame gives the value set.

childCount

public int childCount { get; }
Gets the number of children.

eulerAngles

public Vector3 eulerAngles { get; set; }
Gets or sets the world rotation as Euler angles in degrees (X, then Y, then Z, as in the Inspector).

forward

public Vector3 forward { get; set; }
Gets or sets the object's forward direction (Kaskade's forward is -Z).

localEulerAngles

public Vector3 localEulerAngles { get; set; }
Gets or sets the local rotation as Euler angles in degrees.

localPosition

public Vector3 localPosition { get; set; }
Gets or sets the position relative to the parent.

localRotation

public Quaternion localRotation { get; set; }
Gets or sets the rotation relative to the parent.

localScale

public Vector3 localScale { get; set; }
Gets or sets the scale relative to the parent.

lossyScale

public Vector3 lossyScale { get; }
Gets the scale in world space (the product of the scales up the hierarchy).

parent

public Transform? parent { get; set; }
Gets or sets the parent (null for a root object); setting keeps the world position.

position

public Vector3 position { get; set; }
Gets or sets the position in world space.

right

public Vector3 right { get; set; }
Gets or sets the object's right direction (+X).

root

public Transform root { get; }
Gets the topmost transform of the hierarchy.

rotation

public Quaternion rotation { get; set; }
Gets or sets the rotation in world space.

up

public Vector3 up { get; set; }
Gets or sets the object's up direction (+Y).

Children

public IEnumerable<Transform> Children()
The children, in order.

DetachChildren

public void DetachChildren()
Makes every child a root object (keeping their world places).

Find

public Transform? Find(string path)
The descendant at path ("Child" or "Child/Grandchild"), or null.

GetChild

public Transform GetChild(int index)
The child at index.

GetEnumerator

public IEnumerator<Transform> GetEnumerator()
Implements IEnumerator<Transform> IEnumerable<Transform>.GetEnumerator().

GetPositionAndRotation

public void GetPositionAndRotation(out Vector3 position, out Quaternion rotation)
Gets world position and rotation together.

InverseTransformDirection

public Vector3 InverseTransformDirection(Vector3 direction)
A direction from world to local space (rotation only).

InverseTransformPoint

public Vector3 InverseTransformPoint(Vector3 point)
A point from world space to this object's local space.

InverseTransformVector

public Vector3 InverseTransformVector(Vector3 vector)
A vector from world to local space (rotation and scale).

IsChildOf

public bool IsChildOf(Transform ancestor)
Whether this transform is ancestor or below it.

LookAt

public void LookAt(Transform target, Vector3? worldUp = null)
Turns the object so its forward points at target.

LookAt

public void LookAt(Vector3 worldPosition, Vector3? worldUp = null)
Turns the object so its forward points at worldPosition.

Rotate

public void Rotate(Vector3 eulers, Space relativeTo = Space.Self)
Rotates by Euler angles in degrees, about the object's own axes by default.

Rotate

public void Rotate(Vector3 axis, double angle, Space relativeTo = Space.Self)
Rotates by angle degrees about axis.

Rotate

public void Rotate(double xAngle, double yAngle, double zAngle, Space relativeTo = Space.Self)
Rotates by Euler angles (x, y, z) in degrees.

RotateAround

public void RotateAround(Vector3 point, Vector3 axis, double angle)
Rotates about the world axis axis through point by angle degrees.

SetParent

public void SetParent(Transform? newParent, bool worldPositionStays = true)
Makes newParent the parent (null: a root object).
newParent The new parent.
worldPositionStays Keep the world position, rotation and scale (else keep the local ones).

SetPosition

public void SetPosition(Vector3 position)
Earlier way to set Transform.position.

SetPositionAndRotation

public void SetPositionAndRotation(Vector3 position, Quaternion rotation)
Sets world position and rotation together.

TransformDirection

public Vector3 TransformDirection(Vector3 direction)
A direction from local to world space (rotation only; length kept).

TransformPoint

public Vector3 TransformPoint(Vector3 point)
A point from this object's local space to world space.

TransformPoint

public Vector3 TransformPoint(double x, double y, double z)
A point (x, y, z) from local to world space.

TransformVector

public Vector3 TransformVector(Vector3 vector)
A vector from local to world space (rotation and scale).

Translate

public void Translate(Vector3 translation, Space relativeTo = Space.Self)
Moves by translation, along the object's own axes by default.

Translate

public void Translate(Vector3 translation, Transform relativeTo)
Moves by translation along the axes of relativeTo.

Translate

public void Translate(double x, double y, double z, Space relativeTo = Space.Self)
Moves by (x, y, z) along the object's own axes.

Kaskade

Ui

public static class Ui
The engine's immediate SDF UI drawn over the game (what Zito's ui unit draws): call during Update or OnGUI each frame. Pixels from the top left of the window.

Alpha

public static void Alpha(double alpha)
Multiplies the alpha of everything drawn after it this frame (0..1).

Clicked

public static bool Clicked(double x, double y, double width, double height)
Whether the mouse went down inside the rectangle this frame.

Font

public static int Font(string path)
A font file (TTF/OTF, project-relative) for Ui.Text; 0 is the default font.

Hovered

public static bool Hovered(double x, double y, double width, double height)
Whether the mouse is over the rectangle.

Rect

public static void Rect(double x, double y, double width, double height, double radius, Color color)
A filled rectangle with rounded corners.

Text

public static Vector2 Text(double x, double y, double size, Color color, string text, int font = 0, Ui.Align align = Align.Left, double wrap = 0)
Text with its top at y; returns its size in pixels.

Kaskade

Ui.Align

public enum Ui.Align

Nested in Ui

Text alignment for Ui.Text.

Center

Center = 1
Centred on x.

Left

Left = 0
From x to the right.

Right

Right = 2
Ending at x.

Kaskade

Vector2

public struct Vector2
Representation of 2D vectors and points.

Vector2

public Vector2()
Creates a default instance of Vector2.

Vector2

public Vector2(double x, double y)
A vector from double components (scripts' math).

Vector2

public Vector2(float x, float y)
A vector from its two components.

x

public float x
Horizontal component.

y

public float y
Vertical component.

Down

public static Vector2 Down { get; }
(0, -1).

Left

public static Vector2 Left { get; }
(-1, 0).

One

public static Vector2 One { get; }
(1, 1).

Right

public static Vector2 Right { get; }
(1, 0).

Up

public static Vector2 Up { get; }
(0, 1).

X

public float X { get; set; }
Horizontal component.

Y

public float Y { get; set; }
Vertical component.

Zero

public static Vector2 Zero { get; }
(0, 0).

down

public static Vector2 down { get; }
(0, -1).

left

public static Vector2 left { get; }
(-1, 0).

magnitude

public readonly double magnitude { get; }
Length.

normalized

public readonly Vector2 normalized { get; }
Unit length (zero stays zero).

one

public static Vector2 one { get; }
(1, 1).

right

public static Vector2 right { get; }
(1, 0).

sqrMagnitude

public readonly double sqrMagnitude { get; }
Squared length.

up

public static Vector2 up { get; }
(0, 1).

zero

public static Vector2 zero { get; }
(0, 0).

Equals

public override bool Equals(object? obj)
Overrides bool ValueType.Equals(object? obj).

GetHashCode

public override int GetHashCode()
Overrides int ValueType.GetHashCode().

ToString

public override string ToString()
Overrides string? ValueType.ToString().

operator +

public static Vector2 operator +(Vector2 a, Vector2 b)
Component-wise sum.

operator /

public static Vector2 operator /(Vector2 a, double d)
Divided.

operator /

public static Vector2 operator /(Vector2 a, float d)
The vector divided by a number.

operator ==

public static bool operator ==(Vector2 a, Vector2 b)
Whether both components are equal.

operator !=

public static bool operator !=(Vector2 a, Vector2 b)
Whether a component differs.

operator *

public static Vector2 operator *(Vector2 a, double d)
Scaled.

operator *

public static Vector2 operator *(Vector2 a, float d)
The vector scaled by a number.

operator *

public static Vector2 operator *(double d, Vector2 a)
Scaled.

operator -

public static Vector2 operator -(Vector2 a, Vector2 b)
Component-wise difference.

Kaskade

Vector3

public readonly readonly struct Vector3

Implements IEquatable<Vector3>

A double-precision three-dimensional vector: positions, directions and scales in world space.
X Horizontal component.
Y Vertical component.
Z Depth component.

Vector3

public Vector3()
Creates a default instance of Vector3.

Vector3

public Vector3(double X, double Y, double Z)
A double-precision three-dimensional vector: positions, directions and scales in world space.
X Horizontal component.
Y Vertical component.
Z Depth component.

Back

public static Vector3 Back { get; }
Gets the backward direction (0, 0, 1).

Down

public static Vector3 Down { get; }
Gets the down direction (0, -1, 0).

Forward

public static Vector3 Forward { get; }
Gets Kaskade's forward direction (0, 0, -1).

Left

public static Vector3 Left { get; }
Gets the left direction (-1, 0, 0).

Length

public double Length { get; }
Gets the length of the vector.

One

public static Vector3 One { get; }
Gets the vector (1, 1, 1).

Right

public static Vector3 Right { get; }
Gets Kaskade's right direction (1, 0, 0).

Up

public static Vector3 Up { get; }
Gets Kaskade's up direction (0, 1, 0).

X

public double X { get; init; }
Horizontal component.

Y

public double Y { get; init; }
Vertical component.

Z

public double Z { get; init; }
Depth component.

Zero

public static Vector3 Zero { get; }
Gets the vector (0, 0, 0).

back

public static Vector3 back { get; }
Gets (0, 0, 1).

down

public static Vector3 down { get; }
Gets (0, -1, 0).

forward

public static Vector3 forward { get; }
Gets Kaskade's forward (0, 0, -1).

left

public static Vector3 left { get; }
Gets (-1, 0, 0).

magnitude

public double magnitude { get; }
Gets the length of the vector (Unity name of Vector3.Length).

negativeInfinity

public static Vector3 negativeInfinity { get; }
Gets a vector of negative infinities.

normalized

public Vector3 normalized { get; }
Gets the vector with length 1 in the same direction (zero stays zero).

one

public static Vector3 one { get; }
Gets (1, 1, 1).

positiveInfinity

public static Vector3 positiveInfinity { get; }
Gets a vector of positive infinities.

right

public static Vector3 right { get; }
Gets (1, 0, 0).

sqrMagnitude

public double sqrMagnitude { get; }
Gets the squared length: cheaper than Vector3.Length for comparisons.

Indexer

public double this[int index] { get; }
Gets the component at index (0 = X, 1 = Y, 2 = Z).

up

public static Vector3 up { get; }
Gets (0, 1, 0).

x

public double x { get; }
Gets the X component (Unity name).

y

public double y { get; }
Gets the Y component (Unity name).

z

public double z { get; }
Gets the Z component (Unity name).

zero

public static Vector3 zero { get; }
Gets (0, 0, 0).

Angle

public static double Angle(Vector3 from, Vector3 to)
The angle between two directions, in degrees.

ClampMagnitude

public static Vector3 ClampMagnitude(Vector3 value, double maxLength)
value shortened to at most maxLength.

Cross

public static Vector3 Cross(Vector3 a, Vector3 b)
The cross product: perpendicular to both, right-handed.

Deconstruct

public void Deconstruct(out double X, out double Y, out double Z)
Copies the positional values into the output parameters.

Distance

public static double Distance(Vector3 a, Vector3 b)
The distance between two points.

Dot

public static double Dot(Vector3 a, Vector3 b)
The dot product: |a| |b| cos(angle between them).

Equals

public bool Equals(Vector3 other)
Checks equality using the record's data.

Equals

public override bool Equals(object obj)
Checks equality using the record's data.

GetHashCode

public override int GetHashCode()
Returns a hash of the record's data.

Lerp

public static Vector3 Lerp(Vector3 a, Vector3 b, double t)
The point t of the way from a to b (t clamped to 0..1).

LerpUnclamped

public static Vector3 LerpUnclamped(Vector3 a, Vector3 b, double t)
Like Vector3.Lerp but t is not clamped.

Magnitude

public static double Magnitude(Vector3 value)
The length of value.

Max

public static Vector3 Max(Vector3 a, Vector3 b)
The component-wise maximum.

Min

public static Vector3 Min(Vector3 a, Vector3 b)
The component-wise minimum.

MoveTowards

public static Vector3 MoveTowards(Vector3 current, Vector3 target, double maxDistanceDelta)
Moves current towards target by at most maxDistanceDelta.

Normalize

public static Vector3 Normalize(Vector3 value)
The vector with length 1 in the direction of value.

Project

public static Vector3 Project(Vector3 value, Vector3 onNormal)
value projected onto the direction onNormal.

ProjectOnPlane

public static Vector3 ProjectOnPlane(Vector3 value, Vector3 planeNormal)
value projected onto the plane with normal planeNormal.

Reflect

public static Vector3 Reflect(Vector3 direction, Vector3 normal)
direction reflected off the plane with normal normal.

RotateTowards

public static Vector3 RotateTowards(Vector3 current, Vector3 target, double maxRadiansDelta, double maxMagnitudeDelta)
Turns current towards target by at most maxRadiansDelta, changing its length by at most maxMagnitudeDelta.

Scale

public static Vector3 Scale(Vector3 a, Vector3 b)
Component-wise product.

SignedAngle

public static double SignedAngle(Vector3 from, Vector3 to, Vector3 axis)
The angle in degrees from from to to, signed by the turn about axis.

Slerp

public static Vector3 Slerp(Vector3 a, Vector3 b, double t)
Spherical interpolation between two directions (length interpolated too).

SmoothDamp

public static Vector3 SmoothDamp(Vector3 current, Vector3 target, ref Vector3 currentVelocity, double smoothTime, double maxSpeed = double.PositiveInfinity, double deltaTime = -1)
Moves current smoothly towards target (a critically damped spring).

SqrMagnitude

public static double SqrMagnitude(Vector3 value)
The squared length of value.

ToString

public override string ToString()
Overrides string? ValueType.ToString().

operator +

public static Vector3 operator +(Vector3 left, Vector3 right)
Component-wise sum.

operator /

public static Vector3 operator /(Vector3 value, double scale)
The vector divided by a number.

operator ==

public static bool operator ==(Vector3 left, Vector3 right)
Checks equality using the record's data.

operator !=

public static bool operator !=(Vector3 left, Vector3 right)
Checks whether the records differ.

operator *

public static Vector3 operator *(Vector3 a, Vector3 b)
Component-wise product (same as Vector3.Scale).

operator *

public static Vector3 operator *(Vector3 value, double scale)
The vector scaled by a number.

operator *

public static Vector3 operator *(double scale, Vector3 value)
The vector scaled by a number.

operator -

public static Vector3 operator -(Vector3 left, Vector3 right)
Component-wise difference.

operator -

public static Vector3 operator -(Vector3 value)
The opposite vector.

Kaskade

Vector4

public readonly readonly struct Vector4

Implements IEquatable<Vector4>

A four-component vector (Unity's Vector4): shader values, colours, tiling.
x First component.
y Second component.
z Third component.
w Fourth component.

Vector4

public Vector4()
Creates a default instance of Vector4.

Vector4

public Vector4(float x, float y, float z, float w)
A four-component vector (Unity's Vector4): shader values, colours, tiling.
x First component.
y Second component.
z Third component.
w Fourth component.

one

public static Vector4 one { get; }
All one.

Indexer

public float this[int index] { get; }
The vector's components.

w

public float w { get; init; }
Fourth component.

x

public float x { get; init; }
First component.

y

public float y { get; init; }
Second component.

z

public float z { get; init; }
Third component.

zero

public static Vector4 zero { get; }
All zero.

Deconstruct

public void Deconstruct(out float x, out float y, out float z, out float w)
Copies the positional values into the output parameters.

Equals

public bool Equals(Vector4 other)
Checks equality using the record's data.

Equals

public override bool Equals(object obj)
Checks equality using the record's data.

GetHashCode

public override int GetHashCode()
Returns a hash of the record's data.

ToString

public override string ToString()
Returns a string representation of the record.

operator +

public static Vector4 operator +(Vector4 a, Vector4 b)
Component-wise sum.

operator ==

public static bool operator ==(Vector4 left, Vector4 right)
Checks equality using the record's data.

implicit operator Vector4

public static implicit operator Vector4(Color c)
A colour as a vector.

implicit operator Vector4

public static implicit operator Vector4(Vector2 v)
A vector from two components.

implicit operator Vector4

public static implicit operator Vector4(Vector3 v)
A vector from a point (w 1 for a position, as Unity's conversion gives 0).

implicit operator Vector3

public static implicit operator Vector3(Vector4 v)
xyz of the vector.

operator !=

public static bool operator !=(Vector4 left, Vector4 right)
Checks whether the records differ.

operator *

public static Vector4 operator *(Vector4 a, float s)
Scaled.

operator -

public static Vector4 operator -(Vector4 a, Vector4 b)
Component-wise difference.

Kaskade

Vehicle

public sealed class Vehicle
A car: the object's Vehicle component on its rigid body (Magic Formula tyres, suspension, drivetrain, stepped at 1 kHz). Calling Vehicle.Drive or Vehicle.SetControls takes the controls from the keyboard until Vehicle.ReleaseControls. Every number of the car can be changed by its path in the .kveh with Vehicle.Set ("brakes.bias", "axle.1.suspension.arb_rate", "driveline.rear.kind").

Vehicle

public Vehicle(GameObject gameObject)
The car's object.

Acceleration

public Vector3 Acceleration { get; }
Body acceleration along the car's right, up and back (m/s²), gravity excluded.

AngularVelocity

public Vector3 AngularVelocity { get; }
World-space chassis angular velocity in radians per second.

ClutchEngagement

public double ClutchEngagement { get; }
Clutch engagement 0 to 1.

ClutchSlip

public double ClutchSlip { get; }
Angular speed difference across the clutch in radians per second.

ClutchTorque

public double ClutchTorque { get; }
Torque transmitted through the clutch in newton metres.

EngineRunning

public bool EngineRunning { get; }
The engine runs (it can stall).

EngineTorque

public double EngineTorque { get; }
Engine torque at the flywheel (N m).

Error

public string Error { get; }
What is wrong with the car's setup (missing tyre file, bad value), or empty.

ForwardGearCount

public int ForwardGearCount { get; }
Number of forward gears in the installed gearbox.

Fuel

public double Fuel { get; }
Litres left.

FuelConsumedKg

public double FuelConsumedKg { get; }
Fuel used by the current simulation setup in kilograms.

GameObject

public GameObject GameObject { get; }
The car's object.

Gear

public int Gear { get; }
-1 reverse, 0 neutral, 1.. forward.

GearRatio

public double GearRatio { get; }
Current transmission ratio including final drive.

IsShifting

public bool IsShifting { get; }
Whether a gear change is in progress.

IsSimulated

public bool IsSimulated { get; }
False until the car has done its first step (or if it has no dynamic body).

Limiter

public bool Limiter { get; }
The rev limiter is cutting.

LinearVelocity

public Vector3 LinearVelocity { get; }
World-space chassis velocity in metres per second.

ParkingBrakeEngaged

public bool ParkingBrakeEngaged { get; }
Whether the parking brake is latched.

Rpm

public double Rpm { get; }
Engine speed (rpm).

ScriptControlsActive

public bool ScriptControlsActive { get; }
Whether script input currently overrides built-in keyboard input.

Speed

public double Speed { get; }
Forward speed (m/s).

SpeedKmh

public double SpeedKmh { get; }
Forward speed (km/h).

StabilityControlActive

public bool StabilityControlActive { get; }
Stability control is braking a wheel.

StarterActive

public bool StarterActive { get; }
Whether the starter input was applied during the last step.

SteeringAngle

public double SteeringAngle { get; }
Steering wheel angle in radians.

SteeringTorque

public double SteeringTorque { get; }
Torque at the steering wheel (N m, positive turns it right): play it as force feedback.

Throttle

public double Throttle { get; }
Throttle the engine got (after traction control).

TractionControlActive

public bool TractionControlActive { get; }
Traction control is cutting the throttle.

Tune

public VehicleTuning Tune { get; }
Typed access to the car setup. Values are available after its first physics step.

WheelCount

public int WheelCount { get; }
Wheels, two per axle.

Drive

public void Drive(double throttle, double brake, double steer)
Throttle and brake 0 to 1, steer -1 (left) to 1 (right).

GetSetting

public string? GetSetting(string path)
Reads a setting of the live car by its .kveh path.

GetSettings

public IReadOnlyDictionary<string, string> GetSettings()
All live settings as path/value pairs. The returned dictionary is a snapshot.

GetWheel

public WheelState GetWheel(int index)
A wheel: front left, front right, rear left, rear right, then further axles.

GetWheels

public IReadOnlyList<WheelState> GetWheels()
Reads the whole wheel set from one physics step.

Hold

public void Hold(double brake = 1, double handbrake = 1)
Applies the brakes with the clutch pressed until the next script input or release.

Load

public void Load(string file)
A different car from a project-relative .kveh; the body stays.

ReleaseControls

public void ReleaseControls()
The keyboard drives the car again (if its component allows it).

ResetState

public void ResetState()
Wheels at rest at ride height, engine running.

Set

public void Set(string path, bool value)
Sets a switch of the car by its .kveh path.

Set

public void Set(string path, double value)
Sets a number of the car by its .kveh path.

Set

public void Set(string path, string value)
Sets any value of the car by its .kveh path; the car rebuilds next step.

SetControls

public void SetControls(VehicleInput input)
Applies all driver inputs and takes control from the keyboard.

SetControls

public void SetControls(double throttle, double brake, double clutch, double steer, double handbrake, bool starter)
All pedals and the handbrake 0 to 1 (clutch 1 = pressed), steer -1 to 1.

SetIgnition

public void SetIgnition(bool start)
Cranks a stopped engine or shuts it off without resetting the car.

SetMany

public void SetMany(IEnumerable<KeyValuePair<string, string>> values)
Applies all values together, or leaves the car unchanged if a path or value is invalid.

SetParkingBrake

public void SetParkingBrake(bool engaged)
Latches the parking brake independently of keyboard and script pedals.

SetPunctured

public void SetPunctured(int wheel, bool punctured)
Sets the puncture state of the tyre at the given wheel index.

Shift

public void Shift(int gear)
-1 reverse, 0 neutral, 1.. forward.

ShiftDown

public void ShiftDown()
Requests the next lower gear.

ShiftNeutral

public void ShiftNeutral()
Requests neutral.

ShiftReverse

public void ShiftReverse()
Requests reverse gear.

ShiftUp

public void ShiftUp()
Requests the next higher gear.

StartEngine

public void StartEngine()
Requests a starter cycle for a stopped engine.

StopEngine

public void StopEngine()
Cuts engine power without resetting the car.

TryGetNumber

public bool TryGetNumber(string path, out double value)
Reads a numeric setup value using invariant formatting.

TryGetSnapshot

public bool TryGetSnapshot(out VehicleSnapshot? snapshot)
Reads all car and wheel telemetry together. Returns false until the car simulates.

TryGetSwitch

public bool TryGetSwitch(string path, out bool value)
Reads a boolean setup value.

TryGetWheel

public bool TryGetWheel(int index, out WheelState wheel)
Reads one wheel. Returns false when the index or vehicle is unavailable.

Kaskade

VehicleAxleTuning

public sealed class VehicleAxleTuning
One axle's geometry, tyre pressure and suspension setup. Axle 0 is the front.

AntiRollRate

public double AntiRollRate { get; set; }
Anti-roll stiffness in newtons per metre.

DroopHeight

public double DroopHeight { get; set; }
Wheel centre height at full droop in metres.

LongitudinalPosition

public double LongitudinalPosition { get; set; }
Axle position along the local Z axis in metres.

PressurePa

public double PressurePa { get; set; }
Tyre inflation pressure in pascals.

SpringPreload

public double SpringPreload { get; set; }
Spring preload force in newtons.

SpringRate

public double SpringRate { get; set; }
Spring stiffness in newtons per metre.

SteeringGain

public double SteeringGain { get; set; }
Multiplier applied to the steering angle at this axle.

Steers

public bool Steers { get; set; }
Whether this axle steers.

SuspensionTravel

public double SuspensionTravel { get; set; }
Available suspension travel in metres.

Track

public double Track { get; set; }
Distance between left and right wheel centres in metres.

UnsprungMass

public double UnsprungMass { get; set; }
Unsprung mass per wheel in kilograms.

WheelInertia

public double WheelInertia { get; set; }
Additional wheel spin inertia in kilogram metres squared.

Kaskade

VehicleExtensions

public static class VehicleExtensions
Cars from objects.

Vehicle

public static Vehicle Vehicle(GameObject gameObject)
The car on this object (its Vehicle component).

Kaskade

VehicleInput

public readonly readonly struct VehicleInput

Implements IEquatable<VehicleInput>

All analog driver controls plus the starter, applied together.
Throttle Accelerator input.
Brake Service brake input.
Clutch Clutch pedal input.
Steer Signed steering input.
Handbrake Parking brake input.
Starter Whether to engage the starter.

VehicleInput

public VehicleInput()
Creates a default instance of VehicleInput.

VehicleInput

public VehicleInput(double Throttle = 0, double Brake = 0, double Clutch = 0, double Steer = 0, double Handbrake = 0, bool Starter = false)
All analog driver controls plus the starter, applied together.
Throttle Accelerator input.
Brake Service brake input.
Clutch Clutch pedal input.
Steer Signed steering input.
Handbrake Parking brake input.
Starter Whether to engage the starter.

Brake

public double Brake { get; init; }
Service brake input.

Clutch

public double Clutch { get; init; }
Clutch pedal input.

Handbrake

public double Handbrake { get; init; }
Parking brake input.

Starter

public bool Starter { get; init; }
Whether to engage the starter.

Steer

public double Steer { get; init; }
Signed steering input.

Throttle

public double Throttle { get; init; }
Accelerator input.

Deconstruct

public void Deconstruct(out double Throttle, out double Brake, out double Clutch, out double Steer, out double Handbrake, out bool Starter)
Copies the positional values into the output parameters.

Equals

public bool Equals(VehicleInput other)
Checks equality using the record's data.

Equals

public override bool Equals(object obj)
Checks equality using the record's data.

GetHashCode

public override int GetHashCode()
Returns a hash of the record's data.

ToString

public override string ToString()
Returns a string representation of the record.

operator ==

public static bool operator ==(VehicleInput left, VehicleInput right)
Checks equality using the record's data.

operator !=

public static bool operator !=(VehicleInput left, VehicleInput right)
Checks whether the records differ.

Kaskade

VehicleSnapshot

public sealed class VehicleSnapshot
A consistent read of the car and every wheel from one physics step.

AngularVelocity

public Vector3 AngularVelocity { get; }
World-space chassis angular velocity in radians per second.

ClutchEngagement

public double ClutchEngagement { get; }
Clutch engagement from 0 (open) to 1 (closed).

ClutchSlip

public double ClutchSlip { get; }
Angular speed difference across the clutch in radians per second.

ClutchTorque

public double ClutchTorque { get; }
Torque transmitted through the clutch in newton metres.

EngineRunning

public bool EngineRunning { get; }
Whether the engine is running.

EngineTorque

public double EngineTorque { get; }
Flywheel torque in newton metres.

Error

public string Error { get; }
The car setup error, or an empty string.

ForwardGearCount

public int ForwardGearCount { get; }
Number of forward gears in the installed gearbox.

Fuel

public double Fuel { get; }
Fuel remaining in litres.

FuelConsumedKg

public double FuelConsumedKg { get; }
Fuel used by the current simulation setup in kilograms.

Gear

public int Gear { get; }
Gear index. Reverse is -1 and neutral is 0.

GearRatio

public double GearRatio { get; }
Current transmission ratio including final drive.

GroundSpeedKmh

public double GroundSpeedKmh { get; }
Speed in the horizontal plane in kilometres per hour.

GroundedWheelCount

public int GroundedWheelCount { get; }
Number of wheels in contact with the ground.

IsGrounded

public bool IsGrounded { get; }
Whether any wheel is in contact with the ground.

IsShifting

public bool IsShifting { get; }
Whether a gear change is in progress.

Limiter

public bool Limiter { get; }
Whether the rev limiter is cutting torque.

LinearVelocity

public Vector3 LinearVelocity { get; }
World-space chassis velocity in metres per second.

LocalAcceleration

public Vector3 LocalAcceleration { get; }
Acceleration in the car's local axes in metres per second squared.

ParkingBrakeEngaged

public bool ParkingBrakeEngaged { get; }
Whether the parking brake is latched.

Rpm

public double Rpm { get; }
Engine speed in revolutions per minute.

ScriptControlsActive

public bool ScriptControlsActive { get; }
Whether script input currently overrides built-in keyboard input.

Speed

public double Speed { get; }
Signed speed along the car's forward axis in metres per second.

SpeedKmh

public double SpeedKmh { get; }
Signed speed along the car's forward axis in kilometres per hour.

StabilityControlActive

public bool StabilityControlActive { get; }
Whether stability control is braking a wheel.

StarterActive

public bool StarterActive { get; }
Whether the starter input was applied during the last step.

SteeringAngle

public double SteeringAngle { get; }
Steering wheel angle in radians.

SteeringTorque

public double SteeringTorque { get; }
Steering wheel feedback torque in newton metres.

Throttle

public double Throttle { get; }
Engine throttle after traction control, from 0 to 1.

TractionControlActive

public bool TractionControlActive { get; }
Whether traction control is cutting throttle.

Wheels

public IReadOnlyList<WheelState> Wheels { get; }
All wheels, left then right for each axle in axle order.

Kaskade

VehicleTuning

public sealed class VehicleTuning
Named access to the live car setup in SI units. Writes apply on the next physics step.

Abs

public bool Abs { get; set; }
Whether anti-lock braking is enabled.

Ackermann

public double Ackermann { get; set; }
Share of Ackermann steering correction.

AutomaticClutch

public bool AutomaticClutch { get; set; }
Whether the simulation operates the clutch automatically.

AutomaticGearbox

public bool AutomaticGearbox { get; set; }
Whether the gearbox shifts automatically.

BrakeBias

public double BrakeBias { get; set; }
Share of service brake torque sent to the front.

BrakeTorque

public double BrakeTorque { get; set; }
Maximum service brake torque in newton metres.

CanStall

public bool CanStall { get; set; }
Whether the engine can stall under load.

ClutchEngageRpm

public double ClutchEngageRpm { get; set; }
Engine speed where the automatic clutch starts engaging.

ClutchLockRpm

public double ClutchLockRpm { get; set; }
Engine speed where the automatic clutch fully engages.

ClutchMaxTorque

public double ClutchMaxTorque { get; set; }
Maximum clutch torque in newton metres.

DragArea

public double DragArea { get; set; }
Effective aerodynamic drag area in square metres.

EngineInertia

public double EngineInertia { get; set; }
Rotating engine inertia in kilogram metres squared.

FinalDrive

public double FinalDrive { get; set; }
Final drive ratio.

FrontLiftArea

public double FrontLiftArea { get; set; }
Effective front lift area in square metres. Negative values produce downforce.

FuelCapacity

public double FuelCapacity { get; }
Tank capacity in litres.

FuelConsumption

public bool FuelConsumption { get; set; }
Whether running the engine consumes fuel.

HandbrakeTorque

public double HandbrakeTorque { get; set; }
Maximum handbrake torque in newton metres.

IdleRpm

public double IdleRpm { get; set; }
Engine idle speed in revolutions per minute.

LimiterRpm

public double LimiterRpm { get; set; }
Rev limiter threshold in revolutions per minute.

Mass

public double Mass { get; set; }
Total vehicle mass in kilograms.

RearLiftArea

public double RearLiftArea { get; set; }
Effective rear lift area in square metres. Negative values produce downforce.

ReverseRatio

public double ReverseRatio { get; set; }
Reverse gear ratio.

ShiftDownRpm

public double ShiftDownRpm { get; set; }
Automatic downshift threshold in revolutions per minute.

ShiftTime

public double ShiftTime { get; set; }
Gear change duration in seconds.

ShiftUpRpm

public double ShiftUpRpm { get; set; }
Automatic upshift threshold in revolutions per minute.

StabilityControl

public bool StabilityControl { get; set; }
Whether stability control is enabled.

StallRpm

public double StallRpm { get; set; }
Engine stall threshold in revolutions per minute.

StarterTorque

public double StarterTorque { get; set; }
Starter motor torque in newton metres.

SteeringAssist

public double SteeringAssist { get; set; }
Steering assistance factor.

SteeringLockDegrees

public double SteeringLockDegrees { get; set; }
Maximum steering wheel angle in degrees.

SteeringRatio

public double SteeringRatio { get; set; }
Steering wheel angle divided by road wheel angle.

TractionControl

public bool TractionControl { get; set; }
Whether traction control is enabled.

Axle

public VehicleAxleTuning Axle(int index)
Gets access to an axle by zero-based index, starting at the front.

SetForwardGearRatios

public void SetForwardGearRatios(params double[] ratios)
Replaces the forward gear ratios in gear order.

Kaskade

WaitForEndOfFrame

public sealed class WaitForEndOfFrame

Inherits YieldInstruction

Waits until the end of the frame (after every update, before rendering).

WaitForEndOfFrame

public WaitForEndOfFrame()
Creates a default instance of WaitForEndOfFrame.

Kaskade

WaitForFixedUpdate

public sealed class WaitForFixedUpdate

Inherits YieldInstruction

Waits until the next physics step.

WaitForFixedUpdate

public WaitForFixedUpdate()
Creates a default instance of WaitForFixedUpdate.

Kaskade

WaitForSeconds

public sealed class WaitForSeconds

Inherits YieldInstruction

Waits seconds of game time (scaled by Time.timeScale).
seconds How long to wait.

WaitForSeconds

public WaitForSeconds(double seconds)
Waits seconds of game time (scaled by Time.timeScale).
seconds How long to wait.

Kaskade

WaitForSecondsRealtime

public sealed class WaitForSecondsRealtime

Inherits CustomYieldInstruction

Waits seconds of real time (not scaled).
seconds How long to wait.

WaitForSecondsRealtime

public WaitForSecondsRealtime(double seconds)
Waits seconds of real time (not scaled).
seconds How long to wait.

keepWaiting

public override bool keepWaiting { get; }
Gets whether to keep waiting.

Kaskade

WaitUntil

public sealed class WaitUntil

Inherits CustomYieldInstruction

Waits until predicate returns true.
predicate Checked every frame.

WaitUntil

public WaitUntil(Func<bool> predicate)
Waits until predicate returns true.
predicate Checked every frame.

keepWaiting

public override bool keepWaiting { get; }
Gets whether to keep waiting.

Kaskade

WaitWhile

public sealed class WaitWhile

Inherits CustomYieldInstruction

Waits while predicate returns true.
predicate Checked every frame.

WaitWhile

public WaitWhile(Func<bool> predicate)
Waits while predicate returns true.
predicate Checked every frame.

keepWaiting

public override bool keepWaiting { get; }
Gets whether to keep waiting.

Kaskade

Weather

public static class Weather
The weather: the rain's settings by name, the reverb and the rain's sound (as Zito's engine.weather_get / engine.weather_set). Changes apply on the next frame.
Rain values: "enabled" (0/1), "intensity", "wetness", "puddles", "puddle_scale", "ripples", "wind_x", "wind_z", "visual_fall", "fall_speed", "exposure", "cam_vel_gain", "near_dist", "far_dist", "cell_size", "drop_spacing", "storm_boost", "density", "fall_curve", "drop_radius", "op_near", "op_far", "fade_dist", "tint_r", "tint_g", "tint_b", "bright", "occlusion" (0/1), "occlusion_area". Reverb: "reverb.wet", "reverb.room_size", "reverb.damping". "sound": the volume of the rain's audio sources.

rainEnabled

public static bool rainEnabled { get; set; }
Whether it rains.

rainIntensity

public static float rainIntensity { get; set; }
How hard it rains (0..1).

rainSoundVolume

public static float rainSoundVolume { get; set; }
The volume of the rain's sound (its audio sources).

wetness

public static float wetness { get; set; }
How wet the surfaces are (0..1).

wind

public static Vector2 wind { get; set; }
The wind (m/s) along world x and z.

Get

public static float Get(string name)
The value in effect (0 for an unknown name).

Set

public static void Set(string name, float value)
Changes a value; applied on the next frame.

SetReverb

public static void SetReverb(float roomSize, float damping, float wet)
The reverb: room size, damping and how loud it returns (0..1 each).

Kaskade

WheelState

public readonly readonly struct WheelState
One wheel of a Vehicle as of the last physics step.

WheelState

public WheelState()
Creates a default instance of WheelState.

AbsActive

public bool AbsActive { get; init; }
ABS is easing this brake.

AligningMoment

public double AligningMoment { get; init; }
Aligning moment (N m).

BrakeTorque

public double BrakeTorque { get; init; }
Applied brake torque in newton metres.

CamberDegrees

public double CamberDegrees { get; init; }
Camber to the car (degrees, negative: top in).

Compression

public double Compression { get; init; }
Suspension compression from full droop (m).

ContactPoint

public Vector3 ContactPoint { get; init; }
World-space tyre contact point. Read when the wheel is on the ground.

ForwardForce

public double ForwardForce { get; init; }
Forward force of the road on the tyre (N).

IsDriven

public bool IsDriven { get; init; }
Whether the drivetrain can send torque to this wheel.

IsPunctured

public bool IsPunctured { get; init; }
Whether this tyre is punctured.

Load

public double Load { get; init; }
Load (N).

OnGround

public bool OnGround { get; init; }
The tyre touches the road.

RimContact

public bool RimContact { get; init; }
The rim touches the road (flat tyre or a hard hit).

SideForce

public double SideForce { get; init; }
Side force, to the wheel's left (N).

SlipAngle

public double SlipAngle { get; init; }
Slip angle (rad).

SlipRatio

public double SlipRatio { get; init; }
Longitudinal slip (0 rolling, 1 spinning at twice the speed, -1 locked).

SlipSpeed

public double SlipSpeed { get; init; }
How fast the contact patch slides (m/s): skid sound, smoke, marks.

Spin

public double Spin { get; init; }
Spin (rad/s).

SpinAngle

public double SpinAngle { get; init; }
Accumulated rotation of the wheel in radians.

SteerAngle

public double SteerAngle { get; init; }
Steering angle of this wheel in radians.

Surface

public int Surface { get; init; }
Material id of what it rolls on.

SuspensionForce

public double SuspensionForce { get; init; }
Vertical suspension force in newtons.

ToeDegrees

public double ToeDegrees { get; init; }
Wheel toe angle in degrees.

Kaskade

YieldInstruction

public abstract class YieldInstruction
Base of the objects a coroutine yields to wait (WaitForSeconds, ...).

Kaskade

ZitoTypeId

public readonly readonly struct ZitoTypeId

Implements IEquatable<ZitoTypeId>

Stable 128-bit identity of a Zito component type.
Low Low 64 bits of the type ID.
High High 64 bits of the type ID.

ZitoTypeId

public ZitoTypeId()
Creates a default instance of ZitoTypeId.

ZitoTypeId

public ZitoTypeId(ulong Low, ulong High)
Stable 128-bit identity of a Zito component type.
Low Low 64 bits of the type ID.
High High 64 bits of the type ID.

High

public ulong High { get; init; }
High 64 bits of the type ID.

Low

public ulong Low { get; init; }
Low 64 bits of the type ID.

Deconstruct

public void Deconstruct(out ulong Low, out ulong High)
Copies the positional values into the output parameters.

Equals

public bool Equals(ZitoTypeId other)
Checks equality using the record's data.

Equals

public override bool Equals(object obj)
Checks equality using the record's data.

GetHashCode

public override int GetHashCode()
Returns a hash of the record's data.

ToString

public override string ToString()
Returns a string representation of the record.

operator ==

public static bool operator ==(ZitoTypeId left, ZitoTypeId right)
Checks equality using the record's data.

operator !=

public static bool operator !=(ZitoTypeId left, ZitoTypeId right)
Checks whether the records differ.

Kaskade

AnimatorApi

public static class AnimatorApi
The engine functions of the Zito SDK unit, for C#.

Bone

public static EngineValue Bone(GameObject? entity, string bone)
Zito animator.bone (engine function engine.animator_bone).

CrossFade

public static void CrossFade(GameObject? entity, string state, double duration, int layer = 0)
Blends the animator of entity (or the first under it) to state over duration seconds.

PlayLayer

public static void PlayLayer(GameObject? entity, string state, int layer)
Zito animator.play_layer (engine function engine.animator_play).

ResetTrigger

public static void ResetTrigger(GameObject? entity, string name)
Zito animator.reset_trigger (engine function engine.animator_reset_trigger).

SetBonePosition

public static void SetBonePosition(GameObject? entity, string bone, double x, double y, double z, double weight)
Zito animator.set_bone_position (engine function engine.animator_set_bone_position).

SetBoneRotation

public static void SetBoneRotation(GameObject? entity, string bone, Quaternion rotation, double weight = 1)
Overrides the bone's local rotation for this frame, blended by weight.

SetBoneRotation

public static void SetBoneRotation(GameObject? entity, string bone, double x, double y, double z, double w, double weight)
Zito animator.set_bone_rotation (engine function engine.animator_set_bone_rotation).

SetBool

public static void SetBool(GameObject? entity, string name, bool value)
Zito animator.set_bool (engine function engine.animator_set_bool).

SetFloat

public static void SetFloat(GameObject? entity, string name, double value)
Zito animator.set_float (engine function engine.animator_set_float).

SetInt

public static void SetInt(GameObject? entity, string name, int value)
Zito animator.set_int (engine function engine.animator_set_int).

SetSpeed

public static void SetSpeed(GameObject? entity, double speed)
Zito animator.set_speed (engine function engine.animator_set_speed).

SetTrigger

public static void SetTrigger(GameObject? entity, string name)
Zito animator.set_trigger (engine function engine.animator_set_trigger).

State

public static string State(GameObject? entity, int layer = 0)
The animator's current state on layer.

TryGetBone

public static bool TryGetBone(GameObject? entity, string bone, out BonePose pose)
A bone of the animator of entity (or the first under it) as its clips posed it on the last frame, before scripts' overrides; false when there is no such bone.

Kaskade

ApplicationApi

public static class ApplicationApi
The engine functions of the Zito SDK unit, for C#.

Quit

public static void Quit()
Zito application.quit (engine function engine.request_quit).

ScreenHeight

public static int ScreenHeight()
Zito application.screen_height (engine function engine.screen_height).

ScreenWidth

public static int ScreenWidth()
Zito application.screen_width (engine function engine.screen_width).

Kaskade

AudioApi

public static class AudioApi
The engine functions of the Zito SDK unit, for C#.

PlayMusic

public static void PlayMusic(string clip, double volume)
Zito audio.play_music (engine function engine.play_music).

StopMusic

public static void StopMusic()
Zito audio.stop_music (engine function engine.stop_music).

Kaskade

CameraApi

public static class CameraApi
The engine functions of the Zito SDK unit, for C#.

ScreenPointToRay

public static EngineValue ScreenPointToRay(Vector2 screenPosVec2)
Zito camera.screen_point_to_ray (engine function engine.camera_screen_point_to_ray).

ScreenPointToWorldPos

public static EngineValue ScreenPointToWorldPos(Vector2 screenPosVec2, double maxDist)
Zito camera.screen_point_to_world_pos (engine function engine.camera_screen_point_to_world_pos).

ScreenToWorldPoint

public static EngineValue ScreenToWorldPoint(Vector2 screenPosVec2, double distance)
Zito camera.screen_to_world_point (engine function engine.camera_screen_to_world_point).

SetFov

public static void SetFov(GameObject? cameraEntity, double fovDegrees)
Zito camera.set_fov (engine function engine.camera_set_fov).

WorldToScreenPoint

public static EngineValue WorldToScreenPoint(Vector3 worldPosVec3)
Zito camera.world_to_screen_point (engine function engine.camera_world_to_screen_point).

Kaskade

CollisionApi

public static class CollisionApi
The engine functions of the Zito SDK unit, for C#.

IsTrigger

public static bool IsTrigger(GameObject? entity)
Zito collision.is_trigger (engine function engine.collision_is_trigger).

LastContactNormal

public static Vector3 LastContactNormal(GameObject? entity)
Zito collision.last_contact_normal (engine function engine.collision_last_contact_normal).

LastContactPoint

public static Vector3 LastContactPoint(GameObject? entity)
Zito collision.last_contact_point (engine function engine.collision_last_contact_point).

OverlapCount

public static int OverlapCount(GameObject? triggerEntity)
Zito collision.overlap_count (engine function engine.collision_overlap_count).

OverlapEntityAt

public static EngineValue OverlapEntityAt(GameObject? triggerEntity, int index)
Zito collision.overlap_entity_at (engine function engine.collision_overlap_entity_at).

SetTrigger

public static void SetTrigger(GameObject? entity, bool isTrigger)
Zito collision.set_trigger (engine function engine.collision_set_trigger).

Kaskade

ComponentApi

public static class ComponentApi
The engine functions of the Zito SDK unit, for C#.

Add

public static EngineValue Add(GameObject? entity, string typeName)
Zito component.add (engine function engine.component_add).

AddKind

public static void AddKind(GameObject? entity, string kind)
Zito component.add_kind (engine function engine.add_component_kind).

Alive

public static bool Alive(EngineValue handle)
Zito component.alive (engine function engine.component_alive).

Enabled

public static bool Enabled(EngineValue handle)
Zito component.enabled (engine function engine.component_enabled).

Get

public static EngineValue Get(GameObject? entity, string typeName)
Zito component.get (engine function engine.get_component).

GetAllInChildren

public static EngineValue GetAllInChildren(GameObject? entity, string typeName)
Zito component.get_all_in_children (engine function engine.component_get_all_in_children).

GetInChildren

public static EngineValue GetInChildren(GameObject? entity, string typeName)
Zito component.get_in_children (engine function engine.component_get_in_children).

GetInParent

public static EngineValue GetInParent(GameObject? entity, string typeName)
Zito component.get_in_parent (engine function engine.component_get_in_parent).

Has

public static bool Has(EngineValue handle, string field)
Zito component.has (engine function engine.has_field).

Owner

public static GameObject? Owner(EngineValue handle)
Zito component.owner (engine function engine.component_owner).

Property

public static EngineValue Property(GameObject? entity, string typeName, string property)
Zito component.property (engine function engine.component_property).

Read

public static EngineValue Read(EngineValue handle, string field)
Zito component.read (engine function engine.get_field).

Remove

public static void Remove(EngineValue handle)
Zito component.remove (engine function engine.remove_component).

RemoveKind

public static void RemoveKind(GameObject? entity, string typeName)
Zito component.remove_kind (engine function engine.remove_component_kind).

SetProperty

public static void SetProperty(GameObject? entity, string typeName, string property, EngineValue value)
Zito component.set_property (engine function engine.set_component_property).

TypeMatches

public static bool TypeMatches(EngineValue comp, string typeName)
Zito component.type_matches (engine function engine.component_type_matches).

Write

public static void Write(EngineValue handle, string field, EngineValue value)
Zito component.write (engine function engine.set_field).

Kaskade

ComputeApi

public static class ComputeApi
The engine functions of the Zito SDK unit, for C#.

Buffer

public static EngineValue Buffer(int count, int stride)
Zito compute.buffer (engine function engine.compute_buffer_create).

Dispatch

public static void Dispatch(string path, string kernel, int x, int y, int z, EngineValue values)
Zito compute.dispatch (engine function engine.compute_dispatch).

KernelSize

public static EngineValue KernelSize(string path, string kernel)
Zito compute.kernel_size (engine function engine.compute_kernel_size).

Release

public static void Release(EngineValue buffer)
Zito compute.release (engine function engine.compute_buffer_release).

Request

public static void Request(EngineValue buffer)
Zito compute.request (engine function engine.compute_buffer_request).

SetData

public static void SetData(EngineValue buffer, EngineValue floats)
Zito compute.set_data (engine function engine.compute_buffer_set_data).

SetDataInt

public static void SetDataInt(EngineValue buffer, EngineValue ints)
Zito compute.set_data_int (engine function engine.compute_buffer_set_data_int).

Kaskade

ControllerApi

public static class ControllerApi
The engine functions of the Zito SDK unit, for C#.

GroundEntity

public static GameObject? GroundEntity(GameObject? entity)
Zito controller.ground_entity (engine function engine.controller_ground_entity).

GroundNormal

public static Vector3 GroundNormal(GameObject? entity)
Zito controller.ground_normal (engine function engine.controller_ground_normal).

IsGrounded

public static bool IsGrounded(GameObject? entity)
Zito controller.is_grounded (engine function engine.controller_is_grounded).

MoveAndSlide

public static EngineValue MoveAndSlide(GameObject? entity, Vector3 motionDeltaVec3)
Zito controller.move_and_slide (engine function engine.controller_move_and_slide).

SetSlopeLimit

public static void SetSlopeLimit(GameObject? entity, double maxSlopeDegrees)
Zito controller.set_slope_limit (engine function engine.controller_set_slope_limit).

SetStepHeight

public static void SetStepHeight(GameObject? entity, double stepHeight)
Zito controller.set_step_height (engine function engine.controller_set_step_height).

Teleport

public static void Teleport(GameObject? entity, Vector3 position, Quaternion rotation)
Zito controller.teleport (engine function engine.player_teleport).

Kaskade

DebugApi

public static class DebugApi
The engine functions of the Zito SDK unit, for C#.

DrawLine

public static void DrawLine(Vector3 startVec3, Vector3 endVec3, Color colorRgb, double duration)
Zito debug.draw_line (engine function engine.debug_draw_line).

DrawWireShape

public static void DrawWireShape(int shapeType, Vector3 positionVec3, Vector3 extentsVec3, Quaternion rotationQuat, Color colorRgb, double duration)
Zito debug.draw_wire_shape (engine function engine.debug_draw_wire_shape).

Error

public static void Error(string message)
Zito debug.error (engine function engine.debug_error).

Log

public static void Log(string message)
Zito debug.log (engine function engine.debug_log).

Warn

public static void Warn(string message)
Zito debug.warn (engine function engine.debug_warn).

Kaskade

DirectorApi

public static class DirectorApi
The engine functions of the Zito SDK unit, for C#.

Finished

public static bool Finished(GameObject? entity)
Zito director.finished (engine function engine.director_finished).

IsPlaying

public static bool IsPlaying(GameObject? entity)
Zito director.is_playing (engine function engine.director_is_playing).

Pause

public static void Pause(GameObject? entity)
Zito director.pause (engine function engine.director_pause).

Play

public static void Play(GameObject? entity)
Zito director.play (engine function engine.director_play).

SetSpeed

public static void SetSpeed(GameObject? entity, double speed)
Zito director.set_speed (engine function engine.director_set_speed).

SetTime

public static void SetTime(GameObject? entity, double time)
Zito director.set_time (engine function engine.director_set_time).

Signal

public static bool Signal(GameObject? entity, string name)
Zito director.signal (engine function engine.director_signal).

Stop

public static void Stop(GameObject? entity)
Zito director.stop (engine function engine.director_stop).

Kaskade

EngineApi

public static class EngineApi
The engine functions of the Zito SDK unit, for C#.

Call

public static EngineValue Call(string name, params EngineValue[] arguments)
Calls any engine.* function by name, as Zito scripts can.
name The function, e.g. "engine.find_in_self_scene".
arguments Its arguments.

ComponentAt

public static EngineValue ComponentAt(GameObject? entity, int index)
Zito engine.component_at (engine function engine.component_at).

ComponentName

public static string ComponentName(EngineValue component)
Zito engine.component_name (engine function engine.component_name).

ComponentTypeName

public static string ComponentTypeName(EngineValue component)
Zito engine.component_type_name (engine function engine.component_type_name).

CreateGameObject

public static GameObject? CreateGameObject(Scene scene, string name)
Zito engine.create_game_object (engine function engine.create_game_object).

ObjectAt

public static GameObject? ObjectAt(int index)
Zito engine.object_at (engine function engine.object_at).

PlaySound

public static void PlaySound(string clip, double x, double y, double z, double volume)
Zito engine.play_sound (engine function engine.play_sound).

Renderer

public static string Renderer()
Zito engine.renderer (engine function engine.renderer).

RotateEuler

public static void RotateEuler(GameObject? entity, double x, double y, double z)
Zito engine.rotate_euler (engine function engine.rotate_euler).

SelfComponent

public static EngineValue SelfComponent()
Zito engine.self_component (engine function engine.self_component).

SetComponentEnabled

public static void SetComponentEnabled(EngineValue component, bool enabled)
Zito engine.set_component_enabled (engine function engine.set_component_enabled).

SetLocalPosition

public static void SetLocalPosition(GameObject? entity, double x, double y, double z)
Zito engine.set_local_position (engine function engine.set_local_position).

SetLocalRotationEuler

public static void SetLocalRotationEuler(GameObject? entity, double x, double y, double z)
Zito engine.set_local_rotation_euler (engine function engine.set_local_rotation_euler).

SetLocalRotationQuaternion

public static void SetLocalRotationQuaternion(GameObject? entity, double x, double y, double z, double w)
Zito engine.set_local_rotation_quaternion (engine function engine.set_local_rotation_quaternion).

SetLocalScale

public static void SetLocalScale(GameObject? entity, double x, double y, double z)
Zito engine.set_local_scale (engine function engine.set_local_scale).

SetTimeOfDay

public static void SetTimeOfDay(double hour)
Zito engine.set_time_of_day (engine function engine.set_time_of_day).

SetTimeOfDayEnabled

public static void SetTimeOfDayEnabled(bool enabled)
Zito engine.set_time_of_day_enabled (engine function engine.set_time_of_day_enabled).

SetWorldPosition

public static void SetWorldPosition(GameObject? entity, double x, double y, double z)
Zito engine.set_world_position (engine function engine.set_world_position).

SetWorldRotationEuler

public static void SetWorldRotationEuler(GameObject? entity, double x, double y, double z)
Zito engine.set_world_rotation_euler (engine function engine.set_world_rotation_euler).

SetWorldRotationQuaternion

public static void SetWorldRotationQuaternion(GameObject? entity, double x, double y, double z, double w)
Zito engine.set_world_rotation_quaternion (engine function engine.set_world_rotation_quaternion).

SetWorldScale

public static void SetWorldScale(GameObject? entity, double x, double y, double z)
Zito engine.set_world_scale (engine function engine.set_world_scale).

SettingsDisplay

public static EngineValue SettingsDisplay()
Zito engine.settings_display (engine function engine.settings_display).

SettingsGet

public static EngineValue SettingsGet(string key)
Zito engine.settings_get (engine function engine.settings_get).

TimeOfDayEnabled

public static bool TimeOfDayEnabled()
Zito engine.time_of_day_enabled (engine function engine.time_of_day_enabled).

Translate

public static void Translate(GameObject? entity, double x, double y, double z)
Zito engine.translate (engine function engine.translate).

UiImage

public static void UiImage(string path, double x, double y, double w, double h, double radius, Color tint, bool fit)
Zito engine.ui_image (engine function engine.ui_image).

UiMouse

public static EngineValue UiMouse()
Zito engine.ui_mouse (engine function engine.ui_mouse).

UiScreen

public static EngineValue UiScreen()
Zito engine.ui_screen (engine function engine.ui_screen).

WeatherSet

public static void WeatherSet(string name, double value)
Zito engine.weather_set (engine function engine.weather_set).

Kaskade

EntityApi

public static class EntityApi
The engine functions of the Zito SDK unit, for C#.

ActiveInHierarchy

public static bool ActiveInHierarchy(GameObject? entityHandle)
Zito entity.active_in_hierarchy (engine function engine.active_in_hierarchy).

ActiveSelf

public static bool ActiveSelf(GameObject? entityHandle)
Zito entity.active_self (engine function engine.active_self).

Alive

public static bool Alive(GameObject? entityHandle)
Zito entity.alive (engine function engine.alive).

ChildAt

public static GameObject? ChildAt(GameObject? entityHandle, int index)
Zito entity.child_at (engine function engine.child_at).

ChildCount

public static int ChildCount(GameObject? entityHandle)
Zito entity.child_count (engine function engine.child_count).

ClearParent

public static void ClearParent(GameObject? child, bool keepWorldTransform)
Zito entity.clear_parent (engine function engine.clear_parent).

Destroy

public static void Destroy(GameObject? entityHandle)
Zito entity.destroy (engine function engine.destroy).

FindAllByTag

public static EngineValue FindAllByTag(string tag)
Zito entity.find_all_by_tag (engine function engine.find_all_by_tag).

FindByTag

public static GameObject? FindByTag(string tag)
Zito entity.find_by_tag (engine function engine.find_by_tag).

FindDescendant

public static GameObject? FindDescendant(EngineValue rootHandle, string name)
Zito entity.find_descendant (engine function engine.find_descendant).

Instantiate

public static GameObject? Instantiate(GameObject? entity, Vector3 positionVec3, Quaternion rotationQuat)
Zito entity.instantiate (engine function engine.instantiate_object).

Layer

public static int Layer(GameObject? entityHandle)
Zito entity.layer (engine function engine.entity_layer).

Name

public static string Name(GameObject? entityHandle)
Zito entity.name (engine function engine.entity_name).

Parent

public static GameObject? Parent(GameObject? entityHandle)
Zito entity.parent (engine function engine.parent).

PendingDestroy

public static bool PendingDestroy(GameObject? entityHandle)
Zito entity.pending_destroy (engine function engine.pending_destroy).

Root

public static GameObject? Root(GameObject? entityHandle)
Zito entity.root (engine function engine.entity_root).

Scene

public static Scene Scene(GameObject? entityHandle)
Zito entity.scene (engine function engine.entity_scene).

SetActive

public static void SetActive(GameObject? entityHandle, bool active)
Zito entity.set_active (engine function engine.set_active).

SetLayer

public static void SetLayer(GameObject? entityHandle, int layerIndex)
Zito entity.set_layer (engine function engine.set_entity_layer).

SetName

public static void SetName(GameObject? entityHandle, string name)
Zito entity.set_name (engine function engine.set_entity_name).

SetParent

public static void SetParent(GameObject? child, GameObject? parentEntity, bool keepWorldTransform)
Zito entity.set_parent (engine function engine.set_parent).

SetTag

public static void SetTag(GameObject? entityHandle, string tag)
Zito entity.set_tag (engine function engine.set_entity_tag).

SpawnPrefab

public static GameObject? SpawnPrefab(string prefabPath)
Zito entity.spawn_prefab (engine function engine.spawn_prefab).

SpawnPrefabAt

public static GameObject? SpawnPrefabAt(string prefabPath, Vector3 positionVec3, Quaternion rotationQuat)
Zito entity.spawn_prefab_at (engine function engine.spawn_prefab_at).

Tag

public static string Tag(GameObject? entityHandle)
Zito entity.tag (engine function engine.entity_tag).

Kaskade

GraphicsApi

public static class GraphicsApi
The engine functions of the Zito SDK unit, for C#.

Blit

public static void Blit(string source, string destination)
Zito graphics.blit (engine function engine.graphics_blit).

ProjectPath

public static string ProjectPath()
Zito graphics.project_path (engine function engine.application_project_path).

Kaskade

GuiApi

public static class GuiApi
The engine functions of the Zito SDK unit, for C#.

Box

public static void Box(double x, double y, double w, double h, string text)
Zito gui.box (engine function engine.gui_box).

Button

public static bool Button(double x, double y, double w, double h, string text)
Zito gui.button (engine function engine.gui_button).

Fade

public static void Fade(double alpha)
Zito gui.fade (engine function engine.gui_fade).

HorizontalScrollbar

public static double HorizontalScrollbar(double x, double y, double w, double h, double value, double size, double leftVal, double rightVal)
Zito gui.horizontal_scrollbar (engine function engine.gui_horizontal_scrollbar).

HorizontalSlider

public static double HorizontalSlider(double x, double y, double w, double h, double value, double leftVal, double rightVal)
Zito gui.horizontal_slider (engine function engine.gui_horizontal_slider).

Label

public static void Label(double x, double y, double w, double h, string text)
Zito gui.label (engine function engine.gui_label).

PasswordField

public static string PasswordField(double x, double y, double w, double h, string text, string mask)
Zito gui.password_field (engine function engine.gui_password_field).

RepeatButton

public static bool RepeatButton(double x, double y, double w, double h, string text)
Zito gui.repeat_button (engine function engine.gui_repeat_button).

SetBackgroundColor

public static void SetBackgroundColor(double r, double g, double b, double a)
Zito gui.set_background_color (engine function engine.gui_set_background_color).

SetColor

public static void SetColor(double r, double g, double b, double a)
Zito gui.set_color (engine function engine.gui_set_color).

SetContentColor

public static void SetContentColor(double r, double g, double b, double a)
Zito gui.set_content_color (engine function engine.gui_set_content_color).

SetEnabled

public static void SetEnabled(bool enabled)
Zito gui.set_enabled (engine function engine.gui_set_enabled).

TextArea

public static string TextArea(double x, double y, double w, double h, string text)
Zito gui.text_area (engine function engine.gui_text_area).

TextField

public static string TextField(double x, double y, double w, double h, string text)
Zito gui.text_field (engine function engine.gui_text_field).

Toggle

public static bool Toggle(double x, double y, double w, double h, bool value, string text)
Zito gui.toggle (engine function engine.gui_toggle).

VerticalScrollbar

public static double VerticalScrollbar(double x, double y, double w, double h, double value, double size, double topVal, double bottomVal)
Zito gui.vertical_scrollbar (engine function engine.gui_vertical_scrollbar).

VerticalSlider

public static double VerticalSlider(double x, double y, double w, double h, double value, double topVal, double bottomVal)
Zito gui.vertical_slider (engine function engine.gui_vertical_slider).

Kaskade

GuilayoutApi

public static class GuilayoutApi
The engine functions of the Zito SDK unit, for C#.

BeginArea

public static void BeginArea(double x, double y, double w, double h)
Zito guilayout.begin_area (engine function engine.guilayout_begin_area).

BeginHorizontal

public static void BeginHorizontal()
Zito guilayout.begin_horizontal (engine function engine.guilayout_begin_horizontal).

BeginScrollView

public static EngineValue BeginScrollView(Vector2 scrollPosVec2, double w, double h)
Zito guilayout.begin_scroll_view (engine function engine.guilayout_begin_scroll_view).

BeginVertical

public static void BeginVertical()
Zito guilayout.begin_vertical (engine function engine.guilayout_begin_vertical).

Box

public static void Box(string text)
Zito guilayout.box (engine function engine.guilayout_box).

Button

public static bool Button(string text)
Zito guilayout.button (engine function engine.guilayout_button).

EndArea

public static void EndArea()
Zito guilayout.end_area (engine function engine.guilayout_end_area).

EndHorizontal

public static void EndHorizontal()
Zito guilayout.end_horizontal (engine function engine.guilayout_end_horizontal).

EndScrollView

public static void EndScrollView()
Zito guilayout.end_scroll_view (engine function engine.guilayout_end_scroll_view).

EndVertical

public static void EndVertical()
Zito guilayout.end_vertical (engine function engine.guilayout_end_vertical).

FlexibleSpace

public static void FlexibleSpace()
Zito guilayout.flexible_space (engine function engine.guilayout_flexible_space).

HorizontalSlider

public static double HorizontalSlider(double value, double leftVal, double rightVal)
Zito guilayout.horizontal_slider (engine function engine.guilayout_horizontal_slider).

Label

public static void Label(string text)
Zito guilayout.label (engine function engine.guilayout_label).

PasswordField

public static string PasswordField(string text, string mask)
Zito guilayout.password_field (engine function engine.guilayout_password_field).

RepeatButton

public static bool RepeatButton(string text)
Zito guilayout.repeat_button (engine function engine.guilayout_repeat_button).

Space

public static void Space(double pixels)
Zito guilayout.space (engine function engine.guilayout_space).

TextArea

public static string TextArea(string text)
Zito guilayout.text_area (engine function engine.guilayout_text_area).

TextField

public static string TextField(string text)
Zito guilayout.text_field (engine function engine.guilayout_text_field).

Toggle

public static bool Toggle(bool value, string text)
Zito guilayout.toggle (engine function engine.guilayout_toggle).

VerticalSlider

public static double VerticalSlider(double value, double topVal, double bottomVal)
Zito guilayout.vertical_slider (engine function engine.guilayout_vertical_slider).

Kaskade

InputApi

public static class InputApi
The engine functions of the Zito SDK unit, for C#.

CursorLocked

public static bool CursorLocked()
Zito input.cursor_locked (engine function engine.cursor_locked).

KeyDown

public static bool KeyDown(string key)
Zito input.key_down (engine function engine.key_down).

KeyPressed

public static bool KeyPressed(string key)
Zito input.key_pressed (engine function engine.key_pressed).

KeyReleased

public static bool KeyReleased(string key)
Zito input.key_released (engine function engine.key_released).

MouseDelta

public static EngineValue MouseDelta()
Zito input.mouse_delta (engine function engine.mouse_delta).

MouseDown

public static bool MouseDown(int button)
Zito input.mouse_down (engine function engine.mouse_down).

MousePosition

public static EngineValue MousePosition()
Zito input.mouse_position (engine function engine.mouse_position).

MousePressed

public static bool MousePressed(int button)
Zito input.mouse_pressed (engine function engine.mouse_pressed).

MouseReleased

public static bool MouseReleased(int button)
Zito input.mouse_released (engine function engine.mouse_released).

RawMouseDelta

public static EngineValue RawMouseDelta()
Zito input.raw_mouse_delta (engine function engine.raw_mouse_delta).

ScrollDelta

public static EngineValue ScrollDelta()
Zito input.scroll_delta (engine function engine.mouse_scroll_delta).

SetCursorLocked

public static void SetCursorLocked(bool locked)
Zito input.set_cursor_locked (engine function engine.set_cursor_locked).

Kaskade

MaterialApi

public static class MaterialApi
The engine functions of the Zito SDK unit, for C#.

Set

public static void Set(GameObject? entity, string name, EngineValue value)
Zito material.set (engine function engine.material_set).

SetInt

public static void SetInt(GameObject? entity, string name, int value)
Zito material.set_int (engine function engine.material_set_int).

SetKeyword

public static void SetKeyword(GameObject? entity, string keyword, bool enabled)
Zito material.set_keyword (engine function engine.material_set_keyword).

SetShader

public static void SetShader(GameObject? entity, string path)
Zito material.set_shader (engine function engine.material_set_shader).

Kaskade

NavigationApi

public static class NavigationApi
The engine functions of the Zito SDK unit, for C#.

LoadBaked

public static bool LoadBaked(string projectRelativePath)
Zito navigation.load_baked (engine function engine.navigation_load_baked).

Kaskade

PhysicsApi

public static class PhysicsApi
The engine functions of the Zito SDK unit, for C#.

AngularDamping

public static double AngularDamping(GameObject? entity)
Zito physics.angular_damping (engine function engine.physics_angular_damping).

AngularVelocity

public static Vector3 AngularVelocity(GameObject? entity)
Zito physics.angular_velocity (engine function engine.physics_angular_velocity).

ApplyForce

public static void ApplyForce(GameObject? entity, Vector3 forceVec3)
Zito physics.apply_force (engine function engine.physics_apply_force).

ApplyForceAtPosition

public static void ApplyForceAtPosition(GameObject? entity, Vector3 forceVec3, Vector3 worldPosVec3)
Zito physics.apply_force_at_position (engine function engine.physics_apply_force_at_position).

ApplyImpulse

public static void ApplyImpulse(GameObject? entity, Vector3 impulseVec3)
Zito physics.apply_impulse (engine function engine.physics_apply_impulse).

ApplyImpulseAtPosition

public static void ApplyImpulseAtPosition(GameObject? entity, Vector3 impulseVec3, Vector3 worldPosVec3)
Zito physics.apply_impulse_at_position (engine function engine.physics_apply_impulse_at_position).

ApplyTorque

public static void ApplyTorque(GameObject? entity, Vector3 torqueVec3)
Zito physics.apply_torque (engine function engine.physics_apply_torque).

ApplyTorqueImpulse

public static void ApplyTorqueImpulse(GameObject? entity, Vector3 torqueVec3)
Zito physics.apply_torque_impulse (engine function engine.physics_apply_torque_impulse).

GravityScale

public static double GravityScale(GameObject? entity)
Zito physics.gravity_scale (engine function engine.physics_gravity_scale).

IsAwake

public static bool IsAwake(GameObject? entity)
Zito physics.is_awake (engine function engine.physics_is_awake).

LinearDamping

public static double LinearDamping(GameObject? entity)
Zito physics.linear_damping (engine function engine.physics_linear_damping).

LinearVelocity

public static Vector3 LinearVelocity(GameObject? entity)
Zito physics.linear_velocity (engine function engine.physics_linear_velocity).

Mass

public static double Mass(GameObject? entity)
Zito physics.mass (engine function engine.physics_mass).

Raycast

public static EngineValue Raycast(Vector3 originVec3, Vector3 directionVec3, double maxDist)
Zito physics.raycast (engine function engine.physics_raycast).

SetAngularDamping

public static void SetAngularDamping(GameObject? entity, double damping)
Zito physics.set_angular_damping (engine function engine.physics_set_angular_damping).

SetAngularVelocity

public static void SetAngularVelocity(GameObject? entity, Vector3 angularVelocityVec3)
Zito physics.set_angular_velocity (engine function engine.physics_set_angular_velocity).

SetAwake

public static void SetAwake(GameObject? entity, bool awake)
Zito physics.set_awake (engine function engine.physics_set_awake).

SetEnabled

public static void SetEnabled(GameObject? entity, bool enabled)
Zito physics.set_enabled (engine function engine.physics_set_enabled).

SetGravityScale

public static void SetGravityScale(GameObject? entity, double scale)
Zito physics.set_gravity_scale (engine function engine.physics_set_gravity_scale).

SetKinematic

public static void SetKinematic(GameObject? entity, bool kinematic)
Zito physics.set_kinematic (engine function engine.physics_set_kinematic).

SetLinearDamping

public static void SetLinearDamping(GameObject? entity, double damping)
Zito physics.set_linear_damping (engine function engine.physics_set_linear_damping).

SetLinearVelocity

public static void SetLinearVelocity(GameObject? entity, Vector3 velocityVec3)
Zito physics.set_linear_velocity (engine function engine.physics_set_linear_velocity).

SetMass

public static void SetMass(GameObject? entity, double mass)
Zito physics.set_mass (engine function engine.physics_set_mass).

SetTargetTransform

public static void SetTargetTransform(GameObject? entity, Vector3 posVec3, Quaternion rotQuat, double timeStep)
Zito physics.set_target_transform (engine function engine.physics_set_target_transform).

SetTransform

public static void SetTransform(GameObject? entity, Vector3 posVec3, Quaternion rotQuat)
Zito physics.set_transform (engine function engine.physics_set_transform).

Kaskade

PrefsApi

public static class PrefsApi
The engine functions of the Zito SDK unit, for C#.

Delete

public static void Delete(string key)
Zito prefs.delete (engine function engine.prefs_delete).

DeleteAll

public static void DeleteAll()
Zito prefs.delete_all (engine function engine.prefs_delete_all).

GetString

public static string GetString(string key, string fallback)
Zito prefs.get_string (engine function engine.prefs_get_string).

Has

public static bool Has(string key)
Zito prefs.has (engine function engine.prefs_has).

Save

public static bool Save()
Zito prefs.save (engine function engine.prefs_save).

SetFloat

public static void SetFloat(string key, double value)
Zito prefs.set_float (engine function engine.prefs_set_float).

SetInt

public static void SetInt(string key, int value)
Zito prefs.set_int (engine function engine.prefs_set_int).

SetString

public static void SetString(string key, string value)
Zito prefs.set_string (engine function engine.prefs_set_string).

Kaskade

RenderTextureApi

public static class RenderTextureApi
The engine functions of the Zito SDK unit, for C#.

Create

public static void Create(string name, int width, int height, string format, bool randomWrite)
Zito render_texture.create (engine function engine.render_texture_create).

Release

public static void Release(string name)
Zito render_texture.release (engine function engine.render_texture_release).

Kaskade

SceneApi

public static class SceneApi
The engine functions of the Zito SDK unit, for C#.

ActiveSceneName

public static string ActiveSceneName()
Zito scene.active_scene_name (engine function engine.active_scene_name).

Alive

public static bool Alive(Scene sceneHandle)
Zito scene.alive (engine function engine.scene_alive).

FindObject

public static GameObject? FindObject(Scene sceneHandle, string objectName)
Zito scene.find_object (engine function engine.find_object).

KeepAlive

public static void KeepAlive(GameObject? entity)
Zito scene.keep_alive (engine function engine.scene_keep_alive).

Load

public static void Load(string scenePath)
Zito scene.load (engine function engine.scene_load).

LoadAdditive

public static EngineValue LoadAdditive(string scenePath)
Zito scene.load_additive (engine function engine.scene_load_additive).

Name

public static string Name(Scene sceneHandle)
Zito scene.name (engine function engine.scene_name).

ObjectAt

public static GameObject? ObjectAt(Scene sceneHandle, int index)
Zito scene.object_at (engine function engine.scene_object_at).

ObjectCount

public static int ObjectCount(Scene sceneHandle)
Zito scene.object_count (engine function engine.scene_object_count).

RootAt

public static GameObject? RootAt(Scene sceneHandle, int index)
Zito scene.root_at (engine function engine.scene_root_at).

RootCount

public static int RootCount(Scene sceneHandle)
Zito scene.root_count (engine function engine.scene_root_count).

Unload

public static void Unload(Scene sceneHandle)
Zito scene.unload (engine function engine.scene_unload).

Kaskade

SettingsApi

public static class SettingsApi
The engine functions of the Zito SDK unit, for C#.

Resolutions

public static EngineValue Resolutions()
Zito settings.resolutions (engine function engine.settings_resolutions).

Save

public static bool Save()
Zito settings.save (engine function engine.settings_save).

Set

public static void Set(string key, EngineValue value)
Zito settings.set (engine function engine.settings_set).

Kaskade

ShaderApi

public static class ShaderApi
The engine functions of the Zito SDK unit, for C#.

SetGlobal

public static void SetGlobal(string name, EngineValue value)
Zito shader.set_global (engine function engine.shader_set_global).

Kaskade

SpatialApi

public static class SpatialApi
The engine functions of the Zito SDK unit, for C#.

CastRay

public static bool CastRay(Vector3 originVec3, Vector3 directionVec3, double maxDist, int layerMask)
Zito spatial.cast_ray (engine function engine.spatial_cast_ray).

CastRayDetailed

public static EngineValue CastRayDetailed(EngineValue rayObj, double maxDist, int layerMask)
Zito spatial.cast_ray_detailed (engine function engine.spatial_cast_ray_detailed).

CheckBox

public static bool CheckBox(Vector3 centerVec3, Vector3 halfExtentsVec3, Quaternion rotationQuat, int layerMask)
Zito spatial.check_box (engine function engine.spatial_check_box).

CheckSphere

public static bool CheckSphere(Vector3 centerVec3, double radius, int layerMask)
Zito spatial.check_sphere (engine function engine.spatial_check_sphere).

ClosestPointOnCollider

public static EngineValue ClosestPointOnCollider(GameObject? entity, Vector3 targetPointVec3)
Zito spatial.closest_point_on_collider (engine function engine.spatial_closest_point_on_collider).

GatherInBox

public static EngineValue GatherInBox(Vector3 centerVec3, Vector3 halfExtentsVec3, Quaternion rotationQuat, int layerMask)
Zito spatial.gather_in_box (engine function engine.spatial_gather_in_box).

GatherInSphere

public static EngineValue GatherInSphere(Vector3 centerVec3, double radius, int layerMask)
Zito spatial.gather_in_sphere (engine function engine.spatial_gather_in_sphere).

LineOfSight

public static bool LineOfSight(GameObject? sourceEntity, GameObject? targetEntity, int obstructionMask)
Zito spatial.line_of_sight (engine function engine.spatial_line_of_sight).

RaycastAll

public static EngineValue RaycastAll(Vector3 originVec3, Vector3 directionVec3, double maxDist, int layerMask)
Zito spatial.raycast_all (engine function engine.spatial_raycast_all).

SweepBox

public static EngineValue SweepBox(Vector3 centerVec3, Vector3 halfExtentsVec3, Quaternion rotationQuat, Vector3 directionVec3, double maxDist, int layerMask)
Zito spatial.sweep_box (engine function engine.spatial_sweep_box).

SweepCapsule

public static EngineValue SweepCapsule(Vector3 centerVec3, double radius, double halfHeight, Quaternion rotationQuat, Vector3 directionVec3, double maxDist, int layerMask)
Zito spatial.sweep_capsule (engine function engine.spatial_sweep_capsule).

SweepSphere

public static EngineValue SweepSphere(Vector3 centerVec3, double radius, Vector3 directionVec3, double maxDist, int layerMask)
Zito spatial.sweep_sphere (engine function engine.spatial_sweep_sphere).

Kaskade

TimeApi

public static class TimeApi
The engine functions of the Zito SDK unit, for C#.

CreateTimer

public static EngineValue CreateTimer(double durationSeconds)
Zito time.create_timer (engine function engine.create_timer).

DeltaTime

public static double DeltaTime()
Zito time.delta_time (engine function engine.delta_time).

Elapsed

public static double Elapsed()
Zito time.elapsed (engine function engine.elapsed_time).

FixedDeltaTime

public static double FixedDeltaTime()
Zito time.fixed_delta_time (engine function engine.fixed_delta_time).

FrameCount

public static EngineValue FrameCount()
Zito time.frame_count (engine function engine.frame_count).

SetTimeScale

public static void SetTimeScale(double scale)
Zito time.set_time_scale (engine function engine.set_time_scale).

TimeScale

public static double TimeScale()
Zito time.time_scale (engine function engine.time_scale).

UnscaledDeltaTime

public static double UnscaledDeltaTime()
Zito time.unscaled_delta_time (engine function engine.unscaled_delta_time).

Kaskade

TransformApi

public static class TransformApi
The engine functions of the Zito SDK unit, for C#.

EulerAngles

public static Vector3 EulerAngles(GameObject? entity)
Zito transform.euler_angles (engine function engine.world_rotation_euler).

Forward

public static Vector3 Forward(GameObject? entity)
Zito transform.forward (engine function engine.forward).

LocalEulerAngles

public static Vector3 LocalEulerAngles(GameObject? entity)
Zito transform.local_euler_angles (engine function engine.local_rotation_euler).

LocalPosition

public static Vector3 LocalPosition(GameObject? entity)
Zito transform.local_position (engine function engine.local_position).

LocalRotation

public static Quaternion LocalRotation(GameObject? entity)
Zito transform.local_rotation (engine function engine.local_rotation_quaternion).

LocalScale

public static Vector3 LocalScale(GameObject? entity)
Zito transform.local_scale (engine function engine.local_scale).

Position

public static Vector3 Position(GameObject? entity)
Zito transform.position (engine function engine.world_position).

Right

public static Vector3 Right(GameObject? entity)
Zito transform.right (engine function engine.right).

Rotation

public static Quaternion Rotation(GameObject? entity)
Zito transform.rotation (engine function engine.world_rotation_quaternion).

Scale

public static Vector3 Scale(GameObject? entity)
Zito transform.scale (engine function engine.world_scale).

Self

public static GameObject? Self()
Zito transform.self (engine function engine.self_entity).

Up

public static Vector3 Up(GameObject? entity)
Zito transform.up (engine function engine.up).

Kaskade

UiApi

public static class UiApi
The engine functions of the Zito SDK unit, for C#.

Alpha

public static void Alpha(double a)
Zito ui.alpha (engine function engine.ui_push_alpha).

Button

public static bool Button(string id, double x, double y, double w, double h, string label)
Zito ui.button (engine function engine.ui_button).

Capture

public static void Capture(bool captured)
Zito ui.capture (engine function engine.ui_capture).

Captured

public static bool Captured()
Zito ui.captured (engine function engine.ui_captured).

Clicked

public static bool Clicked(double x, double y, double w, double h)
Zito ui.clicked (engine function engine.ui_clicked).

Clip

public static void Clip(double x, double y, double w, double h)
Zito ui.clip (engine function engine.ui_push_clip).

Ease

public static double Ease(EngineValue ease, double t)
Zito ui.ease (engine function engine.ui_ease).

ElementClicked

public static bool ElementClicked(string name)
Zito ui.element_clicked (engine function engine.ui_element_clicked).

Font

public static int Font(string path)
Zito ui.font (engine function engine.ui_font).

Held

public static bool Held(double x, double y, double w, double h)
Zito ui.held (engine function engine.ui_held).

Hovered

public static bool Hovered(double x, double y, double w, double h)
Zito ui.hovered (engine function engine.ui_hovered).

ImageSize

public static EngineValue ImageSize(string path)
Zito ui.image_size (engine function engine.ui_image_size).

KeyDown

public static bool KeyDown(string key)
Zito ui.key_down (engine function engine.ui_key_down).

KeyPressed

public static bool KeyPressed(string key)
Zito ui.key_pressed (engine function engine.ui_key_pressed).

MeasureEx

public static EngineValue MeasureEx(double size, string s, int font, double wrap)
Zito ui.measure_ex (engine function engine.ui_measure).

Mix

public static EngineValue Mix(EngineValue a, EngineValue b, double t)
Zito ui.mix (engine function engine.ui_mix).

Progress

public static void Progress(double x, double y, double w, double h, double t)
Zito ui.progress (engine function engine.ui_progress).

Rgba

public static EngineValue Rgba(double r, double g, double b, double a)
Zito ui.rgba (engine function engine.ui_color).

Slider

public static double Slider(string id, double x, double y, double w, double value, double min, double max)
Zito ui.slider (engine function engine.ui_slider).

Snap

public static void Snap(string id, double value)
Zito ui.snap (engine function engine.ui_snap).

Spring

public static double Spring(string id, double target, double stiffness, double damping)
Zito ui.spring (engine function engine.ui_spring).

Stats

public static EngineValue Stats()
Zito ui.stats (engine function engine.ui_stats).

Theme

public static void Theme(EngineValue button, EngineValue hover, EngineValue border, EngineValue accent, EngineValue text, EngineValue shadow, double radius, double textSize)
Zito ui.theme (engine function engine.ui_set_theme).

Time

public static double Time()
Zito ui.time (engine function engine.ui_time).

Toggle

public static bool Toggle(string id, double x, double y, bool value)
Zito ui.toggle (engine function engine.ui_toggle).

Tween

public static double Tween(string id, double target, double duration, EngineValue ease)
Zito ui.tween (engine function engine.ui_tween).

TweenFrom

public static double TweenFrom(string id, double initial, double target, double duration, EngineValue ease)
Zito ui.tween_from (engine function engine.ui_tween_from).

Unalpha

public static void Unalpha()
Zito ui.unalpha (engine function engine.ui_pop_alpha).

Unclip

public static void Unclip()
Zito ui.unclip (engine function engine.ui_pop_clip).

UnityEngine.InputSystem.Controls

ButtonControl

public class ButtonControl
Unity Input System button: a key or a mouse button, over Input.

isPressed

public bool isPressed { get; }
Held this frame.

wasPressedThisFrame

public bool wasPressedThisFrame { get; }
Went down this frame.

wasReleasedThisFrame

public bool wasReleasedThisFrame { get; }
Went up this frame.

ReadValue

public float ReadValue()
1 when held, 0 otherwise.

UnityEngine

Color

public struct Color
Unity-compatible Color: same as Color, converting to and from it implicitly.

Color

public Color()
Creates a default instance of Color.

Color

public Color(float r, float g, float b, float a = 1)
A colour from red, green, blue and alpha (0..1).

a

public float a
Alpha (opacity), 0..1.

b

public float b
Blue, 0..1.

g

public float g
Green, 0..1.

r

public float r
Red, 0..1.

black

public static Color black { get; }
Solid black.

blue

public static Color blue { get; }
Solid blue.

clear

public static Color clear { get; }
Fully transparent black.

cyan

public static Color cyan { get; }
Solid cyan.

gray

public static Color gray { get; }
Middle grey.

green

public static Color green { get; }
Solid green.

grey

public static Color grey { get; }
Middle grey.

magenta

public static Color magenta { get; }
Solid magenta.

red

public static Color red { get; }
Solid red.

white

public static Color white { get; }
Solid white.

yellow

public static Color yellow { get; }
Unity's yellow (1, 0.92, 0.016).

Equals

public override bool Equals(object? obj)
Overrides bool ValueType.Equals(object? obj).

GetHashCode

public override int GetHashCode()
Overrides int ValueType.GetHashCode().

ToString

public override string ToString()
Overrides string? ValueType.ToString().

operator +

public static Color operator +(Color a, Color b)
Component-wise sum.

operator ==

public static bool operator ==(Color lhs, Color rhs)
Whether all four components are equal.

implicit operator Color

public static implicit operator Color(Color c)
Converts between the Unity-compatible and the Kaskade type.

implicit operator Color

public static implicit operator Color(Color c)
Converts between the Unity-compatible and the Kaskade type.

operator !=

public static bool operator !=(Color lhs, Color rhs)
Whether any component differs.

operator *

public static Color operator *(Color a, float b)
Component-wise product, or every component scaled.

operator *

public static Color operator *(Color a, Color b)
Component-wise product, or every component scaled.

operator -

public static Color operator -(Color a, Color b)
Component-wise difference.

UnityEngine

GUI

public static class GUI
Unity-compatible GUI: same as GUI, converting to and from it implicitly.

backgroundColor

public static Color backgroundColor { get; set; }
Tint of control backgrounds drawn after it.

color

public static Color color { get; set; }
Tint of everything drawn after it (Unity's GUI.color).

contentColor

public static Color contentColor { get; set; }
Tint of control text and icons drawn after it.

enabled

public static bool enabled { get; set; }
Whether the controls drawn after it react to input (false greys them out).

Box

public static void Box(Rect position, string text)
Draws a framed box with an optional title.

Button

public static bool Button(Rect position, string text)
Draws a button. Returns true on the frame it is clicked.

HorizontalScrollbar

public static float HorizontalScrollbar(Rect position, float value, float size, float leftValue, float rightValue)
Draws a horizontal scroll bar. Returns the new scroll value.

HorizontalSlider

public static float HorizontalSlider(Rect position, float value, float leftValue, float rightValue)
Draws a horizontal slider between two values. Returns the new value.

Label

public static void Label(Rect position, string text)
Draws text in a rectangle (screen pixels from the top-left).

PasswordField

public static string PasswordField(Rect position, string password, char mask = '*', int maxLength = 256)
Draws a text box that shows every character as the mask. Returns the edited text.

RepeatButton

public static bool RepeatButton(Rect position, string text)
Draws a button. Returns true every frame while it is held.

TextArea

public static string TextArea(Rect position, string text, int maxLength = 1024)
Draws a multi-line text box. Returns the edited text.

TextField

public static string TextField(Rect position, string text, int maxLength = 256)
Draws a one-line text box. Returns the edited text.

Toggle

public static bool Toggle(Rect position, bool value, string text)
Draws a check box. Returns its new state.

VerticalScrollbar

public static float VerticalScrollbar(Rect position, float value, float size, float topValue, float bottomValue)
Draws a vertical scroll bar. Returns the new scroll value.

VerticalSlider

public static float VerticalSlider(Rect position, float value, float topValue, float bottomValue)
Draws a vertical slider between two values. Returns the new value.

UnityEngine

GUILayout

public static class GUILayout
Unity-compatible GUILayout: same as GUILayout, converting to and from it implicitly.

BeginArea

public static void BeginArea(Rect screenRect)
Lays out the controls until EndArea inside a screen rectangle.

BeginHorizontal

public static void BeginHorizontal()
Starts a row: the controls until EndHorizontal sit side by side.

BeginScrollView

public static Vector2 BeginScrollView(Vector2 scrollPosition, float width = 0, float height = 0)
Starts a scrolling region (0 width/height: as large as the content allows). Returns the new scroll position.

BeginVertical

public static void BeginVertical()
Starts a column: the controls until EndVertical sit one below the other.

Box

public static void Box(string text)
A framed box in the current layout group.

Button

public static bool Button(string text)
A button in the current layout group. Returns true on the frame it is clicked.

EndArea

public static void EndArea()
Ends the area started by BeginArea.

EndHorizontal

public static void EndHorizontal()
Ends the row started by BeginHorizontal.

EndScrollView

public static void EndScrollView()
Ends the region started by BeginScrollView.

EndVertical

public static void EndVertical()
Ends the column started by BeginVertical.

FlexibleSpace

public static void FlexibleSpace()
Space that takes up whatever room is left in the current group.

HorizontalSlider

public static float HorizontalSlider(float value, float leftValue, float rightValue)
A horizontal slider in the current layout group. Returns the new value.

Label

public static void Label(string text)
A text line in the current layout group.

PasswordField

public static string PasswordField(string password, char mask = '*', int maxLength = 256)
A masked text box in the current layout group. Returns the edited text.

RepeatButton

public static bool RepeatButton(string text)
A button in the current layout group. Returns true every frame while it is held.

Space

public static void Space(float pixels)
Empty space of a number of pixels along the current group.

TextArea

public static string TextArea(string text, int maxLength = 1024)
A multi-line text box in the current layout group. Returns the edited text.

TextField

public static string TextField(string text, int maxLength = 256)
A one-line text box in the current layout group. Returns the edited text.

Toggle

public static bool Toggle(bool value, string text)
A check box in the current layout group. Returns its new state.

VerticalSlider

public static float VerticalSlider(float value, float topValue, float bottomValue)
A vertical slider in the current layout group. Returns the new value.

UnityEngine.InputSystem.Controls

KeyControl

public sealed class KeyControl

Inherits ButtonControl

Unity Input System keyboard key.

UnityEngine.InputSystem

Keyboard

public sealed class Keyboard
Unity Input System keyboard: the keys JAMGAME-style scripts use, by engine key name.

Keyboard

public Keyboard()
Creates a default instance of Keyboard.

aKey

public KeyControl aKey { get; }
The A key.

bKey

public KeyControl bKey { get; }
The B key.

backspaceKey

public KeyControl backspaceKey { get; }
The Backspace key.

cKey

public KeyControl cKey { get; }
The C key.

current

public static Keyboard current { get; }
The keyboard (always present).

dKey

public KeyControl dKey { get; }
The D key.

eKey

public KeyControl eKey { get; }
The E key.

enterKey

public KeyControl enterKey { get; }
The Enter key.

escapeKey

public KeyControl escapeKey { get; }
The Escape key.

f8Key

public KeyControl f8Key { get; }
The F8 key.

f9Key

public KeyControl f9Key { get; }
The F9 key.

fKey

public KeyControl fKey { get; }
The F key.

gKey

public KeyControl gKey { get; }
The G key.

leftCtrlKey

public KeyControl leftCtrlKey { get; }
The Left Ctrl key.

leftShiftKey

public KeyControl leftShiftKey { get; }
The Left Shift key.

numpadEnterKey

public KeyControl numpadEnterKey { get; }
The numeric keypad Enter key.

qKey

public KeyControl qKey { get; }
The Q key.

rKey

public KeyControl rKey { get; }
The R key.

sKey

public KeyControl sKey { get; }
The S key.

spaceKey

public KeyControl spaceKey { get; }
The Space key.

tabKey

public KeyControl tabKey { get; }
The Tab key.

wKey

public KeyControl wKey { get; }
The W key.

UnityEngine.InputSystem

Mouse

public sealed class Mouse
Unity Input System mouse.

Mouse

public Mouse()
Creates a default instance of Mouse.

current

public static Mouse current { get; }
The mouse (always present).

delta

public Vector2Control delta { get; }
Mouse movement reported for the current frame.

leftButton

public ButtonControl leftButton { get; }
The primary mouse button (index 0).

middleButton

public ButtonControl middleButton { get; }
The middle mouse button (index 2).

position

public Vector2Control position { get; }
Cursor position in window pixels from the top-left.

rightButton

public ButtonControl rightButton { get; }
The secondary mouse button (index 1).

scroll

public Vector2Control scroll { get; }
Mouse wheel movement reported for the current frame.

UnityEngine.AI

NavMesh

public static class NavMesh
Unity compatibility wrapper for NavMesh static API.

Bake

public static void Bake()
Bakes the active NavMesh using default or pending scene geometry.
Usually baked once in the editor (Navigation tab) and loaded with the scene.

CalculatePath

public static bool CalculatePath(Vector3 source, Vector3 target, NavMeshPath path)
Calculates a path between two points and writes waypoints to the provided path object.
Returns false when no path exists.

FindPath

public static Vector3[] FindPath(Vector3 start, Vector3 end)
Finds a path between two points and returns the array of waypoints.
Returns The waypoints, empty when no path exists.

UnityEngine.AI

NavMeshAgent

public class NavMeshAgent

Inherits NavMeshAgent

Unity compatibility wrapper for NavMeshAgent.

NavMeshAgent

public NavMeshAgent()
Creates a default instance of NavMeshAgent.

UnityEngine.AI

NavMeshPath

public class NavMeshPath

Inherits NavMeshPath

Unity compatibility wrapper for NavMeshPath.

NavMeshPath

public NavMeshPath()
Creates a default instance of NavMeshPath.

UnityEngine

Rect

public struct Rect
Unity-compatible Rect: same as Rect, converting to and from it implicitly.

Rect

public Rect()
Creates a default instance of Rect.

Rect

public Rect(float x, float y, float width, float height)
A rectangle from its top-left corner and size.

Rect

public Rect(Vector2 position, Vector2 size)
A rectangle from its top-left corner and size.

height

public float height
Height.

width

public float width
Width.

x

public float x
Left edge.

y

public float y
Top edge.

center

public Vector2 center { get; set; }
Centre point.

max

public Vector2 max { get; set; }
Bottom-right corner (xMax, yMax).

min

public Vector2 min { get; set; }
Top-left corner (xMin, yMin).

position

public Vector2 position { get; set; }
Top-left corner.

size

public Vector2 size { get; set; }
Width and height.

xMax

public float xMax { get; set; }
Right edge.

xMin

public float xMin { get; set; }
Left edge (moving it keeps the right edge).

yMax

public float yMax { get; set; }
Bottom edge.

yMin

public float yMin { get; set; }
Top edge (moving it keeps the bottom edge).

zero

public static Rect zero { get; }
The empty rectangle at the origin.

Contains

public bool Contains(Vector2 point)
Whether a point lies inside (right and bottom edges excluded).

Equals

public override bool Equals(object? obj)
Overrides bool ValueType.Equals(object? obj).

GetHashCode

public override int GetHashCode()
Overrides int ValueType.GetHashCode().

Overlaps

public bool Overlaps(Rect other)
Whether two rectangles intersect.

ToString

public override string ToString()
Overrides string? ValueType.ToString().

operator ==

public static bool operator ==(Rect lhs, Rect rhs)
Whether position and size are equal.

implicit operator Rect

public static implicit operator Rect(Rect r)
Converts between the Unity-compatible and the Kaskade type.

implicit operator Rect

public static implicit operator Rect(Rect r)
Converts between the Unity-compatible and the Kaskade type.

operator !=

public static bool operator !=(Rect lhs, Rect rhs)
Whether position or size differ.

UnityEngine

Vector2

public struct Vector2
Unity-compatible Vector2: same as Vector2, converting to and from it implicitly.

Vector2

public Vector2()
Creates a default instance of Vector2.

Vector2

public Vector2(float x, float y)
A vector from its two components.

x

public float x
Horizontal component.

y

public float y
Vertical component.

down

public static Vector2 down { get; }
(0, -1).

left

public static Vector2 left { get; }
(-1, 0).

one

public static Vector2 one { get; }
(1, 1).

right

public static Vector2 right { get; }
(1, 0).

up

public static Vector2 up { get; }
(0, 1).

zero

public static Vector2 zero { get; }
(0, 0).

Equals

public override bool Equals(object? obj)
Overrides bool ValueType.Equals(object? obj).

GetHashCode

public override int GetHashCode()
Overrides int ValueType.GetHashCode().

ToString

public override string ToString()
Overrides string? ValueType.ToString().

operator +

public static Vector2 operator +(Vector2 a, Vector2 b)
Component-wise sum.

operator /

public static Vector2 operator /(Vector2 a, float d)
The vector divided by a number.

operator ==

public static bool operator ==(Vector2 a, Vector2 b)
Whether both components are equal.

implicit operator Vector2

public static implicit operator Vector2(Vector2 v)
Converts between the Unity-compatible and the Kaskade type.

implicit operator Vector2

public static implicit operator Vector2(Vector2 v)
Converts between the Unity-compatible and the Kaskade type.

operator !=

public static bool operator !=(Vector2 a, Vector2 b)
Whether a component differs.

operator *

public static Vector2 operator *(Vector2 a, float d)
The vector scaled by a number.

operator -

public static Vector2 operator -(Vector2 a, Vector2 b)
Component-wise difference.

UnityEngine.InputSystem.Controls

Vector2Control

public sealed class Vector2Control
Unity Input System 2D value (mouse position, delta, scroll).

ReadValue

public Vector2 ReadValue()
The current value.

Kaskade.Interop

AbiValue

public struct AbiValue
A value crossing the native boundary. Interop detail used by generated code.

AbiValue

public AbiValue()
Creates a default instance of AbiValue.

Data

public ulong* Data
Four 64-bit words storing the tag-dependent payload.

Flags

public uint Flags
Flags reserved for the interop protocol.

Tag

public AbiValueTag Tag
Discriminator for the payload.

Data0

public double Data0 { get; set; }
The first payload word interpreted as an IEEE 754 double.

Kaskade.Interop

AbiValueTag

public enum AbiValueTag : uint
Kind of an AbiValue. Interop detail used by generated code.

Array

Array = 13
Slice of ABI values.

Bool

Bool = 1
Boolean.

Component

Component = 8
Component handle.

Entity

Entity = 7
Engine object handle.

F32

F32 = 4
32-bit floating-point value.

F64

F64 = 5
64-bit floating-point value.

I32

I32 = 2
Signed 32-bit integer.

I64

I64 = 3
Signed 64-bit integer.

Null

Null = 0
Absent value.

Quaternion

Quaternion = 12
Quaternion rotation.

Scene

Scene = 9
Scene handle.

Utf8

Utf8 = 6
UTF-8 byte slice.

Vec2

Vec2 = 10
Two-component vector.

Vec3

Vec3 = 11
Three-component vector.

Kaskade

BehaviourLifecycleMask

public enum BehaviourLifecycleMask : uint
Lifecycle callbacks implemented by a generated behaviour type.

None

None = 0
No lifecycle callbacks are overridden.

Kaskade

BehaviourMetadata

public readonly readonly struct BehaviourMetadata

Implements IEquatable<BehaviourMetadata>

Stable compile-time metadata for one C# gameplay component.
TypeIdLow Low 64 bits of the persistent type ID.
TypeIdHigh High 64 bits of the persistent type ID.
TypeName Fully qualified managed type name.
LifecycleMask Callbacks declared by this behaviour type.

BehaviourMetadata

public BehaviourMetadata()
Creates a default instance of BehaviourMetadata.

BehaviourMetadata

public BehaviourMetadata(ulong TypeIdLow, ulong TypeIdHigh, string TypeName, BehaviourLifecycleMask LifecycleMask)
Stable compile-time metadata for one C# gameplay component.
TypeIdLow Low 64 bits of the persistent type ID.
TypeIdHigh High 64 bits of the persistent type ID.
TypeName Fully qualified managed type name.
LifecycleMask Callbacks declared by this behaviour type.

LifecycleMask

public BehaviourLifecycleMask LifecycleMask { get; init; }
Callbacks declared by this behaviour type.

TypeIdHigh

public ulong TypeIdHigh { get; init; }
High 64 bits of the persistent type ID.

TypeIdLow

public ulong TypeIdLow { get; init; }
Low 64 bits of the persistent type ID.

TypeName

public string TypeName { get; init; }
Fully qualified managed type name.

Deconstruct

public void Deconstruct(out ulong TypeIdLow, out ulong TypeIdHigh, out string TypeName, out BehaviourLifecycleMask LifecycleMask)
Copies the positional values into the output parameters.

Equals

public bool Equals(BehaviourMetadata other)
Checks equality using the record's data.

Equals

public override bool Equals(object obj)
Checks equality using the record's data.

GetHashCode

public override int GetHashCode()
Returns a hash of the record's data.

ToString

public override string ToString()
Returns a string representation of the record.

operator ==

public static bool operator ==(BehaviourMetadata left, BehaviourMetadata right)
Checks equality using the record's data.

operator !=

public static bool operator !=(BehaviourMetadata left, BehaviourMetadata right)
Checks whether the records differ.

Kaskade

EngineValue

public readonly readonly struct EngineValue
A value passed to or returned by an engine function, the same values Zito scripts use: numbers, strings, booleans and arrays (vectors are [x, y, z], objects are handles).

EngineValue

public EngineValue()
Creates a default instance of EngineValue.

AsArray

public EngineValue[] AsArray { get; }
Gets the items of an array (empty when it is not one).

AsBool

public bool AsBool { get; }
Gets the value as a boolean (numbers are true when non-zero).

AsColor

public Color AsColor { get; }
Gets an [r, g, b, a] array as a colour.

AsDouble

public double AsDouble { get; }
Gets the value as a double.

AsFloat

public float AsFloat { get; }
Gets the value as a float.

AsGameObject

public GameObject? AsGameObject { get; }
Gets an object handle as a game object.

AsInt

public int AsInt { get; }
Gets the value as an integer.

AsLong

public long AsLong { get; }
Gets the value as a 64-bit integer.

AsQuaternion

public Quaternion AsQuaternion { get; }
Gets an [x, y, z, w] array as a rotation.

AsScene

public Scene AsScene { get; }
Gets a scene handle as a scene.

AsString

public string AsString { get; }
Gets the value as a string (empty when it is not one).

AsVector2

public Vector2 AsVector2 { get; }
Gets an [x, y] array as a vector.

AsVector3

public Vector3 AsVector3 { get; }
Gets an [x, y, z] array as a vector.

Count

public int Count { get; }
Gets the number of items of an array.

IsNull

public bool IsNull { get; }
Gets whether this is null.

Kind

public EngineValueKind Kind { get; }
Gets the kind of the value.

Null

public static EngineValue Null { get; }
Gets the null value.

Indexer

public EngineValue this[int index] { get; }
Gets an item of an array (null when out of range).

ToString

public override string ToString()
Overrides string? ValueType.ToString().

implicit operator EngineValue

public static implicit operator EngineValue(Color value)
A colour as the Zito SDK's [r, g, b, a].

implicit operator EngineValue

public static implicit operator EngineValue(EngineValue[] items)
An array.

implicit operator EngineValue

public static implicit operator EngineValue(GameObject? value)
An object handle (0 for none).

implicit operator EngineValue

public static implicit operator EngineValue(Quaternion value)
A rotation as the Zito SDK's [x, y, z, w].

implicit operator EngineValue

public static implicit operator EngineValue(Scene value)
A scene handle.

implicit operator EngineValue

public static implicit operator EngineValue(Vector2 value)
A vector as the Zito SDK's [x, y].

implicit operator EngineValue

public static implicit operator EngineValue(Vector3 value)
A vector as the Zito SDK's [x, y, z].

implicit operator EngineValue

public static implicit operator EngineValue(bool value)
A boolean.

implicit operator EngineValue

public static implicit operator EngineValue(double value)
A number.

implicit operator EngineValue

public static implicit operator EngineValue(int value)
An integer.

implicit operator EngineValue

public static implicit operator EngineValue(long value)
An integer (also object handles).

implicit operator EngineValue

public static implicit operator EngineValue(float value)
A number.

implicit operator EngineValue

public static implicit operator EngineValue(string? value)
A string (null stays null).

Kaskade

EngineValueKind

public enum EngineValueKind : byte
The kind of an EngineValue.

Array

Array = 5
A list of values (also vectors, colours and quaternions).

Bool

Bool = 1
A boolean.

Float

Float = 3
A double.

Int

Int = 2
A 64-bit integer (also object and component handles).

Null

Null = 0
No value.

String

String = 4
A string.

Kaskade

FieldCodec

public static class FieldCodec
Converts serialized field values to and from JSON for scenes and the editor (used by generated code). Vectors and colours are number arrays, objects {"index": i, "generation": g}, enums their member name.

TryRead

public static bool TryRead<T>(JsonNode? node, out T value)
Reads a JSON value into a field of type T.

Write

public static JsonNode? Write<T>(T value)
A field value as JSON.

Kaskade

FieldMetadata

public sealed record FieldMetadata

Implements IEquatable<FieldMetadata>

An inspector-visible serialized field of a C# component.
Name The C# field name.
Kind int, float, bool, string, vec2, vec3, color, entity, asset, enum or array.
Element The kind of an array's elements.
Min Slider minimum from RangeAttribute.
Max Slider maximum from RangeAttribute.
Tooltip From TooltipAttribute.
Header From HeaderAttribute.
Asset From AssetAttribute.
Options Enum member names.
Space Gap above the field from SpaceAttribute, in pixels.

FieldMetadata

public FieldMetadata(string Name, string Kind, string? Element = null, double? Min = null, double? Max = null, string? Tooltip = null, string? Header = null, string? Asset = null, IReadOnlyList<string>? Options = null, double? Space = null)
An inspector-visible serialized field of a C# component.
Name The C# field name.
Kind int, float, bool, string, vec2, vec3, color, entity, asset, enum or array.
Element The kind of an array's elements.
Min Slider minimum from RangeAttribute.
Max Slider maximum from RangeAttribute.
Tooltip From TooltipAttribute.
Header From HeaderAttribute.
Asset From AssetAttribute.
Options Enum member names.
Space Gap above the field from SpaceAttribute, in pixels.

Element

public string? Element { get; init; }
The kind of an array's elements.

Kind

public string Kind { get; init; }
int, float, bool, string, vec2, vec3, color, entity, asset, enum or array.

Max

public double? Max { get; init; }
Slider maximum from RangeAttribute.

Min

public double? Min { get; init; }
Slider minimum from RangeAttribute.

Name

public string Name { get; init; }
The C# field name.

Options

public IReadOnlyList<string>? Options { get; init; }
Enum member names.

Space

public double? Space { get; init; }
Gap above the field from SpaceAttribute, in pixels.

Deconstruct

public void Deconstruct(out string Name, out string Kind, out string? Element, out double? Min, out double? Max, out string? Tooltip, out string? Header, out string? Asset, out IReadOnlyList<string>? Options, out double? Space)
Copies the positional values into the output parameters.

Equals

public bool Equals(FieldMetadata? other)
Checks equality using the record's data.

Equals

public override bool Equals(object? obj)
Checks equality using the record's data.

GetHashCode

public override int GetHashCode()
Returns a hash of the record's data.

ToString

public override string ToString()
Returns a string representation of the record.

operator ==

public static bool operator ==(FieldMetadata? left, FieldMetadata? right)
Checks equality using the record's data.

operator !=

public static bool operator !=(FieldMetadata? left, FieldMetadata? right)
Checks whether the records differ.

Kaskade.Interop

KaskadeException

public sealed class KaskadeException

Inherits Exception

Represents an error returned by Kaskade's native scripting ABI.

ErrorCode

public int ErrorCode { get; }
Gets the stable numeric ABI error code.

Kaskade

ZitoInterop

public static class ZitoInterop
Typed managed bridge for synchronous calls into Zito components.

DoubleValue

public static AbiValue DoubleValue(double value)
Creates a numeric ABI argument for generated proxy methods.

GetComponent

public static T GetComponent<T>(GameObject owner) where T : struct, IZitoComponent<T>
Resolves a generated proxy on an object; an invalid proxy means the type is absent.

GetDouble

public static double GetDouble(ComponentHandle component, ulong fieldId)
Reads a Zito numeric field by its generated stable field ID.

InvokeDouble

public static double InvokeDouble(ComponentHandle component, ulong methodId, ReadOnlySpan<AbiValue> arguments)
Invokes a Zito method and converts its numeric result to System.Double.

InvokeVoid

public static void InvokeVoid(ComponentHandle component, ulong methodId, ReadOnlySpan<AbiValue> arguments)
Invokes a Zito method whose result is intentionally ignored.

SetDouble

public static void SetDouble(ComponentHandle component, ulong fieldId, double value)
Writes a Zito numeric field synchronously in the target VM instance.