FL# API

FL# scripts are C# files of a world, compiled by fluxc against this API (using NodeWorld.Flux;, and using Flux; for coroutines), not against UnityEngine. Names follow Unity's where they do the same thing.

Generated from the /// comments of the code, SDK 0.2.0.

Flux

TypeKindSummary
CoroutineclassA running coroutine (an IEnumerator driven by the frames of the instance).
CustomYieldInstructionclassA yield instruction written as a property: the coroutine waits while keepWaiting is true.
Framestatic classThe frames of the instance: clock, frame count, and "await Frame.Next()".
IWebReceiverinterfaceWhat the host tells about a request or a socket (on the scripts' thread).
MainThreadstatic classThe main thread of the world: the thread of the frames and of the events, the only one where the API that touches the world runs.
WaitForSecondsclassResumes a coroutine after a number of seconds of script time.
WaitUntilclassResumes the coroutine once the predicate is true (checked at once, then at each frame).
WaitWhileclassResumes the coroutine once the predicate is false (checked at once, then at each frame).
WebRequestDataclassA request for the host: method, absolute address, headers (one line each, values joined), body.
WebTransportclassThe host side of System.Net.Http.HttpClient and System.Net.WebSockets.ClientWebSocket: the API of the program's host sets Current before any script runs (NodeWorld.Flux for worlds: every address goes through the netwo…

NodeWorld.Flux

TypeKindSummary
AnimatorclassAn Animator of the world: its parameters, its states and its speed.
AssetclassAn asset of the world (sound, material, texture, sprite, mesh): a field set from the scene, or read from a component of the world (audioSource.clip, renderer.sharedMaterial...).
AudioClipclassA sound of the world: a field set from the scene, or the clip of an AudioSource.
AudioSourceclassAn Audio Source of the world: plays its clip, in 2D or 3D, as Unity's.
BatchFieldsenumThe arrays of an object batch: which ones the client fills ([Read]) or applies ([Write]).
BatchSpaceenumThe space of the positions, rotations and scales of an object batch.
BehaviourclassA component of the world that can be switched on and off.
BoneenumA bone of a player's avatar (the bones the network shares).
BoundsstructAn axis-aligned box: center and extents (half size).
BoxColliderclassA Box Collider of the world.
ButtonclassA Button of a canvas of the world.
CameraclassA camera of the world: the player's (Camera.main, to read), or one a script made (Create), which renders into a render texture when the script calls Render.
CameraClearFlagsenumWhat a camera draws before the scene (Unity's values).
CanvasclassA Canvas of the world: enabled shows or hides it.
CanvasGroupclassA Canvas Group: the transparency and the clicks of a UI object and its children.
ClientOnlyAttributeclassThe script runs only on the clients of the players (the game server does not create it).
ColliderclassA Collider of the world: a box, a sphere, a mesh or another kind.
CollisionstructA collision of the object with another collider (OnCollisionEnter).
ColorstructA color, as Unity's: red, green, blue and alpha (opacity), 0 to 1 each.
ComponentclassA component of an object of the world.
DataTextureclassA small texture of floats written by the script (RGBA, point filtering, clamped, no mipmaps, linear): data for shaders, given to them with Shader.SetGlobalTexture.
Debugstatic classWrites lines to the log of the game that runs the script (the Unity Console in Play mode, the server's log on a server), each starting with [FL# world id].
DropdownclassA dropdown list of a canvas of the world (uGUI or TextMeshPro).
FFTWindowenumThe window AudioSource.GetSpectrumData applies before its FFT, as Unity's.
FluxScriptclassBase class of the scripts of a world.
ForceModeenumHow AddForce and AddTorque apply their vector, as Unity's.
GameObjectclassAn object of the world: a GameObject of the scene, or one the scripts made.
GeometryUtilitystatic classPlanes of a camera's view (its frustum), as Unity's GeometryUtility.
HandenumA hand of the player.
ImageclassAn image of the UI (Image with a sprite, or RawImage with a texture).
ImageConversionstatic classDecodes images into textures of the world, as Unity's ImageConversion: a PNG or JPG in bytes (a web response, HttpClient.GetByteArrayAsync) becomes a Texture to give to a material.
IndexFormatenumThe size of the indices of a mesh (Unity's values).
Inputstatic classThe input of the local player, read each frame.
InputAxisenumThe axes of the local player's controls (Input.GetAxis).
InputButtonenumThe buttons of the local player's controls (VR controllers, or what the desktop controls map to them).
InputFieldclassA text field of a canvas of the world (uGUI or TextMeshPro).
InstancedMeshclassCopies of a mesh drawn by the client every frame, without GameObjects (grass, crowds, debris): a matrix per copy in the memory of the world, and optional per-copy material properties (the material's shader must read t…
Interactionstatic classWhat players do with the objects of the world: use them, take them in hand, and the text they see when pointing at them.
KeyenumKeys of the keyboard a world may read (players on a computer).
LODGroupclassA LOD Group of the world.
LightclassA Light of the world.
LineRendererclassA line drawn between points (also the base of TrailRenderer's colors and widths).
MaterialclassA material of the world.
Mathfstatic classMath on floats, with the names of Unity's Mathf, computed inside the world's module.
Matrix4x4structA 4x4 matrix, mRC = row R, column C, stored column after column (as Unity's).
MeshclassA mesh: from the scene (a field, MeshFilter.sharedMesh), or made by the script (new Mesh()), on the model of Unity's.
MeshColliderclassA collider shaped by a mesh (a mesh of the scene or one made by a script).
MeshFilterclassThe Mesh Filter of a renderer of the world: the mesh it draws.
MeshTopologyenumHow the indices of a submesh are joined (Unity's values).
MeshUpdateFlagsenumWhat a mesh change skips (Unity's values), for SetVertexBufferData, SetIndexBufferData and SetSubMesh.
NetReaderclassReads what a NetWriter wrote, in the same order.
NetWriterclassWhat a script writes to the network: its synced state (OnSerialize) or the arguments of a network event.
NetworkEventTargetenumWho receives a network event of a script (FluxScript.SendNetworkEvent).
Networkingstatic classThe network of the room: the owners of objects and the master, synced transforms, objects spawned for the room, and the server's clock.
ObjectclassAn object of the world (GameObject, component, render texture), seen by a script through a handle the host gives.
ObjectBatchclassMany objects of the world handled in one go, a crossing of the boundary per frame instead of one per object and per value.
ParentConstraintclassA parent constraint of the world (Unity's ParentConstraint): the object follows its sources, each with a weight.
ParticleSystemclassA Particle System of the world.
ParticleSystemStopBehaviorenumWhat ParticleSystem.Stop does with the particles alive.
Physicsstatic classRays and overlaps in the world's colliders, on each player's game (the server has no physics).
PlanestructA plane: the points p with Dot(normal, p) + distance == 0.
Playerstatic classThe local player, as a script sees it: its pose, its avatar's bones, and what a world may do to it (teleport, walking speeds, gravity, velocity, haptics).
PlayerDatastatic classValues a world keeps for the local player between visits (kept by the client, for this NodeWorld account and this world): a language chosen, a volume...
PlayerInfostructA player of the room, as a script sees it (read only).
Playersstatic classThe players of the room.
PortalOptionsstructWhere a world portal leads, and where it stands.
Portalsstatic classThe portals of the world, created by the scripts that run on the server (World.isServer).
QuaternionstructA rotation (unit quaternion, Hamilton product: lhs * rhs rotates by rhs, then by lhs).
QueryTriggerInteractionenumWhether rays and overlaps hit trigger colliders.
Randomstatic classRandom numbers as Unity's Random: one sequence for the world, which InitState makes the same for every player who uses the same seed (shows played in sync).
RaystructA ray: a starting point and a direction of length 1.
RaycastHitstructWhat a ray hit (Physics.Raycast).
RectTransformclassThe Rect Transform of a UI object: its place and size in its parent rect.
ReflectionProbeclassA Reflection Probe of the world.
RenderTextureclassA texture a camera of the scripts renders into (Create).
RendererclassA Renderer of the world: it draws a mesh, a line, a trail, particles.
RigidbodyclassA Rigidbody of the world: its physics runs on each player's game.
RigidbodyConstraintsenumWhat the physics may not move or turn on a rigidbody (Rigidbody.constraints); combine them with the | operator.
RigidbodyInterpolationenumHow a rigidbody is drawn between physics steps (Rigidbody.interpolation).
ScrollRectclassA Scroll Rect of a canvas of the world.
ScrollbarclassA Scrollbar of a canvas of the world.
SelectableclassBase of the UI controls a player clicks.
ServerOnlyAttributeclassThe script runs only on the game server (the clients do not create it).
Shaderstatic classGlobal shader properties of the world (read by the world's materials, e.g.
ShaderAssetclassA shader of the world (the one of a material: Material.shader), to give to another material of the world.
ShadowCastingModeenumHow a renderer casts shadows (Unity's values).
SliderclassA Slider of a canvas of the world.
SpaceenumThe axes Translate and Rotate use.
SphereColliderclassA Sphere Collider of the world.
SpriteclassA sprite of the world: a field set from the scene, or the sprite of an Image.
SubMeshDescriptorstructA submesh as SetSubMesh sets it: a range of the index buffer, its topology, the vertex added to its indices.
TextclassA text of the world: TextMeshPro (3D or UI) or a UI Text.
TextureclassA texture of the world: a field set from the scene, a material's, or one a script loaded (Texture.LoadFromUrl, ImageConversion.LoadImage).
Timestatic classTime of the world, set by the host at each frame.
ToggleclassA Toggle of a canvas of the world.
TrackingPointenumA tracked point of a player: the head (eyes) and the hands.
TrailRendererclassA Trail Renderer of the world: its widths and colors are those of LineRenderer.
TransformclassThe position, rotation, scale and parent of an object, as Unity's Transform.
UiEventclassA UI event of a component (click, value change...): the listeners run in the script that added them; a listener that throws stops its script, like a callback.
UiEvent<T>classA UI event that carries a value (slider position, toggle state, dropdown index, text).
Vector2structA point or a direction in 2D, as Unity's Vector2.
Vector3structA point or a direction in 3D, as Unity's Vector3: x right, y up, z forward.
Vector4structFour values, as Unity's Vector4: a point with w, a plane, shader data.
VertexAttributeenumA vertex attribute of a mesh (Unity's values).
VertexAttributeDescriptorstructOne attribute of the vertex layout (SetVertexBufferParams): which, in which format, how many values, in which stream (0 to 3).
VertexAttributeFormatenumThe format of a vertex attribute in the vertex buffer (Unity's values).
VideoErrorenumWhy a video player failed.
VideoPlayerclassA video player of the client (libVLC): web pages of video sites are resolved to their media by the client (yt-dlp).
VideoStateenumWhere a video player is.
VoiceSettingsstructHow the local player hears another player's voice.
VolumeclassA post-processing volume of the render pipeline.
Worldstatic classWhere the scripts run, and which world and instance.